Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
independent child QMainWindow with pyqt5
sam81 last edited by sam81
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:
but I've been unable to find a solution.
Thank you for your help.
Hi and welcome to devnet,
How are you creating that child widget ?
sam81 last edited by
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)
I'll try to generate a small reproducible example and post it here as soon as I have time.