[PyQt] Reopening QT Window - Segfault

Hans-Peter Jansen hpj at urpla.net
Tue Apr 26 14:27:32 BST 2011


Michka,

please keep the ML CCed at least. If somebody is searching for a similar 
issue, he might be interested in the follow-ups.

On Tuesday 26 April 2011, 11:58:03 Michka Popoff wrote:
> > It's a well known limitation of PyQt (and probably of Qt, too).
> > Having it working for a single arch is pure luck.
>
> Ok, I thought that : if it works on OS X, why not on Ubuntu ?

Because the kept state and the states' behavior below QApplication is 
very different between different archs.

More importantly, don't rely on it. 

> > 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.
>
> Reuse it ? How ? Do I need to call something after app.exec_() to
> keep the application instance in memory ?

Well, that mostly depends on your existing environment and how you want 
to interact with your GUI elements.

Usually, you keep a reference to the application and top level window 
instance, and control them with Qt signals. 

> Start it in an extra process is using a thread ? Don't know if this
> is the solution.

No, threading is something different. Just start is as another process, 
e.g. with subprocess.Popen.

Pete


More information about the PyQt mailing list