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

Mac: FileDialog default folder shows erratic behaviour across different modality settings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Need More Info
    • Priority: P2: Important
    • Resolution: Incomplete
    • Affects Version/s: 5.5.1, 5.6.2, 5.7.0, 5.9.7, 5.12.3
    • Fix Version/s: None
    • Component/s: Quick: Dialogs
    • Labels:
      None
    • Environment:
      OS X 10.11, macOS 10.12, macOS 10.13
    • Platform/s:
      macOS

      Description

      FileDialog does not save the last used folder location when modality is set to Qt.WindowModal but saves when set to Qt.NonModal

      I've attached sample project:
      Steps to reproduce:
      1. Build the project (I've used it with Kits 5.7.0, 5.6.2 and 5.5.1)
      2. Run the project
      3. Click Open File Dialog
      4. File dialog should appear with default folder (on 5.5.1 it's always executable working dir, on 5.6.2 and 5.7.0 it's default or last saved location, meaning location saved when using dialog with Qt.NonModal modality setting)
      5. Navigate to different folder with files, choose random file and click Open
      6. Click Open File Dialog again
      7. Last known used folder location appears for a brief moment and then it's replaced by default folder from step 4

      Expected results:
      The last used (saved) folder should be displayed in file dialog after its reopening.

      Actual results:
      The default folder is displayed in file dialog after its reopening when using default modality setting – Qt.WindowModal. It works as expected when using Qt.NonModal setting. File dialog is not displayed at all when using Qt.ApplicationModal settings QTBUG-42516

       

      Update for Qt 5.9.7 and 5.12.3

      There is now no apparent change of behaviour between Qt.WindowModal / Qt.NonModal modality modes, but the default location is always reset on app restart

      Steps to reproduce

      1. Build the project
      2. Run the app
      3. Click Open File Dialog
      4. File dialog should appear with default folder which is strangely an executable working dir
      5. Navigate to different folder with files, choose random file and click Open
      6. Quit app
      7. Run the app
      8. Click Open File Dialog

      Expected results:
      The last used folder location will be opened with file dialog

      Actual results:
      The last used folder location is briefly replaced by the location of the application binary in the file dialog

        Attachments

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

          Activity

            People

            • Assignee:
              srutledg Shawn Rutledge
              Reporter:
              pavol.markovic Pavol Markovic
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes