gmarull/qtmodern

QMainWindow.showMaximized does not work

dodspunkare opened this issue · 1 comments

When calling showMaximized in QMainWindow nothing happens.
Nor does calling setWindowState(Qt.WindowMaximized).
Calling from the central widget does nothing.

However, when calling showMaximized on the modern-wrapper it works.

class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__(flags=Qt.Window)

        central_widget = Master(self)
        self.setCentralWidget(central_widget)

        self.showMaximized()  # <- This does not work
        self.setWindowState(Qt.WindowMaximized)  # <- This does not work


class Master(QWidget):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        
       self.parent().showMaximized()  # <- This does not work


def main():
    app = QApplication(sys.argv)

    main_window = MainWindow()
    main_window.showMaximized()  # <- This does not work
    qtmodern.styles.dark(app)
    modern_window = qtmodern.windows.ModernWindow(main_window)
    modern_window.show()
    modern_window.showMaximized()  # <- This DOES work!
    sys.exit(app.exec_())

if __name__ == '__main__':
    main()

I have found, that showFullScreen() also does not work