Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.3, 6.4
-
None
-
-
b65a5a9d06 (qt/qtdeclarative/dev) b65a5a9d06 (qt/tqtc-qtdeclarative/dev) 66c350039e (qt/qtdeclarative/6.4) a53b3dc883 (qt/qtdeclarative/6.3) a53b3dc883 (qt/tqtc-qtdeclarative/6.3) 66c350039e (qt/tqtc-qtdeclarative/6.4)
-
2022wk30FOQtforAndroid, 2022wk32FOQtforAndroid, 2022wk36FOQtforAndroid, 2023wk42FOQtforAndroid
Description
It looks like on current dev (after this patch) it is not possible to choose any file using FileDialog (on Android). I tested the simplest code on my device and on emulator:
import QtQuick import QtQuick.Dialogs import QtQuick.Controls Window { width: 640 height: 480 visible: true FileDialog { id: fileDialog onAccepted: console.log("File set correctly: " + selectedFile.toString()) onRejected: console.log("FILE NOT SET! REJECTED!") } Button { id: b text: "File" onClicked: fileDialog.open() } Text { anchors.top: b.bottom text: fileDialog.selectedFile.toString() == "" ? "No file selected" : fileDialog.selectedFile.toString() } }
selectedFile is not set correctly. Logs look like this:
qrc:/TestFileDialog/main.qml:10:5: QML FileDialog: Cannot set as a selected file because it doesn't exist qrc:/TestFileDialog/main.qml:10:5: QML FileDialog: Cannot set as a selected file because it doesn't exist File set correctly:
In qtdeclarative, in QQuickFileDialog::setSelectedFile:
const QString selectedFilePath = selectedFile.toLocalFile(); // sets empty string for QUrl with android path
Attachments
Issue Links
- blocks
-
QTBUG-96084 qmlvideo and qmlvideofx examples use custom file dialog and not the Android native dialog
- Closed
- relates to
-
QTBUG-115143 Unable to open files under certain conditions on Android.
- Reported
-
QTBUG-98974 Android 11 - Scoped Storage
- Closed
(1 mentioned in)