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

Crash when calling QFileDialog via a context menu

XMLWordPrintable

    • Windows

      When invoking QFileDialog::getExistingDirectory() directly in a QAction::triggered() slot (triggered via QMenu from a QMainWindow), the application crashes. However, deferring the call using QMetaObject::invokeMethod() with Qt::QueuedConnection prevents the crash.

      The issue arises when showing a modal file dialog immediately in response to a context menu action.The crash does not happen when the call is deferred with Qt::QueuedConnection, or if the dialog is shown inside a lambda posted to the event loop.The QMainWindow is still valid, and no object is being deleted.
      epro Steps:
       
      Using attached example it can be easily seen:
       
      Right-click to open a context menu in a QMainWindow.
      Trigger a menu action that says "direct" 
      Close the file dialog.
      Application crashes.

        1. qtbug138803.zip
          9 kB
          Irfan Omair
        2. README.md
          9 kB
          Irfan Omair
        For Gerrit Dashboard: QTBUG-138803
        # Subject Branch Project Status CR V

            morteza.jamshidi Morteza Jamshidi
            irfan.omair@digia.com Irfan Omair
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change