[PyQt] Issue with Qt.Drawer in PyQt5

Thomas Robitaille thomas.robitaille at gmail.com
Thu Jun 15 10:57:45 BST 2017


Hi everyone,

I am trying to create a Drawer widget - in PyQt4 this works fine:

from PyQt4 import QtCore, QtGui
app = QtGui.QApplication([])
window = QtGui.QWidget()
drawer = QtGui.QWidget(window)
drawer.setWindowFlags(QtCore.Qt.Drawer)
window.show()
drawer.show()
app.exec_()

However, if I try the same in PyQt5, I get a standalone pop-up window
and not a drawer:

from PyQt5 import QtCore, QtWidgets
app = QtWidgets.QApplication([])
window = QtWidgets.QWidget()
drawer = QtWidgets.QWidget(window)
drawer.setWindowFlags(QtCore.Qt.Drawer)
window.show()
drawer.show()
app.exec_()

Does anyone know what could be happening here?

Thanks!
Tom

(I cross-posted onto StackOverflow too:
https://stackoverflow.com/questions/44439083/drawer-widget-not-working-with-qt5-pyqt5
- but did not get any replies)


More information about the PyQt mailing list