Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Managing multiple windows
Qt 6.12 LTS is out! See what's new in the release blog

Managing multiple windows

Scheduled Pinned Locked Moved Unsolved Qt for Python
1 Posts 1 Posters 51 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alson
    wrote last edited by
    #1

    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.
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt
    • Unsolved