Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114231

CLONE - QFileDialog::getOpenFileName don't pop up correctly when QTimer is started with timeout = 0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.4.3
    • None
    • Native Ubuntu 20.04
    • Linux/X11

    Description

      I discovered that issue with PySide 6.4.3, but probably it is not a PySide issue.

      The following simple program doesn't show a proper file dialog on Ubuntu 20.04. In the taskbar I see an empty window, the main window is blocked because of the modal dialog, but I can't even see a frame for the dialog.

      from PySide6 import QtGui, QtCore, QtWidgets
      
      if __name__ == "__main__":
          app = QtWidgets.QApplication()
          timer = QtCore.QTimer()
          # either use timer.setInterval(100) to fix the issue ...
          timer.setInterval(0)
          def waitForFrame():
              pass
          timer.timeout.connect(waitForFrame)
          timer.start()    pb = QtWidgets.QPushButton()
          pb.setText("Hello")
          def doit():
              with QtCore.QSignalBlocker(timer):
                  # .. or uncomment the lines below to get a correct file dialog
                  #timer.stop()
                  QtWidgets.QFileDialog.getOpenFileName(caption="Select .h5 file", filter="*.h5")
                  #timer.start()
          pb.clicked.connect(doit)
          pb.show()
          app.exec()
       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Unassigned Unassigned
              bdev a dev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes