iOS: Add helper for getting the iOS platform integration instance
Change-Id: I550d345ab0f8bcba1225c425464e198d43d9fda8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>bb10
parent
5f9e1b079c
commit
f1724e4d8a
|
|
@ -46,7 +46,6 @@
|
|||
#include "qiosviewcontroller.h"
|
||||
#include "qioswindow.h"
|
||||
|
||||
#include <QtGui/private/qguiapplication_p.h>
|
||||
#include <qpa/qplatformintegration.h>
|
||||
|
||||
#include <QtCore/QtCore>
|
||||
|
|
@ -96,7 +95,9 @@
|
|||
if (!QGuiApplication::instance())
|
||||
return NO;
|
||||
|
||||
QIOSIntegration *iosIntegration = static_cast<QIOSIntegration *>(QGuiApplicationPrivate::platformIntegration());
|
||||
QIOSIntegration *iosIntegration = QIOSIntegration::instance();
|
||||
Q_ASSERT(iosIntegration);
|
||||
|
||||
QIOSServices *iosServices = static_cast<QIOSServices *>(iosIntegration->services());
|
||||
|
||||
return iosServices->handleUrl(QUrl::fromNSURL(url));
|
||||
|
|
|
|||
|
|
@ -84,6 +84,8 @@ public:
|
|||
QTouchDevice *touchDevice();
|
||||
QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE;
|
||||
|
||||
static QIOSIntegration *instance();
|
||||
|
||||
private:
|
||||
QPlatformFontDatabase *m_fontDatabase;
|
||||
QPlatformClipboard *m_clipboard;
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@
|
|||
#include "qiostheme.h"
|
||||
#include "qiosservices.h"
|
||||
|
||||
#include <QtGui/private/qguiapplication_p.h>
|
||||
|
||||
#include <qpa/qplatformoffscreensurface.h>
|
||||
|
||||
#include <QtPlatformSupport/private/qcoretextfontdatabase_p.h>
|
||||
|
|
@ -62,6 +64,11 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QIOSIntegration *QIOSIntegration::instance()
|
||||
{
|
||||
return static_cast<QIOSIntegration *>(QGuiApplicationPrivate::platformIntegration());
|
||||
}
|
||||
|
||||
QIOSIntegration::QIOSIntegration()
|
||||
: m_fontDatabase(new QCoreTextFontDatabase)
|
||||
, m_clipboard(new QIOSClipboard)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@
|
|||
#include "qioswindow.h"
|
||||
|
||||
#include <QtGui/private/qwindow_p.h>
|
||||
#include <QtGui/private/qguiapplication_p.h>
|
||||
|
||||
// Include category as an alternative to using -ObjC (Apple QA1490)
|
||||
#include "quiview_textinput.mm"
|
||||
|
|
@ -235,7 +234,7 @@
|
|||
- (void) sendTouchEventWithTimestamp:(ulong)timeStamp
|
||||
{
|
||||
// Send touch event synchronously
|
||||
QIOSIntegration *iosIntegration = static_cast<QIOSIntegration *>(QGuiApplicationPrivate::platformIntegration());
|
||||
QIOSIntegration *iosIntegration = QIOSIntegration::instance();
|
||||
QWindowSystemInterface::handleTouchEvent(m_qioswindow->window(), timeStamp, iosIntegration->touchDevice(), m_activeTouches.values());
|
||||
QWindowSystemInterface::flushWindowSystemEvents();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@
|
|||
#include "qiosplatformaccessibility.h"
|
||||
#include "quiaccessibilityelement.h"
|
||||
|
||||
#include <QtGui/private/qguiapplication_p.h>
|
||||
|
||||
@implementation QUIView (Accessibility)
|
||||
|
||||
- (void)createAccessibleElement:(QAccessibleInterface *)iface
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "qiosinputcontext.h"
|
||||
|
||||
#include <QtGui/qtextformat.h>
|
||||
#include <QtGui/private/qguiapplication_p.h>
|
||||
|
||||
class StaticVariables
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue