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

FileDialog regression in 6.3: filename entered by user no longer accessible

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • None
    • 6.3.0 Beta1, 6.3.0 Beta2, 6.3.0 Beta3
    • Quick: Dialogs
    • None
    • macOS, Windows

    Description

      The attached example does not work any longer in 6.3. It is not possible to retrieve the entered file name (fileMode == FileDialog.SaveFile). Works as expected in 6.2.2.

      import QtQuick
      import QtQuick.Dialogs
      import QtQuick.Controls
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          Button {
              text: "Save as..."
              onClicked: fd.open()
          }
      
          FileDialog {
              id: fd
              fileMode: FileDialog.SaveFile
      
              onAccepted: {
                  console.log("File selected", selectedFile)
              }
          }
      }
      

      Maybe this is caused by a318e6f354c8c4c504c4da42737268bf9f1bae9c?

      -void QQuickFileDialog::accept()
      -{
      -    if (QPlatformFileDialogHelper *fileDialog = qobject_cast<QPlatformFileDialogHelper *>(handle())) {
      -        // Take the currently selected files and make them the final set of files.
      -        setSelectedFiles(fileDialog->selectedFiles());
      -    }
      -    QQuickAbstractDialog::accept();
      -}
      -
      

      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
            njeisecke Nils Jeisecke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes