[Interest] QtThread

2014-01-13 Thread Graham Labdon
Hi
I have been reading about QtThread and there seems to be a lot of discussion 
about how to correctly use this class. i.e. should developers derive from 
QtThread or provide an QObject and move this object to a thread.
The examples provided with Qt5 derive from QtThread whereas there is a lot of 
chatter on the web saying this is not the correct way.

Can anyone provide some definitive answers on how developers are to use 
QtThread?

Thanks
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QtThread

2014-01-13 Thread Etienne Sandré-Chardonnal
Hi,

As Andrey pointed out, there is not a single way. But if you want to use a
QThread for running QObjects with its event loop, the most simple way is
not to subclass, and moveToThread.

This is well explained here:
http://blog.qt.digia.com/blog/2010/06/17/youre-doing-it-wrong/
http://mayaposch.wordpress.com/2011/11/01/how-to-really-truly-use-qthreads-the-full-explanation/

Cheers,

Etienne



2014/1/13 Chaser chaser.and...@gmail.com

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

  Hi I have been reading about QtThread and there seems to be a lot
  of discussion about how to correctly use this class. i.e. should
  developers derive from QtThread or provide an QObject and move this
  object to a thread. The examples provided with Qt5 derive from
  QtThread whereas there is a lot of chatter on the web saying this
  is not the correct way.
 
  Can anyone provide some definitive answers on how developers are to
  use QtThread?
 
  Thanks ___ Interest
  mailing list Interest@qt-project.org
  http://lists.qt-project.org/mailman/listinfo/interest
 
 You must know that QThread is not the thread itself, but it's a class
 for manipulation of the thread. So, the QThread object stays in main
 thread.

 Derive from QThread and moveToThread() are two correctly use-case of
 QThread.

 IMHO, deriving from QThread is more complicated, you must understand,
 how to create objects and run code in new thread, but not in QThread's
 parent thread.
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v2.0.22 (GNU/Linux)
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iF4EAREIAAYFAlLTs1AACgkQZxvOZ+bTdZheVAD9GOwA8IsVjZZJXdCL/KR2u+lH
 9rGA8qeZ1mY/zIqel1UA/3pB+SLGHzzA89oxF6jpcFcD0/HEAfaf2VoVVe7/n+vj
 =6OTm
 -END PGP SIGNATURE-
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Storing QMaps in a QVariant

2014-01-13 Thread Alejandro Exojo
2014/1/10 Alejandro Exojo aex...@modpow.es:
 In Qt 5.2 I see Q_DECLARE_ASSOCIATIVE_CONTAINER_METATYPE, where it
 even clarifies that all of the Qt associative containers already have
 built-in support and that if the key/value are already supported,
 QVariant should store everything. However, I'm not getting a
 QMapquint8, quint16 inside a QVariant::fromValue.

 I've tried to use the different macros provided, and even add a call
 to qRegisterMetaType, just in case. I also tried a typedef. I think
 I'm missing something obvious, but I don't see what. Here is what I
 got:

 http://pastie.org/8620095

 Thank you.

I was indeed, missing something obvious: QVariant stored the values
just fine, it was the call to QSettings that was triggering warnings
at runtime about load() and save().

A simple call to
qRegisterMetaTypeStreamOperatorsQMapquint8,quint16(); made
QVariant save things in the configuration file and retrieving them
back.

-- 
Alejandro Exojo Piqueras

ModpoW, S.L.
Technova LaSalle | Sant Joan de la Salle 42 | 08022 Barcelona | www.modpow.es
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Android] Profiling QML application

2014-01-13 Thread Koehne Kai

 -Original Message-
 From: interest-bounces+kai.koehne=digia@qt-project.org
 [mailto:interest-bounces+kai.koehne=digia@qt-project.org] On Behalf Of
 Ben Lau
 Sent: Sunday, January 12, 2014 5:53 PM
 To: interest@qt-project.org
 Subject: [Interest] [Android] Profiling QML application
 
 Hi ,
 
 I got a performance problem in loading QML in Android . Therefore I would
 like to run profiler on QML itself. However, when I launch the QML profiler
 within QT creator. The process hang on :
 
 D/Qt  (14973): qtcpserverconnection.cpp:173
 (voidQTcpServerConnection::listen()): QML Debugger: Waiting for
 connection on port 61428...

That's with Qt Creator 3.0? Please file a bug ...

Anyhow, as a 'workaround' you should be able to profile by launching the app 
yourself with e.g. -qmljsdebugger=port:61428,block argument, and then connect 
from Qt Creator with Analyze-Qml Profiler(external) ...

Regards

Kai
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Question about reading glsl shader source from a QResource using compression

2014-01-13 Thread Ola Røer Thorsen
Hi all,

