Add event type for TouchCancel.

Change-Id: Id8b68e5cb19a2a325139e3241647cc36581cf6f8
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Laszlo Agocs 2012-02-09 12:25:46 +02:00 committed by Qt by Nokia
parent 4af285c7d1
commit d5268eabfb
3 changed files with 12 additions and 3 deletions

View File

@ -228,6 +228,7 @@ QT_BEGIN_NAMESPACE
\value TouchBegin Beginning of a sequence of touch-screen and/or track-pad events (QTouchEvent)
\value TouchUpdate Touch-screen event (QTouchEvent)
\value TouchEnd End of touch-event sequence (QTouchEvent)
\value TouchCancel Cancellation of touch-event sequence (QTouchEvent)
\value WinIdChange The window system identifer for this native widget has changed
\value Gesture A gesture was triggered (QGestureEvent)
\value GestureOverride A gesture override was triggered (QGestureEvent)

View File

@ -277,6 +277,8 @@ public:
InputMethodQuery = 209,
OrientationChange = 210, // Screen orientation has changed
TouchCancel = 211,
// 512 reserved for Qt Jambi's MetaCall event
// 513 reserved for Qt Jambi's DeleteOnMainThread event

View File

@ -3305,15 +3305,21 @@ QWindowStateChangeEvent::~QWindowStateChangeEvent()
\section1 Event Handling
All touch events are of type QEvent::TouchBegin, QEvent::TouchUpdate, or QEvent::TouchEnd.
Reimplement QWidget::event() or QAbstractScrollArea::viewportEvent() for widgets and
QGraphicsItem::sceneEvent() for items in a graphics view to receive touch events.
All touch events are of type QEvent::TouchBegin, QEvent::TouchUpdate, QEvent::TouchEnd or
QEvent::TouchCancel. Reimplement QWidget::event() or QAbstractScrollArea::viewportEvent() for
widgets and QGraphicsItem::sceneEvent() for items in a graphics view to receive touch events.
The QEvent::TouchUpdate and QEvent::TouchEnd events are sent to the widget or item that
accepted the QEvent::TouchBegin event. If the QEvent::TouchBegin event is not accepted and not
filtered by an event filter, then no further touch events are sent until the next
QEvent::TouchBegin.
Some systems may send an event of type QEvent::TouchCancel. Upon receiving this event
applications are requested to ignore the entire active touch sequence. For example in a
composited system the compositor may decide to treat certain gestures as system-wide
gestures. Whenever such a decision is made (the gesture is recognized), the clients will be
notified with a QEvent::TouchCancel event so they can update their state accordingly.
The touchPoints() function returns a list of all touch points contained in the event.
Information about each touch point can be retrieved using the QTouchEvent::TouchPoint class.
The Qt::TouchPointState enum describes the different states that a touch point may have.