[PyQt] Modal window issue with pyqt on KDE

Vincent Vande Vyvre vincent.vande.vyvre at telenet.be
Wed Dec 28 11:44:17 GMT 2016


Le 28/12/16 à 11:36, Michael Davies a écrit :
> Hi,
>
> This is my first post on a mailing list - so please bear with me.
>
> I have noticed an issue with running a modal QDialog on the KDE5 
> desktop.  When I run the following code:
>
> import sys
> from PyQt5 import QtCore
> from PyQt5 import QtWidgets
>
> class MainWindow(QtWidgets.QMainWindow):
>
>     def __init__(self, parent=None):
>         super(MainWindow, self).__init__(parent)
>
>         self.openAction = QtWidgets.QAction('About', self)
>         self.openAction.triggered.connect(self.aboutDialog)
>         menuBar = self.menuBar()
>         fileMenu = menuBar.addMenu('&File')
>         fileMenu.addAction(self.openAction)
>         self.calendar = QtWidgets.QCalendarWidget(self)
>         self.setCentralWidget(self.calendar)
>
>     def aboutDialog(self):
>         self._about = AboutDialog(self)
>         self._about.exec_()
>
> class AboutDialog(QtWidgets.QDialog):
>
>     def __init__(self, parent):
>         super(AboutDialog, self).__init__(parent)
>
>         self.setMinimumSize(400, 350)
>
> if __name__ == '__main__':
>     app = QtWidgets.QApplication(sys.argv)
>     app_window = MainWindow()
>     app_window.showMaximized()
>     sys.exit(app.exec_())
>
> The issue is this - when I open the QDialog and then minimize the main 
> window, the QDialog doesn't get minimized - so it is still working 
> independently.  What happens exactly is that QMainWindow minimizes and 
> QDialog is just left on screen.
>
> This only happens on KDE as far as I can tell.  On openbox / xfce both 
> windows are minimized.  In Windows, the QMainWindow minimize button is 
> disabled when the QDialog is open.  I have ran the code on various KDE 
> distros: KDE Neon Stable, Arch Linux with KDE5 and Kubuntu 16.04 - all 
> have same problem.
>
> Any help with this issue would be much appreciated!
>
> Michael
>
>
>
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt

Works as expected on Mate (ex gnome2), both windows are minimized.

Seems a behavior of KDE.


Vincent

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20161228/b5fbfe56/attachment.html>


More information about the PyQt mailing list