[PyQt] Reopening QT Window - Segfault

Hans-Peter Jansen hpj at urpla.net
Tue Apr 26 10:45:23 BST 2011


On Tuesday 26 April 2011, 11:01:14 Michka Popoff wrote:
> Hello, and sorry to re-ask my question, but I really need a working
> GUI to display my OpenGL.
>
> I think I have read everything on the web about closing pyQT. Some
> people say you can't call QApplication twice, but don't give an
> alternative solution. Others give code snippets with app.exec_loop()
> and not app.exec_(). Some others use a connection :
>
> connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
>
> This doesn't work either.
>
> I would have switched to someting else, but GLUT or ToGL (Tkinter)
> are not very good solutions, wxPython is not compilable for 64 bit
> under macports, GTKglext is not working well with macports, GTK
> apputils is deprecated ... So I am stuck here : how to create a basic
> OpenGL window under Linux and Mac OS X, which can be closed/reopened
> without crashing and make the main GTK app quit ...

It's a well known limitation of PyQt (and probably of Qt, too). Having 
it working for a single arch is pure luck.

Why can't you reuse your app instance? Just close and reopen the widget 
and keep the application instance, or start the PyQt part as an extra 
process.

Your chaining of two toolkits sounds, hmm, complicated..

Cheers,
Pete


More information about the PyQt mailing list