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

Windows native file dialog crashes when calling accept() from directoryEntered()

XMLWordPrintable

    • Windows

      NOTE: I could reproduce this on only Windows 11.
      Attached a simplified PyQt script.
      We have the slot `dirEntered` which is executed when the dialog fires `directoryEntered` signal. In the script, we are calling `done(QFileDialog.Accepted)` if user selects `Desktop` directory (can be any directory, i used Desktop for an example) and this seems to cause the crash.
      This doesn't cause a crash in case of non-native dialogs. The only way I found which can fix this is delaying the `done` call using a `QTimer`.
      From my understanding, the underlying windows native dialog is getting destructed while we are still processing the directory changed event.

        1. filedialogcrash.py
          1 kB
        2. qtbug140170_pyside.py
          2 kB
        3. qtbug140170_stack.txt
          31 kB
        4. qtbug140171.zip
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kleint Friedemann Kleint
            sohamkanji Soham Kanji
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes