Important: Please read the Qt Code of Conduct -

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.
    @import sys

    from PyQt5.QtCore import Qt, QObject
    from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton
    from PyQt5.QtPrintSupport import QPrinter, QPageSetupDialog

    class PrintConverser(QObject):

    def doPageSetup(self):
    print("Opening page setup dialog")
    printer = QPrinter()
    assert printer.isValid()
    dialog = QPageSetupDialog(printer)

    # Choose one: all are broken: # window modal, but no dialog appears  # modeless, but no dialog appears
    dialog.exec_()  # app modal, dialog box appears but is empty

    def acceptSlot(self):
    print('accepted or canceled')

    def main():
    app = QApplication(sys.argv)
    mainWindow = QMainWindow()
    mainWindow.setGeometry(100, 100, 500, 40)

    printConverser = PrintConverser()

    button = QPushButton("Setup page")


    if name=="main":

  • This was also reported by someone else and fixed here:

    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.

Log in to reply