Hello Herbert! In JanelaLogin.logar, you assign the new window to "janela", but that variable only exists until the end of the method. When the method is done, the window gets garbage-collected, because Python thinks there's no way you can get to it again.
To quickly fix this, you can use a list of windows: at the module level, write `windows = []`, and then in JanelaLogin.logar, put `windows.append(janela)`. The windows will be referenced from the list, so they can't get garbage-collected. If the application will create lots of windows, you'll also need to remove them from the list when they're no longer needed. Hope that helps. PySide developers: Could QApplication mentioning its topLevelWidgets() in tp_traverse prevent these errors? Is there any reason for not doing that? Petr On Wed, Sep 14, 2011 at 20:26, HERBERT HUDSON <[email protected]> wrote: > Hello Guys, > > First let me apologize for my English. > > I'm looking at various web sites and still not found, if someone can help > me, I'll be very grateful, can be a simple tutorial or example or correcting > my mistake. > > I'm trying to open multiple windows and do not know how, I tried to use > thread and pass by reference, but failed. > > I have two windows created with the QtDesigner and converted to Python: > JanelaLogin.py -> to login > JanelaPrincipal.py -> main window > > I'll start JanelaLogin, and after login, view the JanelaPrincipal > > here's one of the examples I tried: > http://pastebin.com/Dj8YxUNQ > I do not know if I'm using the list correctly, so if it has something wrong, > please tell me. > > Thank you for you attention > Herbert > > _______________________________________________ > PySide mailing list > [email protected] > http://lists.pyside.org/listinfo/pyside > > _______________________________________________ PySide mailing list [email protected] http://lists.pyside.org/listinfo/pyside
