summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-12-12 17:24:33 +0200
committerQt by Nokia <qt-info@nokia.com>2011-12-12 17:27:19 +0100
commit91b48208f57b10f1b0378d1888fb96af73bc9fa3 (patch)
treea64535b90c91bc1b94caf3d0b0896f213f75b226 /src/gui
parent0319f13f1a9bdd5570977952f7b206a910bbb7a4 (diff)
Add touchEvent() virtual to QWindow.
Unlike keyPressEvent(), mousePressEvent(), etc. the touch events had no equivalent so one had to fall back to reimplementing event() or using an event filter. This is now corrected by introducing touchEvent(). Touch events are finally becoming a first-class citizen in Qt 5. Change-Id: Ia2044030154fd5b1b5384f08a3cb1749b798435f Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwindow.cpp9
-rw-r--r--src/gui/kernel/qwindow.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 55329f56bd..d4f5e1dcf2 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -813,6 +813,12 @@ bool QWindow::event(QEvent *event)
mouseDoubleClickEvent(static_cast<QMouseEvent*>(event));
break;
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ case QEvent::TouchEnd:
+ touchEvent(static_cast<QTouchEvent *>(event));
+ break;
+
case QEvent::Move:
moveEvent(static_cast<QMoveEvent*>(event));
break;
@@ -907,6 +913,9 @@ void QWindow::wheelEvent(QWheelEvent *)
}
#endif //QT_NO_WHEELEVENT
+void QWindow::touchEvent(QTouchEvent *)
+{
+}
/*!
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h
index 11ff6b101d..2a50248c8f 100644
--- a/src/gui/kernel/qwindow.h
+++ b/src/gui/kernel/qwindow.h
@@ -72,6 +72,7 @@ class QMouseEvent;
#ifndef QT_NO_WHEELEVENT
class QWheelEvent;
#endif
+class QTouchEvent;
class QPlatformSurface;
class QPlatformWindow;
@@ -285,6 +286,7 @@ protected:
#ifndef QT_NO_WHEELEVENT
virtual void wheelEvent(QWheelEvent *);
#endif
+ virtual void touchEvent(QTouchEvent *);
QWindow(QWindowPrivate &dd, QWindow *parent);