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

QFileDialog::getSaveFileName loses focus on second call

    XMLWordPrintable

Details

    Description

      The user wants to get the saved file name with QFileDialog::getSaveFileName. The static method works as expected: the file dialog is opened and the file can be saved and the saved file's name is returned. The user can see, the dialog gets the focus on its very first call. However on the QFileDialog::getSaveFileName second call the dialog appears without focus set.

      The problem is in the focus lost on the second call to QFileDialog::getSaveFileName.

      The same problem was seen by me in Qt Creator 3.5.1 (So it is not only one user's application).
      Open Tools->Options->Debugger->Add Qt sources. On the first time the file dialog appears with the focus set. However if Add Qt sources button pressed again the file dialog appears without focus set.

      Another thing I have noticed: with the Qt build from source (Qt 5.5.1) with the -debug flag set the problem does not exist.

      Environment used:
      3.19.0-33-generic #38~14.04.1-Ubuntu SMP Fri Nov 6 18:17:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
      Unity desktop

      The developer can reproduce this problem with both the application attached and Qt Creator 3.5.1

      Steps to reproduce bug with the application attached:

      • Unpack the application
      • Open the application in Qt Creator
      • Run it from Qt Creator
      • Press the button: first time everything workes fine
      • Close the dialog
      • Press the button again: the dialog appears on the screen without focus set

      Steps to reproduce with Qt Creator 3.5.1:

      • Open Qt Creator
      • Go to Tools->Options->Debugger
      • Press Add Qt sources button: first time everything works as expected (the dialog has a focus set)
      • Close the file dialog
      • Press Add Qt sources button again: the dialog appears on the screen without focus set

      Attachments

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

        Activity

          People

            mmutz Marc Mutz
            dmnikola Dmitry Nikolaev
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes