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

FileDialog.currentFolder shows inconsitent behavior on macOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.1
    • Quick: Dialogs
    • None
    • macOS 15.3
      Qt 6.8.1
    • macOS

    Description

      Take the following minimum Example:

      import QtCore
      import QtQuick
      import QtQuick.Controls
      import QtQuick.Dialogs
      
      ApplicationWindow {
          visible: true
          Button {
              text: "Open Dialog"
              onClicked: {
                  console.log("onClicked: ", saveFileDialog.currentFolder);
                  saveFileDialog.open();
              }
          }
          
          
          FileDialog {
              id: saveFileDialog
              currentFolder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
              fileMode: FileDialog.SaveFile
              
              onAccepted: console.log("onAccepted: ", currentFolder)
          }
      }

      When the dialog is opened a second time, the currentFolder loses its "file://" prefix.

       

      Steps to reproduce:
      1. Click the Button to open the Dialog

      2. Choose a filename

      3. Click "Save"

      4. Click the Button to open the Dialog again

      5. Click save

      onClicked:  file:///Users/app2/Documents
      onAccepted:  file:///Users/app2/Documents
      onClicked:  file:///Users/app2/Documents
      onAccepted:  /Users/app2/Documents

      Tested with macOS 15.3 and Qt 6.8.2.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            jgreilich Julian Greilich
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes