Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. independent child QMainWindow with pyqt5
Forum Updated to NodeBB v4.3 + New Features

independent child QMainWindow with pyqt5

Scheduled Pinned Locked Moved Unsolved General and Desktop
pyqt5qmainwindow
3 Posts 2 Posters 3.7k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    sam81
    wrote on last edited by sam81
    #1

    I have an application in which a parent QMainWindow creates a child
    QMainWindow. In PyQt4 these two windows had independent icons in the
    taskbar (at least on KDE and Windows), and could be minimized/maximized
    independently. In PyQt5 the child window doesn't have an icon in the
    taskbar and cannot be minimized/maximized (fully) independently from the
    parent window. Is there a way to obtain the old behavior that was
    present in PyQt4?

    I have read about primary and secondary windows in Qt5 here:
    http://doc.qt.io/qt-5/application-windows.html
    but I've been unable to find a solution.

    Thank you for your help.

    Sam

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      How are you creating that child widget ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sam81
        wrote on last edited by
        #3

        Hi, thanks!

        I call the child QMainWindow from the parent QMainWindow as follows:

        self.responseBox = responseBox(self)
        

        This is the code initializing the child QMainWindow:

        class responseBox(QMainWindow):
            def __init__(self, parent):
                QMainWindow.__init__(self, parent)
        
                self.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.CustomizeWindowHint | QtCore.Qt.WindowMinimizeButtonHint | QtCore.Qt.WindowMaximizeButtonHint)
                self.setWindowModality(Qt.NonModal)
        

        The full source code of the application is available online:
        https://github.com/sam81/pychoacoustics
        The child main window is created on line 834 here
        and the code initializing it is here

        I'll try to generate a small reproducible example and post it here as soon as I have time.

        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 Extensions
        • Unsolved