Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.2.0
-
None
-
-
402a526b2 (dev), 9a7a12692 (6.5), 86c9c914c (6.4)
Description
When using widgets (which is also the fallback for the filedialog in labs), you can set folder to be QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).last() (https://doc.qt.io/qt-6/qfiledialog.html#setDirectory). This will inform the iOS QPA plugin to show an image picker dialog instead of the document picker.
With the new FileDialog in Qt Quick, this doesn't work anymore:
FileDialog { id: fileDialog //property string pictures: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[StandardPaths.standardLocations(StandardPaths.PicturesLocation).length - 1] property string pictures: "assets-library://" currentFolder: pictures onAccepted: { print("path:", currentFolder) print("pics location last:", pictures) print("Image selected: " + fileDialog.fileUrl) } }
(Note that StandardPaths.standardLocations(StandardPaths.PicturesLocation)[StandardPaths.standardLocations(StandardPaths.PicturesLocation).length - 1] translates to the URL "assets-library://" on iOS. But because of another bug in StandardPaths, you currently need to use "assets-library://" directly.
Attachments
Issue Links
- is required for
-
QTBUG-106647 Cannot read files from assets-library://
- Closed
- Is tested by
-
QTBUG-120676 FileDialog does not open when pre-set to open Pictures Library in iOS
- Open
- resulted in
-
QTBUG-111449 QML QtCore StandardPaths returns paths rather than URLs on Windows
- Closed