[Qt-interest] Running wx from a thread

Thiago Macieira thiago at kde.org
Tue Jul 6 22:53:48 CEST 2010


On Tuesday 6. July 2010 23.03.08 Javier Urien wrote:
> Hello List,
> 
>    I am trying to run a wxWidgets application from a QThread and run
> into some problems. First let me say that I want to start adding QT to
> a wxWidgets application and make the transition as smooth as I can,
> that's the reason for this Qt-wx madness.
>    I consulted the wx developer lists and they say in theory it should
> work. I based my qt app in QMandelbrot example, so the layout is like
> this. A Qt application with a main window, a Qthread with a run() from
> where I launch the wx-minimal example's main loop.
> 
>    From here the application hangs, and using the debugger I find that
> the main thread is calling methods of the wxapp object through
> QEventDispatcherGlib. I searched and could not find something
> helpfull. Can anyone point me to the right aproach to this problem?
> (please, rewriting is not an option right now).
> 
>    Also it is worth noting that, when run from the main thread the
> wxapp works, but the qt application does not (due to the fact that the
> qt application loop is not running)

X11 is not thread-safe. Trying to use non-GUI (any toolkit) from two different 
threads is going to cause you trouble.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100706/50462306/attachment.bin 


More information about the Qt-interest-old mailing list