discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Enable QT multi threading in the qtgui template


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] Enable QT multi threading in the qtgui template
Date: Wed, 25 Sep 2013 13:10:16 -0400

On Wed, Sep 25, 2013 at 11:39 AM, Sylvain Munaut <address@hidden> wrote:
> 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

Sylvain,

Have you solved your problem from yesterday with the OOT project
inheriting from the QTGUI blocks? Basically, it should be possible (at
least, I want it to be possible), but it's probably never been done
before. I have tried to make sure everything's been exported from
libgnuradio-qtgui to enable this, but I've never actually tried it.

And obviously, any patches you needed to make to the qtgui library for
this should go back into the main code to help this work better in the
future.

As to the posix/X11 issue. We do some similar stuff elsewhere for
different platform support, though mostly this is in the Cmake files.
It's not out of the question what you've done. We'd have to look at it
in the bigger picture. Your checks around it look good, though, so it
seems harmless enough. I'm guessing that ctypes.cdll.LoadLibrary
returns None if libX11.so isn't found?


-- 
Tom
GRCon13 Oct. 1 - 4
http://www.trondeau.com/grcon13



reply via email to

[Prev in Thread] Current Thread [Next in Thread]