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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.2.0
    • Fix Version/s: 5.3.0
    • Labels:
      None
    • Environment:
      Windows 7, Qt 5.2.0
    • Commits:
      73a98ccc4677056416f5de8797c91097e1000a0c (stable, 15.1.2014, 5.2.2/5.3)

      Description

      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.

        Attachments

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

          Activity

            People

            Assignee:
            kleint Friedemann Kleint
            Reporter:
            aclight Adam Light
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes