Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. How should qt for ios open a photo album or select an image file for processing?
Forum Updated to NodeBB v4.3 + New Features

How should qt for ios open a photo album or select an image file for processing?

Scheduled Pinned Locked Moved Unsolved Qt 6
qt for ios
7 Posts 4 Posters 665 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kkgg
    wrote on last edited by
    #1

    How should qt for ios open a photo album or select an image file for processing?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The iOS platform notes give a hint for that.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • P Offline
        P Offline
        p_zirker
        wrote on last edited by
        #3

        The platform notes are clearly not enough as for iOS >= 17 and in 2024.
        The provided native image picker that you got with a QFileDialog pointing to QStandardPath::standardLocations(QStandardPath::PicturesLocation).last()
        (which is btw. assets-library://)
        is returning a list with a single entry on the selected image like
        assets-library://asset/asset.JPG?id=ED7AC....4f2ED&ext=JPG
        (needed to have the QTs iOS Plugin linked by having 'QTPLUGIN += qiosnsphotolibrarysupport' passed to qmake to get it working for me)

        Now since I have at least the native picker and some hint on the selected file, every attempt to list the content of 'assets-library://' or read any reformatted version of the provided file path (altering the url format) is either returning an empty folder or crashes the QFileInfo if accessing it in some ways without further information.

        Having some hints on the deprecation of the assets-library https://developer.apple.com/documentation/assetslibrary while still getting this path returned, i believe the QT plugin might be deprecated too? (using 5.15.16)
        I think the plugins code needs to use PhotoKit backend https://developer.apple.com/documentation/photokit/selecting_photos_and_videos_in_ios

        SGaistS 1 Reply Last reply
        0
        • P p_zirker

          The platform notes are clearly not enough as for iOS >= 17 and in 2024.
          The provided native image picker that you got with a QFileDialog pointing to QStandardPath::standardLocations(QStandardPath::PicturesLocation).last()
          (which is btw. assets-library://)
          is returning a list with a single entry on the selected image like
          assets-library://asset/asset.JPG?id=ED7AC....4f2ED&ext=JPG
          (needed to have the QTs iOS Plugin linked by having 'QTPLUGIN += qiosnsphotolibrarysupport' passed to qmake to get it working for me)

          Now since I have at least the native picker and some hint on the selected file, every attempt to list the content of 'assets-library://' or read any reformatted version of the provided file path (altering the url format) is either returning an empty folder or crashes the QFileInfo if accessing it in some ways without further information.

          Having some hints on the deprecation of the assets-library https://developer.apple.com/documentation/assetslibrary while still getting this path returned, i believe the QT plugin might be deprecated too? (using 5.15.16)
          I think the plugins code needs to use PhotoKit backend https://developer.apple.com/documentation/photokit/selecting_photos_and_videos_in_ios

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @p_zirker hi,

          Did you set the NSPhotoLibraryUsageDescription entry in your .pro file ? It should trigger the plugin addition.

          That said, you should bring your deprecation analysis to the bug report system. This will allow for the adequate people to be pinged about it.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • P Offline
            P Offline
            p_zirker
            wrote on last edited by
            #5

            The NSPhotoLibraryUsageDescription entry of info.plist is in the platform notes, so yes, this is done. Missing it, the Native Image Picker is not appearing. Made a Ticket to the Bug report. Designwise it should be considered to get away from a self edited inof.plist and have all entries provided through cmake/qmake. In that case, the plugins can add such entries by themself with no further remarks. Thanks for your Work @SGaist, served me a lot over the years, but iOS is playing in its own league of pita!

            J 1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by SGaist
              #6

              You could write a feature request for that. CMake has a limited support for handling that file but AFAIK, nothing as complete as you would need.
              Thanks for your kind words.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • P p_zirker

                The NSPhotoLibraryUsageDescription entry of info.plist is in the platform notes, so yes, this is done. Missing it, the Native Image Picker is not appearing. Made a Ticket to the Bug report. Designwise it should be considered to get away from a self edited inof.plist and have all entries provided through cmake/qmake. In that case, the plugins can add such entries by themself with no further remarks. Thanks for your Work @SGaist, served me a lot over the years, but iOS is playing in its own league of pita!

                J Offline
                J Offline
                jhayar
                wrote on last edited by
                #7

                @p_zirker did you find any solution ?

                i have this issue also thanks

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved