Qt 5.0.2, PyQt5, Linux, QPageSetupDialog empty or missing
The QPageSetupDialog fails to appear (or is empty).
I think this is a bug, since similar code was working before.
Here is a reduced version that demonstrates the bug.
from PyQt5.QtCore import Qt, QObject
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton
from PyQt5.QtPrintSupport import QPrinter, QPageSetupDialog
print("Opening page setup dialog")
printer = QPrinter()
dialog = QPageSetupDialog(printer)
dialog.accepted.connect(self.acceptSlot) dialog.rejected.connect(self.acceptSlot) # Choose one: all are broken: #dialog.open() # window modal, but no dialog appears #dialog.show() # modeless, but no dialog appears dialog.exec_() # app modal, dialog box appears but is empty
print('accepted or canceled')
app = QApplication(sys.argv)
mainWindow = QMainWindow()
mainWindow.setGeometry(100, 100, 500, 40)
printConverser = PrintConverser()
button = QPushButton("Setup page")
This was also reported by someone else and fixed here: https://bugreports.qt-project.org/browse/QTBUG-31790.
It affects Qt5.0.x up to 5.1.1 where it was fixed. Ubuntu 13.4 ships with Qt5.02 and doesn't seem to update with the bug fix. I suppose there are not many Qt apps on Ubuntu. I am surprised this bug wasn't found or reported by KDE, maybe KDE is not on Qt5.02 yet.