Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.6, 6.7
-
None
Description
In the course of retesting QTBUG-107844 , I failed to get a minimal app even launching the iOS Simulator (running 17.2), not speaking of accessing pictures yet.
I tried Qt 6.6.1 and 6.7.0b1. Used QtC 12.0.1 and Xcode 15.1
app code is:
import QtCore import QtQuick import QtQuick.Controls import QtQuick.Dialogs ApplicationWindow { width: 640 height: 480 visible: true header: ToolBar { Button { text: qsTr("Choose Image...") onClicked: fileDialog.open() } } Image { id: image anchors.fill: parent fillMode: Image.PreserveAspectFit } FileDialog { id: fileDialog property string pictures: "assets-library://" currentFolder: pictures }
plist in cmake:
if(IOS) set_target_properties(appfiledialog PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist") endif()
content of the Info.plist:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict> <key>NSPhotoLibraryLimitedAccessAPISupport</key> <true/> <key>LSApplicationCategoryType</key> <string></string> <key>NSPhotoLibraryAddUsageDescription</key> <string>access message 1</string> <key>NSPhotoLibraryUsageDescription</key> <string>access message 2</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleIdentifier</key> <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string> <key>CFBundleExecutable</key> <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string> <key>CFBundleVersion</key> <string>0.0.1</string> <key>CFBundleShortVersionString</key> <string>0.0.1</string> <key>CFBundleGetInfoString</key> <string></string> <key>NSHumanReadableCopyright</key> <string></string> <key>CFBundleIconFile</key> <string>${MACOSX_BUNDLE_ICON_FILE}</string> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>LSRequiresIPhoneOS</key> <true/> <key>UILaunchStoryboardName</key> <string>LaunchScreen</string> <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array></dict></plist>
so "NSPhotoLibraryUsageDescription" is listed. BTW, it is VERY hard to find this point in the docs!
With the above content, the app compiles, deploys, and launches OK, but when "Choose image" is clicked, the message :
QIOSFileDialog: Could not resolve Qt plugin that gives access to photos on iOS
is shown on the console and nothing happens.
If "currentFolder" is left undefined (commented out), a standard file picker shows up and the message does not show up.
Attachments
Issue Links
- is duplicated by
-
QTBUG-127919 QIOSFileDialog: Could not resolve Qt plugin that gives access to photos on iOS
- Closed
- relates to
-
QTBUG-64074 Qt NSPhotoLibrarySupport should use Photos Framework replacing deprecated AssetsLibrary Framework
- Reported
- split to
-
QTBUG-130850 [iOS] Document how to get a CMake project to use the native photo picker
- Closed
-
QTBUG-130863 [Doc][iOS] Native image picker docs should focus on Qt.Quick.Dialogs.FileDialog rather than Qt.labs.platform.FileDialog
- Reported
- tests
-
QTBUG-107844 FileDialog: cannot open image picker dialog on iOS
- Closed