summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qapplication.cpp')
-rw-r--r--src/gui/kernel/qapplication.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index cdd0c1b..12fe797 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -177,6 +177,7 @@ QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, QApplication::T
directPainters = 0;
#endif
+ gestureManager = 0;
gestureWidget = 0;
if (!self)
@@ -3632,7 +3633,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
}
// walk through parents and check for gestures
- if (qt_gestureManager) {
+ if (d->gestureManager) {
switch (e->type()) {
case QEvent::Paint:
case QEvent::MetaCall:
@@ -3664,13 +3665,13 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
break;
default:
if (receiver->isWidgetType()) {
- if (qt_gestureManager->filterEvent(static_cast<QWidget *>(receiver), e))
+ if (d->gestureManager->filterEvent(static_cast<QWidget *>(receiver), e))
return true;
} else {
// a special case for events that go to QGesture objects.
// We pass the object to the gesture manager and it'll figure
// out if it's QGesture or not.
- if (qt_gestureManager->filterEvent(receiver, e))
+ if (d->gestureManager->filterEvent(receiver, e))
return true;
}
}
@@ -5678,6 +5679,14 @@ Q_GUI_EXPORT void qt_translateRawTouchEvent(QWidget *window,
QApplicationPrivate::translateRawTouchEvent(window, deviceType, touchPoints);
}
+QGestureManager* QGestureManager::instance()
+{
+ QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
+ if (!qAppPriv->gestureManager)
+ qAppPriv->gestureManager = new QGestureManager(qApp);
+ return qAppPriv->gestureManager;
+}
+
QT_END_NAMESPACE
#include "moc_qapplication.cpp"