diff options
author | Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> | 2015-01-28 10:07:41 +0100 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> | 2015-02-15 11:11:59 +0000 |
commit | bcda3980016e98e0078fedb83e77047e296c8713 (patch) | |
tree | c34907cc0c2b9e83405a889192920028bd9e3ade /src/plugins/platforms/ios/qiostheme.mm | |
parent | 66a61c7d2cfc55eca56c410489f84ab3a2a8ac16 (diff) |
iOS: add native file dialog for selecing photos/assets
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ø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/ios/qiostheme.mm')
-rw-r--r-- | src/plugins/platforms/ios/qiostheme.mm | 22 |
1 files changed, 22 insertions, 0 deletions
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 <UIKit/UIInterface.h> #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) { |