No MainWindow after refactoring

David Boddie david at boddie.org.uk
Fri Jun 25 12:28:01 BST 2021


On Wed Jun 23 22:49:16 BST 2021, Axel Rau wrote:

> Source can be checked out here:
> 	git clone git at codeberg.org <mailto:git at codeberg.org>:ajr/zad.git
> 
> This version runs the DNS stuff until completion but does not display the
> MainWindow, only the app icon. It requires a network connection. 

It looks like the main window will be destroyed before the application's
event loop runs.

In https://codeberg.org/ajr/zad/src/branch/master/zad/views/main.py you
create an instance of ZaMainWindow and configure it, but you don't return it
to the calling function or keep a reference to it, so it will be garbage
collected.

It's probably easiest to return mw to the caller and keep a reference to it
there.

David


More information about the PyQt mailing list