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

Windows: Regression: Application is deactivated when QFileDialog::getOpenFileName() returns when passing 0 or invisible widget as parent



    • Bug
    • Resolution: Done
    • P2: Important
    • 5.3.0
    • 5.2.0
    • None
    • Windows 7, Qt 5.2.0
    • 73a98ccc4677056416f5de8797c91097e1000a0c (stable, 15.1.2014, 5.2.2/5.3)


      I have a QPushButton on a modal dialog which, when clicked, calls QFileDialog::getOpenFileName(NULL, "Open File");. This presents a native Open File dialog.

      When the native Open File dialog is closed (either by clicking the OK or Cancel button), the Qt application is deactivated.

      You can reproduce this using the attached simplified example. Build and run the application and click the "Show Open File Dialog" button. Click OK or Cancel to close the file dialog. Notice that the application is deactivated. If you have another window in the same position (eg. Qt Creator), that application is activated and covers up the Qt example application.

      If you click the "Show Print Dialog" button in the example, the native Print dialog is opened. Clicking Close on this dialog does not result in the buggy behavior.

      In Qt 4.8.5, I do not see the bug, but it's present in Qt 5.2.0.

      I get this bug using Windows 7 but not using Macintosh 10.6.8.


        1. AppDeactivated.zip
          1 kB
        2. qtbug36039_diag_4.patch
          2 kB
        3. qtbug36039_test.zip
          3 kB
        4. qtbug36039.zip
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            kleint Friedemann Kleint
            aclight Adam Light
            0 Vote for this issue
            2 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes