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

Picture picker does not work on iOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9.0
    • Quick: Dialogs
    • None
    • iPhone
    • iOS/tvOS/watchOS
    • iOS/tvOS/watchOS

    Description

      When picking a file using the FileDialog on the Pictures folder, no access is granted to the selected file. Works on MacOS and Windows.

      import QtQuick
      import QtQuick.Controls
      import QtQuick.Dialogs
      
      Rectangle {
          width: 800
          height: 480
      
          FileDialog {
              id: fileDialog
              currentFolder: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0]
              nameFilters: ["Image files (*.jpg *.jpeg *.png *.heic)"]
              fileMode: FileDialog.OpenFile
      
              onAccepted: {
                  image.source = fileDialog.selectedFile
              }
          }
      
          Button {
              text: "Open picture picker"
              onClicked: {
                  fileDialog.open()
              }
          }
      
          Image {
              id: image
              anchors.centerIn: parent
          }
      }
      

      Errors in XCode output are:

      revealDocumentAtURL encountered an error: Error Domain=NSCocoaErrorDomain Code=260 "The file “Pictures” couldn’t be opened because there is no such file." UserInfo={NSURL=file:///var/mobile/Containers/Data/Application/B1A38D6A-C39D-4D6C-876B-4842A3EA4E38/Documents/Pictures, NSFilePath=/var/mobile/Containers/Data/Application/B1A38D6A-C39D-4D6C-876B-4842A3EA4E38/Documents/Pictures, NSUnderlyingError=0x1135a53b0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
      
      qrc:/declarative-camera.qml:11:5: QML FileDialog: Cannot set /private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/IMG_0001.HEIC as a selected file because it doesn't exist
      

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            justin.steventon Justin Steventon
            Qt for iOS Qt for iOS
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes