Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-120676

FileDialog does not open when pre-set to open Pictures Library in iOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.6, 6.7
    • Quick: Dialogs
    • None
    • iOS/tvOS/watchOS

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              tpochep Timur Pocheptsov
              vminenko Vladimir Minenko
              Vladimir Minenko Vladimir Minenko
              Volker Hilsheimer Volker Hilsheimer
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes