Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. IOS Photo Gallery View in Qt
Forum Updated to NodeBB v4.3 + New Features

IOS Photo Gallery View in Qt

Scheduled Pinned Locked Moved Solved Mobile and Embedded
9 Posts 6 Posters 3.7k Views 5 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.
  • Manohar_SLM Offline
    Manohar_SLM Offline
    Manohar_SL
    wrote on last edited by
    #1

    Hi,
    I want to implement Photo Gallery View for IOS devices, quite researched regarding this, found something called UIImagePickerController but i don't have any idea how to use this in Qt. Can anyone plz help me with solution and some sample code to implement.

    Manohar SL
    Embedded Qt & QML Developer

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

      Hi and welcome to devnet,

      IIRC, you can already access the Photo Gallery using QFileDialog.

      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
      • Manohar_SLM Offline
        Manohar_SLM Offline
        Manohar_SL
        wrote on last edited by
        #3

        Thank you for the reply SGaist :)

        I have used QFileDialog it works fine, but problem with that is it open's computer style file browser in which I need to go through the file system, its doesn't give the native UI feel or it doesn't provide Images in grid or list format, for example the android photo gallery in which we can see it in grid style, that is not possible from QFileDialog.

        Manohar SL
        Embedded Qt & QML Developer

        1 Reply Last reply
        1
        • S Offline
          S Offline
          Schluchti
          wrote on last edited by
          #4

          When using FileDialog in QML, set the property

          folder:shortcuts.pictures
          

          Want to read more about Qt?

          https://gympulsr.com/blog/qt/

          Latest Article: https://gympulsr.com/blog/qt/2017/06/14/ios-background-music-qt.html

          1 Reply Last reply
          1
          • Manohar_SLM Offline
            Manohar_SLM Offline
            Manohar_SL
            wrote on last edited by
            #5

            Thanks you @Schluchti,

            That is similar to QStandardPaths::standardLocations(QStandardPaths::PicturesLocation) in Qt both doesn't serve my purpose.

            Manohar SL
            Embedded Qt & QML Developer

            1 Reply Last reply
            1
            • Manohar_SLM Manohar_SL

              Hi,
              I want to implement Photo Gallery View for IOS devices, quite researched regarding this, found something called UIImagePickerController but i don't have any idea how to use this in Qt. Can anyone plz help me with solution and some sample code to implement.

              benlauB Offline
              benlauB Offline
              benlau
              Qt Champions 2016
              wrote on last edited by
              #6

              @Manohar_SL Hi , you may take a look with this sample code:

              quickios/qisystemutils.mm at master · benlau/quickios

              It launch UIImagePickerController and return the selected image via a custom messenger class. The repo also contains an example project that you could try it on phone.

              Manohar_SLM 1 Reply Last reply
              6
              • benlauB benlau

                @Manohar_SL Hi , you may take a look with this sample code:

                quickios/qisystemutils.mm at master · benlau/quickios

                It launch UIImagePickerController and return the selected image via a custom messenger class. The repo also contains an example project that you could try it on phone.

                Manohar_SLM Offline
                Manohar_SLM Offline
                Manohar_SL
                wrote on last edited by
                #7

                Thanks you @benlau
                Its great i just had a look, it works. Its good example to explore on Object -c with Qt.
                @SGaist , I had tried following piece of code with QFileDialog am able to achieve my task in IOS

                const QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
                dialog.setDirectory(picturesLocations.isEmpty() ? QDir::currentPath() : picturesLocations.last());
                
                QStringList mimeTypeFilters;
                const QByteArrayList supportedMimeTypes = acceptMode == QFileDialog::AcceptOpen
                        ? QImageReader::supportedMimeTypes() : QImageWriter::supportedMimeTypes();
                foreach (const QByteArray &mimeTypeName, supportedMimeTypes)
                    mimeTypeFilters.append(mimeTypeName);
                mimeTypeFilters.sort();
                dialog.setMimeTypeFilters(mimeTypeFilters);
                dialog.selectMimeTypeFilter("image/jpeg");
                if (acceptMode == QFileDialog::AcceptSave)
                    dialog.setDefaultSuffix("jpg");
                

                Manohar SL
                Embedded Qt & QML Developer

                1 Reply Last reply
                3
                • GTDevG Offline
                  GTDevG Offline
                  GTDev
                  wrote on last edited by GTDev
                  #8

                  Hi!
                  You can also have at a look at V-Play Engine, which offers to easily access the native iOS or Android photo gallery picker from QML with their NativeUtils component.

                  Cheers,
                  GT

                  Senior Developer at Felgo - https://felgo.com/qt

                  Develop mobile Apps for iOS & Android with Qt
                  Felgo is an official Qt Technology Partner

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

                    Even this thread is older, this is found more often, so here is another missing piece in the puzzle:
                    Since SGaist pointed out that the QFileDialog should work, internally it had to be redirected to the iOS Backend and there is some runtime missing, somehow that needs to be included, so add to the qmake
                    'QTPLUGIN += qiosnsphotolibrarysupport'
                    (On a closer look at the runtime errors, there might be a
                    'QIOSFileDialog: Could not resolve Qt plugin that gives access to photos on iOS'-error
                    on the Application Output.
                    Also take care of the info.plist with NSPhotoLibraryUsageDescription.

                    1 Reply Last reply
                    1

                    • Login

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