I've been looking at the Scene Graph - Graph example application included
with Qt5.2.0, to see how to create a custom shader material for Qt Quick.

In linenode.cpp, there is a LineShader class, where the shaders are read
like so:

const char *vertexShader() const {

QResource r(:/scenegraph/graph/shaders/line.vsh);

Q_ASSERT(r.isValid());

return (const char *) r.data();

}


const char *fragmentShader() const {

QResource r(:/scenegraph/graph/shaders/line.fsh);

Q_ASSERT(r.isValid());

return (const char *) r.data();

}


In the documentation for QResource, it says that the data returned by
r.data may be compressed. So is this way of reading the shader source code
safe at all times? Shouldn't it check with r.isCompressed and if so,
uncompress? Is there some assumption here that such small text files aren't
compressed?

Cheers,
Ola
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt laptop stickers

2014-01-13 Thread Juergen Bocklage-Ryannel

On 07.01.14 05:51, ??? ??? wrote:

Hello.

Does anyone have a Qt laptop stickers? Can you sell me some?

Best regards,
Nick


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Hmm,

I think I went out of them. At least haven't seen them for a while.

If a DIGIA person is listening. Would be great to have some general 
merchandising of Qt. E.g. Qt shirts, Qt mugs, Qt stickers, Qt-Teddy, 
Qt-Mousepad, etc... There should be some companies around which offer 
these kind of merchandise-services. DIGIA owns the copyright to the 
Qt-logo and trademark, as far as I know.


/ juergen
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] [QQuickView] rendering not started

2014-01-13 Thread Tim Blechmann
hi all,

trying to use a QQuickView from a plugin context (from a
QMacNativeWidget), i'm sometimes having problems that the initial
rendering is not performed. unfortunately this seems to depend on the
plugin host.

trying to debug this issue by tracing the signals, i've found out the
following:

* the QQuickView rendering does not seem to be triggered: the
beforeRendering signal is not emitted

* i've called QQuickWindow::update() from a lambda function connected to
QQuickView::statusChanged() in the case of QQuickView::Ready. in order
to schedule the rendering of another frame. but this does not seem to
happen (not beforeRendering signal is emitted).

* the GUI interaction works: mouse/keyboard events are handled
correctly. once the size of the root item is changed from the qml
context, the QQV behaves well.

is there any way to force the start of the rendering? or any idea how to
debug this further?

thanks in advance,
tim


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QtThread

2014-01-13 Thread Sze Howe Koh
On 13 January 2014 18:26, Etienne Sandré-Chardonnal
etienne.san...@m4x.org wrote:
 Hi,

 As Andrey pointed out, there is not a single way. But if you want to use a
 QThread for running QObjects with its event loop, the most simple way is not
 to subclass, and moveToThread.

 This is well explained here:
 http://blog.qt.digia.com/blog/2010/06/17/youre-doing-it-wrong/
 http://mayaposch.wordpress.com/2011/11/01/how-to-really-truly-use-qthreads-the-full-explanation/

To balance things out, here's a direct response to Etienne's first
link: http://woboq.com/blog/qthread-you-were-not-doing-so-wrong.html

The correct method depends on what you want to achieve. I wrote
(most of) this page to compare/contrast all the different ways to do
parallel processing in Qt, and try to help readers choose the best way
for their application:
http://qt-project.org/doc/qt-5/threads-technologies.html (suggestions
for improvements are welcome!)


Regards,
Sze-Howe
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt laptop stickers

2014-01-13 Thread Bob Hood

On 1/13/2014 6:57 AM, Juergen Bocklage-Ryannel wrote:
 On 07.01.14 05:51, ??? ??? wrote:
 Hello.

 Does anyone have a Qt laptop stickers? Can you sell me some?

 Best regards,
 Nick


 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest
 Hmm,

 I think I went out of them. At least haven't seen them for a while.

 If a DIGIA person is listening. Would be great to have some general
 merchandising of Qt. E.g. Qt shirts, Qt mugs, Qt stickers, Qt-Teddy,
 Qt-Mousepad, etc... There should be some companies around which offer these
 kind of merchandise-services. DIGIA owns the copyright to the Qt-logo and
 trademark, as far as I know.

 / juergen


I'm pretty sure there was merchandising when Nokia owned Qt.  I still have my
(really rather cool) Qt pen, which I think I picked up at a past SIGGRAPH,
that has the qt.nokia.com URL on it.

I would agree:  It would be nice to have some product merchandising (pens,
mouse pads, stickers, etc.) to be able to show our pride in this fantastic
product.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QtThread

2014-01-13 Thread Etienne Sandré-Chardonnal
Thanks for the link!

You are right, in fact only the moveToThread(this) approach should be
really avoided.


2014/1/13 Sze Howe Koh szehowe@gmail.com

 To balance things out, here's a direct response to Etienne's first
 link: http://woboq.com/blog/qthread-you-were-not-doing-so-wrong.html


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QtThread

