[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] Enable QT multi threading in the qtgui template
From: |
Sylvain Munaut |
Subject: |
[Discuss-gnuradio] Enable QT multi threading in the qtgui template |
Date: |
Wed, 25 Sep 2013 17:39:58 +0200 |
Hi,
In my quest to implement some OOT GUI widgets, I was hit by a number
of crashes because I need to do rendering (which includes some X/xcb
calls) from another thread than the main GUI thread.
Now, under QT it's documented how to do it and it's fairly painless
_except_ that if you're under linux and using X11, you need to call
XInitThreads() before doing any GUI stuff (so before creating the
QApplication for instance).
My current solution is to add this before creating the QApplication :
if os.name == 'posix':
x11 = ctypes.cdll.LoadLibrary('libX11.so')
if x11:
x11.XInitThreads()
Does anyone see a better solution ?
Does that stand any chance of getting merged ?
Cheers,
Sylvain
- [Discuss-gnuradio] Enable QT multi threading in the qtgui template,
Sylvain Munaut <=