How to open ios gallery?
-
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 :)
-
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 theFileDialog
. -
@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 blackQQmlApplicationEngine failed to load component qrc:/main.qml:4 module "QuickNative" is not installed
here is my code's screen shot
-
@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:/"));
-
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 -
@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 isQIOSFileDialog: 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:
-
@farshad-bayat I think you have the same Problem as described here https://bugreports.qt.io/browse/QTBUG-59097