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. How to open ios gallery?

How to open ios gallery?

Scheduled Pinned Locked Moved Mobile and Embedded
ios
7 Posts 3 Posters 4.2k Views 2 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.
  • F Offline
    F Offline
    farshad bayat
    wrote on last edited by A Former User
    #1

    Re: IOS Photo Gallery View in Qt
    i'm trying to open ios gallery with Qt , i found many article and answers . i test them but they didn't work in ios(10) here are two links that are not working for me**~~~~

    Link 1 : Open ios gallery with FileDialog{}

    Link 2 : Mixing Objective-c with Qt to access gallery in ios
    first link explained how to open gallery with FileDialog ,according to link and it's description :

    in iOS just create a FileDialog inside the QML file and set folder: shortcuts.pictures. It will call the iOS gallery.
    . below is my code but it doesn't work !!

    import QtQuick 2.7
    import QtQuick.Controls 2.0
    import QtQuick.Dialogs 1.0
    
    
    ApplicationWindow {
        visible: true
        width: 640
        height: 480
    
        FileDialog {
            id: fileDialog
            visible: true
            folder: shortcuts.pictures
    
        }
    
    }
    

    second link , I couldn't compile it and i got this error

    ld: '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a(arclite.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    ** BUILD FAILED **
    
    
    The following build commands failed:
        Ld Debug-iphonesimulator/QuickIOSExample.app/QuickIOSExample normal x86_64
    (1 failure)
    make: *** [xcodebuild-debug-simulator] Error 65
    14:05:48: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project quickiosexample (kit: iphonesimulator-clang Qt 5.8.0 for iOS)
    When executing step "Make"
    

    thank you for your answers :)

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

      Really strange, I am using the FileDialog with Qt 5.7.1 on iOs 10 and it works. Are you trying that on the simulator or on an actual device? You could also try quicknative (https://github.com/paulondc/quicknative), but for iOs it's basically just using the FileDialog.

      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

      F 1 Reply Last reply
      1
      • S Schluchti

        Really strange, I am using the FileDialog with Qt 5.7.1 on iOs 10 and it works. Are you trying that on the simulator or on an actual device? You could also try quicknative (https://github.com/paulondc/quicknative), but for iOs it's basically just using the FileDialog.

        F Offline
        F Offline
        farshad bayat
        wrote on last edited by
        #3

        @Schluchti said in how to open ios gallery in Qt:

        Really strange

        thank you for your fast answer
        i install qmp and then install quicknative successfully
        but when i run project app comes up and this message shown and display in actual device and also in simulator is black

        QQmlApplicationEngine failed to load component
        qrc:/main.qml:4 module "QuickNative" is not installed
        

        here is my code's screen shot
        screen shot of run

        S 1 Reply Last reply
        0
        • F farshad bayat

          @Schluchti said in how to open ios gallery in Qt:

          Really strange

          thank you for your fast answer
          i install qmp and then install quicknative successfully
          but when i run project app comes up and this message shown and display in actual device and also in simulator is black

          QQmlApplicationEngine failed to load component
          qrc:/main.qml:4 module "QuickNative" is not installed
          

          here is my code's screen shot
          screen shot of run

          S Offline
          S Offline
          Schluchti
          wrote on last edited by
          #4

          @farshad-bayat It looks like you missed to set the path where the engine searches for installed modules. You probably need to add something like this to your main.cpp

          engine.addImportPath(QStringLiteral("qrc:/"));
          

          see: http://doc.qt.io/qt-5/qqmlengine.html#addImportPath

          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

          F 1 Reply Last reply
          1
          • GTDevG Offline
            GTDevG Offline
            GTDev
            wrote on last edited by
            #5

            Hi!
            Another possible solution is using V-Play Engine to trigger the native photo gallery with NativeUtils::displayImagePicker.

            For example:

            import VPlayApps 1.0
            import QtQuick 2.5
            
            App {
            
              // show image picker with click on button
              AppButton {
                text: "Open Image Picker"
                anchors.centerIn: parent
                onClicked: nativeUtils.displayImagePicker("Choose Image")
              }
            
              // handle imagePickerFinished signal
              Connections {
                target: nativeUtils
                onImagePickerFinished: {
                  console.debug("Dialog Accepted: "+accepted)
                  console.debug("Image Path: "+path)
                }
              }
            
            }
            

            Best,
            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
            • S Schluchti

              @farshad-bayat It looks like you missed to set the path where the engine searches for installed modules. You probably need to add something like this to your main.cpp

              engine.addImportPath(QStringLiteral("qrc:/"));
              

              see: http://doc.qt.io/qt-5/qqmlengine.html#addImportPath

              F Offline
              F Offline
              farshad bayat
              wrote on last edited by farshad bayat
              #6

              @Schluchti
              thanks for your attention.
              i set the path but not work for me. my qt version is 5.8.0, maybe this version is not supported ;(. the output of run is:
              warning message is

              QIOSFileDialog: Could not resolve Qt plugin that gives access to photos on iOS
              
              2017-03-20 13:11:22.497591 dd[973:278978] [DYMTLInitPlatform] platform initialization successful
              QML debugging is enabled. Only use this in a safe environment.
              JIT is disabled for QML. Property bindings and animations will be very slow. Visit https://wiki.qt.io/V4 to learn about possible solutions for your platform.
              QIOSFileDialog: Could not resolve Qt plugin that gives access to photos on iOS
              QMetaObject::indexOfSignal: signal visibleChanged(bool) from QQuickWindow redefined in QQuickWindowQmlImpl
              

              and screenshot:
              QIOSFileDialog: Could not resolve Qt plugin that gives access to photos on iOS

              S 1 Reply Last reply
              0
              • F farshad bayat

                @Schluchti
                thanks for your attention.
                i set the path but not work for me. my qt version is 5.8.0, maybe this version is not supported ;(. the output of run is:
                warning message is

                QIOSFileDialog: Could not resolve Qt plugin that gives access to photos on iOS
                
                2017-03-20 13:11:22.497591 dd[973:278978] [DYMTLInitPlatform] platform initialization successful
                QML debugging is enabled. Only use this in a safe environment.
                JIT is disabled for QML. Property bindings and animations will be very slow. Visit https://wiki.qt.io/V4 to learn about possible solutions for your platform.
                QIOSFileDialog: Could not resolve Qt plugin that gives access to photos on iOS
                QMetaObject::indexOfSignal: signal visibleChanged(bool) from QQuickWindow redefined in QQuickWindowQmlImpl
                

                and screenshot:
                QIOSFileDialog: Could not resolve Qt plugin that gives access to photos on iOS

                S Offline
                S Offline
                Schluchti
                wrote on last edited by Schluchti
                #7

                @farshad-bayat I think you have the same Problem as described here https://bugreports.qt.io/browse/QTBUG-59097

                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

                • Login

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