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

QFileDialog to choose pictures does not displayed at all on iOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.10.1, 5.11.1
    • None
    • * Host: Sierra 10.13.6
      * Qt: 5.11.1 for iOS
      * XCode: 9.4.1
      * Target: iPhone 6, iOS 11.4.1
    • iOS/tvOS/watchOS

    Description

      I want to show the dialog which contains a Pictures. I have read this documentation: http://doc.qt.io/qt-5/qstandardpaths.html

      Note: On iOS, if you do pass QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).last() as argument to QFileDialog::setDirectory(), a native image picker dialog will be used for accessing the user's photo album. The filename returned can be loaded using QFile and related APIs. This feature was added in Qt 5.5.

      And I have read a workaround from this bug: https://bugreports.qt.io/browse/QTBUG-59097 :

      Did you also assign your Info.plist to QMAKE_INFO_PLIST, and after that ran qmake to regenerate the Xcode project? If you did, and it still doesn't work, could you put your pro file on gist?
      As a work-around, try to add QTPLUGIN += qiosnsphotolibrarysupport explicit to your pro file.

      So, I have created a simple QWidgets project where I have added following:

      1. Info.plist with the "NSPhotoLibraryUsageDescription" key property.
      2. QTPLUGIN += qiosnsphotolibrarysupport

      When I try to run the application, it displayed a black screen on:

      • iPhone 6 (iOS 11.4.1)
      • Simulator iPhones (iOS 11.14) ..., 5, 5s, ..., 6, 6s, 6s+, ... 7, 8, ...

      Please see attached example which reproduces an issue.

      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
            kuzulis Denis Shienkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes