Qt 6.12 LTS is out! See what's new in the release
blog
Managing multiple windows
-
Re: Parent-child closing windows in pyside6
Hi Mejias
So am not sure on how your entire application flow structure / usecase occurs, but here's what i have:- if a user logins through LoginApp , on success opens MainMenu followed by the rest of the Windows (QWidget). In my case , this is what i have been using:
class MainMenu(QWidget): super().__init__() def __init__(self): # declare class attributes/variables that hold the application other windows self.mainTreeMenu = None # when a user performs an operation, e.g clicks a button set the instance of KsecOption or RoleMainWindow ..e.tc. to class variable self.mainTreeMenu = MainTreeMenu() self.mainTreeMenu.show()To improve your application
- add a condition statement to always check if the application window is open and not
None. - setup a custom Signal emitter from your child window, which is then picked up by a slot(method) connected to that signal.