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

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

      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
          }
      }
      
      

       

       

       

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

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

              Created:
              Updated:

                There are no open Gerrit changes