Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 5.0.2, PyQt5, Linux, QPageSetupDialog empty or missing
Forum Updated to NodeBB v4.3 + New Features

Qt 5.0.2, PyQt5, Linux, QPageSetupDialog empty or missing

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bootchk
    wrote on 12 Oct 2013, 22:08 last edited by
    #1

    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)

    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
    

    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")
    button.clicked.connect(printConverser.doPageSetup)
    mainWindow.setCentralWidget(button)
    mainWindow.show()

    sys.exit(app.exec_())

    if name=="main":
    main()@

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bootchk
      wrote on 17 Oct 2013, 17:53 last edited by
      #2

      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.

      1 Reply Last reply
      0

      1/2

      12 Oct 2013, 22:08

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved