Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.2.1, 6.3.0 Beta2, 6.4
-
None
-
-
fbb7284946 (qt/qtdeclarative/6.3) 3849e0de26 (qt/qtdeclarative/dev) fbb7284946 (qt/tqtc-qtdeclarative/6.3) 3849e0de26 (qt/tqtc-qtdeclarative/dev)
Description
When using FileDialog with fileMode = FileDialog.SaveFile the documentation states that it should be possible to select any file, even files that do not exist. This makes it possible to return a URL to a file that doesn't exist so it can be created. In 6.2 this example does return a URL correctly, but in 6.3 and 6.4 (dev) it currently returns an empty string.
This is an important regression because it breaks common "saveAs" and "export" use cases when using the native file dialogs on at least Windows and macOS (those are the places I've reproduced the bug at least).
import QtQuick import QtQuick.Controls import QtQuick.Dialogs ApplicationWindow { id: appWindow width: 1280 height: 720 visible: true title: qsTr("Save Dialogs") Column { Label { text: "Open the dialog, and type the name of file that doesn't exist" } Button { text: "Export" onClicked: { exportDialog.open() } } Label { id: outputLabel } } FileDialog { id: exportDialog acceptLabel: "Export" title: "Export a QML Scene" fileMode: FileDialog.SaveFile // <-- Shouldn't this mean I can create a new file //defaultSuffix: ".qml" // <-- Uncomment to see just ".qml" as the output nameFilters: [ "QML (*.qml)"] onAccepted: { console.log("selectedFile: " + selectedFile) outputLabel.text = selectedFile // Shouldn't I get the URL of the file to create? } } }
Attachments
Issue Links
- is duplicated by
-
QTBUG-101151 FileDialog save mode unusable
- Closed