[Development] Trigger Qt event loop from external message loop

Roland Winklmeier roland.m.winklmeier at gmail.com
Sat Dec 14 21:25:33 CET 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks very much Olivier and Thiago!
That works brilliant.

No idea why I forgot that QThread must not be used. But its of course
obvious. I made a quick setup with native threads (std::thread is
unfortunately not supported by VC2010) and it works perfectly now.

In case someone is interested:
- - I added a additional shared library spawning a thread and links the
actual plugin during runtime with LoadLibrary/dlopen. No Qt stuff in here.
- - Second shared library creates QApplication object and runs its
exec() loop.

Cheers Roland

Am 14.12.2013 19:23, schrieb Thiago Macieira:
> On sábado, 14 de dezembro de 2013 12:42:32, Roland Winklmeier
> wrote:
>> n qthread_win.cpp QThreadPrivate::start -> void
>> QThreadPrivate::createEventDispatcher(QThreadData *data) { 
>> QEventDispatcherWin32 *theEventDispatcher = new
>> QEventDispatcherWin32; 
>> data->eventDispatcher.storeRelease(theEventDispatcher); 
>> theEventDispatcher->startingUp(); }
> 
> You must not use QThread.
> 
> You need to start your thread before using any QObject-derived
> classes. Once you're there, instantiate the QApplication.
> 
> 
> 
> _______________________________________________ Development mailing
> list Development at qt-project.org 
> http://lists.qt-project.org/mailman/listinfo/development
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSrL69AAoJEI9ELizP04baQVUH/2G6IGrxCz2UJxl/tVGeKxkE
LGZyzjYu5zLZnG93pUKGWoaUoHzB4VPfrzr+ILgbYuO+OOgmRw/h8dlRjpgJTIvu
H5P9WmyxSmgkBaD+x4bxwOE/gtlQZ8eTchD/vfHvOxqET3g3RBXt+8yrF3QJUNqd
g8v6m3BGrTHY7E7X3Oqs8kqkr/Q8KmcLyrSSrSu1bB4yir+eyukj3CkIX0TKoLG8
hOexewm5O2G97sqB99/Jm6q45hpeSxKYX5J5ahahEJCJlbfgluOk35RSlM5K8yYS
d2WbSsA16bnadl+G2ElRYWEOx4q1sWpio5aXBxefmDOnDNWoUs9ZPr1BxQfQwoE=
=nv6M
-----END PGP SIGNATURE-----

---
Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv.
http://www.avast.com




More information about the Development mailing list