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
For Gerrit Dashboard: QTBUG-107844 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
460474,1 | QIosFileDialog - properly handle QUrl for assets-library | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: NEW | 0 | 0 |
439670,6 | QQmlStandardPaths: don't convert URLs to local files | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
455271,4 | QIosFileDialog - properly handle QUrl for assets-library | dev | qt/qtbase | Status: MERGED | +2 | 0 |
460472,2 | QIosFileDialog - properly handle QUrl for assets-library | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
460473,2 | QIosFileDialog - properly handle QUrl for assets-library | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |