From bcda3980016e98e0078fedb83e77047e296c8713 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 28 Jan 2015 10:07:41 +0100 Subject: iOS: add native file dialog for selecing photos/assets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will add a file dialog backend on iOS. The implementation will check if a dialogs initial directory points to the system picture location, and if so, present a UIImagePickerController. Otherwise it will return false upon show, which causes QFileDialog to use the widget based version as fallback. Change-Id: I276b630911652b6d28f60763decc7ec38f00c817 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiostheme.mm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/plugins/platforms/ios/qiostheme.mm') diff --git a/src/plugins/platforms/ios/qiostheme.mm b/src/plugins/platforms/ios/qiostheme.mm index 6842cb3faa..29cd897b71 100644 --- a/src/plugins/platforms/ios/qiostheme.mm +++ b/src/plugins/platforms/ios/qiostheme.mm @@ -46,6 +46,7 @@ #include #include "qiosmenu.h" +#include "qiosfiledialog.h" QT_BEGIN_NAMESPACE @@ -80,6 +81,27 @@ QPlatformMenu* QIOSTheme::createPlatformMenu() const return new QIOSMenu(); } +bool QIOSTheme::usePlatformNativeDialog(QPlatformTheme::DialogType type) const +{ + switch (type) { + case FileDialog: + return true; + default: + return false; + } +} + +QPlatformDialogHelper *QIOSTheme::createPlatformDialogHelper(QPlatformTheme::DialogType type) const +{ + switch (type) { + case FileDialog: + return new QIOSFileDialog(); + break; + default: + return 0; + } +} + QVariant QIOSTheme::themeHint(ThemeHint hint) const { switch (hint) { -- cgit v1.2.3