2014-01-13 Thread Thiago Macieira
On segunda-feira, 13 de janeiro de 2014 11:35:12, Chaser wrote:
 Derive from QThread and moveToThread() are two correctly use-case of
 QThread.

Just to be clear: those are two correct use-cases but they can't be used at 
the same time.

Option 1: derive from QThread (and override run(), writing your code there)

Option 2: (derive from QObject) and moveToThread()
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center


signature.asc
Description: This is a digitally signed message part.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Question about reading glsl shader source from a QResource using compression

2014-01-13 Thread Constantin Makshin
Presence and level of resource compression depends on command line
parameters passed to the resource compiler. IIRC compression is disabled by
default so all resources are stored as is unless you explicitly tell the
resource compiler to compress them and correct way of retrieving resource
data depends on your project settings.
On Jan 13, 2014 4:26 PM, Ola Røer Thorsen o...@silentwings.no wrote:

 Hi all,

 I've been looking at the Scene Graph - Graph example application included
 with Qt5.2.0, to see how to create a custom shader material for Qt Quick.

 In linenode.cpp, there is a LineShader class, where the shaders are read
 like so:

 const char *vertexShader() const {

 QResource r(:/scenegraph/graph/shaders/line.vsh);

 Q_ASSERT(r.isValid());

 return (const char *) r.data();

 }


 const char *fragmentShader() const {

 QResource r(:/scenegraph/graph/shaders/line.fsh);

 Q_ASSERT(r.isValid());

 return (const char *) r.data();

 }


 In the documentation for QResource, it says that the data returned by
 r.data may be compressed. So is this way of reading the shader source code
 safe at all times? Shouldn't it check with r.isCompressed and if so,
 uncompress? Is there some assumption here that such small text files aren't
 compressed?

 Cheers,
 Ola


 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Question about reading glsl shader source from a QResource using compression

2014-01-13 Thread Giuseppe D'Angelo
On 13 January 2014 13:25, Ola Røer Thorsen o...@silentwings.no wrote:

 In the documentation for QResource, it says that the data returned by r.data
 may be compressed. So is this way of reading the shader source code safe at
 all times? Shouldn't it check with r.isCompressed and if so, uncompress? Is
 there some assumption here that such small text files aren't compressed?

I think the example is just doing it wrong, it should instead load the
resource file contents using QFile into two QByteArrays into the ctor
and then return the QByteArrays' contents there.

-- 
Giuseppe D'Angelo
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] ios+audio

2014-01-13 Thread Nicola De Filippo
Hi,
has someone a example on how play a audio file with IOS? I have setter QTPLUGIN 
in the pro, but in the qml when i start the Multimedia player i have mute and 
no message error.
Suggest?
  Nicola
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt5.2-android: Fail to debugging app in qtcreator 3.0

2014-01-13 Thread Liang Jian
 After some investigation of QtActivityDelegate.java and the log file,
I think the problem is:
 pong file
/data/local/tmp/qt/debug-pong-org.qtproject.example.testAndroid was not
created before time out. I also checked the file system in
userdata-qemu.img of the android virtual device and found that the socket
file /data/data/org.qtproject.example.testAndroid/debug-socket has been
created by gdbserver and ping file
/data/data/org.qtproject.example.testAndroid/debug-ping has also been
created. But pong file
/data/local/tmp/qt/debug-pong-org.qtproject.example.testAndroid doesn't
exist, even the directory /data/local/tmp/qt doesn't exist.
So who is responsible for writing the pong file? Why the pong file
can't be created ? Any suggestion will be appreciated!


On Sun, Jan 12, 2014 at 12:04 PM, Liang Jian jianlian...@gmail.com wrote:

 Hello everyone,
 Recently I want to write apps for andriod using qt5.2, I wrote a very
 simple widget based test app using qtcreator 3.0 in a ubuntu 12.04 x64
 machine, the app run perfectly in the android virtual device, but I
 failed to debugging the app in the android virtual device, the message in
 'Application Output' panel of qtcreator tell me:

 Debugging starts
 Unable to start 'org.qtproject.example.testAndroid'.Debugging has
 failed
 Debugging has finished

 Then I check the log message by 'adb logcat  log.txt', it seems that
 Qt time out when waiting for pong file due to an exception has occurred at
 org.qtproject.qt5.android.bindings.QtActivity.loadApplication(), and the
 exception was thrown in QtActivityDelegate.startApplication(). but I don't
 know what to do. I have attached the log file, I hope this log file maybe
 helpful to you to find the issue in my environment, thanks!
 BTW, Is it possible for me to debug into QtActivityDelegate.java by
 qtcreator?

 Best Regards
 Liang Jian

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest