[Interest] [QQuickView] deadlock on exit

Tim Blechmann tim at klingt.org
Wed Jan 8 17:44:21 CET 2014


>>>> not sure, if i am doing something completely wrong here.
>>>> i'm using a QMainWindow with a QQuickView as central widget. the
>>>> application does not make use of QApplication::exec, but i'm polling the
>>>> event loop manually from the application.
>>>
>>> You're doing something wrong. Use exec().
>>
>> afaict this is not possible when integrating a Qt event loop into the
>> event loop of an existing application or when using a Qt from a plugin
>> which is simply not allowed to have its own event loop. or am i missing
>> something obvious?
> 
> Find a way to use exec() anyway. Qt wants exec(). You must make that thread 
> use it: either by making the application use Qt's mainloop or by moving your 
> code to a thread.

i will see what i can do ... what do i need to do in order to run exec()
from a thread other than the main thread? afaict it wants to be called
from the main thread, so simply creating a std::thread to run
qApp->exec() does not work.

converting he application itself to use qt's main loop might be
possible, but requires some non-trivial architectural changes.

and for the case of a plugin, i think it is simply impossible, because
afaict the plugin's gui has to run in the same thread as the host's gui.


> At the very least, let us know if this problem happens with exec(). If it 
> does, then we potentially have a problem that we should fix.

will see, maybe it can be reduced


> If it doesn't happen with exec(), then we'll conclude it's the lack of using 
> exec() that is the problem and will probably do nothing.

in this case, would it be possible to change the faq entry:
http://qt-project.org/faq/answer/how_can_i_create_a_3rd_party_plugin_using_qt_that_performs_event_handling
?

because point 2 is exactly the approach that i am following.

tim




More information about the Interest mailing list