diff options
Diffstat (limited to 'src/plugins/platforms/ios/qiosintegration.mm')
-rw-r--r-- | src/plugins/platforms/ios/qiosintegration.mm | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm index 61fd1c3d60..d854bf7723 100644 --- a/src/plugins/platforms/ios/qiosintegration.mm +++ b/src/plugins/platforms/ios/qiosintegration.mm @@ -40,15 +40,17 @@ ****************************************************************************/ #include "qiosintegration.h" +#include "qioseventdispatcher.h" +#include "qiosglobal.h" #include "qioswindow.h" #include "qiosbackingstore.h" #include "qiosscreen.h" -#include "qioseventdispatcher.h" #include "qioscontext.h" #include "qiosinputcontext.h" #include "qiostheme.h" #include <QtPlatformSupport/private/qcoretextfontdatabase_p.h> +#include <QDir> #include <QtDebug> @@ -64,13 +66,13 @@ QIOSIntegration::QIOSIntegration() << "Error: You are creating QApplication before calling UIApplicationMain.\n" << "If you are writing a native iOS application, and only want to use Qt for\n" << "parts of the application, a good place to create QApplication is from within\n" - << "'applicationDidFinishLaunching' inside your UIApplication delegate.\n" - << "If you instead create a cross-platform Qt application and do not intend to call\n" - << "UIApplicationMain, you need to link in libqtmain.a, and substitute main with qt_main.\n" - << "This is normally done automatically by qmake.\n"; + << "'applicationDidFinishLaunching' inside your UIApplication delegate.\n"; exit(-1); } + // Set current directory to app bundle folder + QDir::setCurrent(QString::fromUtf8([[[NSBundle mainBundle] bundlePath] UTF8String])); + screenAdded(m_screen); m_touchDevice = new QTouchDevice; @@ -86,6 +88,8 @@ bool QIOSIntegration::hasCapability(Capability cap) const return true; case MultipleWindows: return true; + case ApplicationState: + return true; default: return QPlatformIntegration::hasCapability(cap); } @@ -111,7 +115,10 @@ QPlatformOpenGLContext *QIOSIntegration::createPlatformOpenGLContext(QOpenGLCont QAbstractEventDispatcher *QIOSIntegration::guiThreadEventDispatcher() const { - return new QIOSEventDispatcher(); + if (isQtApplication()) + return new QIOSEventDispatcher; + else + return new QEventDispatcherCoreFoundation; } QPlatformFontDatabase * QIOSIntegration::fontDatabase() const @@ -129,6 +136,8 @@ QVariant QIOSIntegration::styleHint(StyleHint hint) const switch (hint) { case ShowIsFullScreen: return true; + case SetFocusOnTouchRelease: + return true; default: return QPlatformIntegration::styleHint(hint); } |