[Interest] Event handling for QObjects created before QApplication

Hamish Moffatt hamish at risingsoftware.com
Wed Sep 24 03:20:39 CEST 2014


On 22/09/14 10:46, Thiago Macieira wrote:
> On Monday 22 September 2014 04:24:21 Dmitrii Volosnykh wrote:
>> Threads and QObjects
>> <http://qt-project.org/doc/qt-5/threads-qobject.html> tutorial
>>
>> says:
>>> Note that for QObjects that are created before QApplication,
>>> QObject::thread() returns zero. This means that the main thread will only
>>> handle posted events for these objects; other event processing is not done
>>> at all for objects with no thread.
>> Could someone elaborate on this, please? The most confusing part is "main
>> thread will only handle posted events for these objects".
> Qt is not supported before the creation of QCoreApplication. Your use-case is
> not supported, so no answer is necessary.
>
> Just don't do it.
>
> Note: the doc is wrong.

Does that mean static objects are not supported either?

We have lots of const QStrings in our (Qt4) application, and some static 
(non-const) QLists. But none of these are QObjects and I don't think we 
have any static QObjects.


Hamish




More information about the Interest mailing list