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

Qt Labs Platform FileDialog's currentFile property will not update the QFileDialog when written to externally

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.4.0
    • None
    • All

    Description

      When setting the selectedFile property for the FileDialog in QtQuick.Dialogs.

       

      import QtQuick
      import QtQuick.Window
      import QtQuick.Controls
      import QtQuick.Dialogs
      
      Window {
          width: 640
          height: 480
          visible: true
      
          Button {
              anchors.centerIn: parent
              text: "Open QtQuickDialogs FileDialog"
              onClicked: dialog.open()
          }
      
          FileDialog {
              id: dialog
              selectedFile: "hello.txt" // Works
              fileMode: FileDialog.SaveFile
          }
      }
      
      

      The initial selected file will be correct.

      But if the same is done with the QtLabsPlatform FileDialog, it will not be set correctly in the QFileDialog fallback.

      import QtQuick
      import QtQuick.Window
      import QtQuick.Controls
      import Qt.labs.platform
      
      Window {
          width: 640
          height: 480
          visible: true
      
          Button {
              anchors.centerIn: parent
              text: "Open QtQuickDialogs FileDialog"
              onClicked: dialog.open()
          }
      
          FileDialog {
              id: dialog
              currentFile: "hello.txt" // Not used by the fallback QFileDialog
              fileMode: FileDialog.SaveFile
          }
      }
      
      

       

       

       

      Attachments

        Activity

          People

            hurlevent Oliver Eftevaag
            hurlevent Oliver Eftevaag
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: