diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-05-27 15:22:31 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-05-27 15:22:31 (GMT) |
commit | 20fa050643f72b4bc91386c5fff62cdfe3b75393 (patch) | |
tree | fe0bdefb2007b79739b5e0de01bebee08ee5c8c0 /src/gui/kernel/qevent.cpp | |
parent | 8598ffab46a500b9077d437ffc72d0e6fc843712 (diff) | |
download | Qt-20fa050643f72b4bc91386c5fff62cdfe3b75393.zip Qt-20fa050643f72b4bc91386c5fff62cdfe3b75393.tar.gz Qt-20fa050643f72b4bc91386c5fff62cdfe3b75393.tar.bz2 |
Make Qt::TouchPointState ORable, add Q*TouchEvent::touchPointStates()
This new function returns a bitwise OR of all the touch point states for
the event. This makes it easy to see if a certain type of state is present
or not without the need to loop over all touch points.
QApplication and QGraphicsScene need to build this state when dispatching
the touch points. This also fixes the ASSERT bug that Denis found when
trying to send multiple touch presses in a touch begin event.
Diffstat (limited to 'src/gui/kernel/qevent.cpp')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 419107c..7a4c424 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3727,8 +3727,11 @@ void QGestureEvent::accept(const QString &type) */ QTouchEvent::QTouchEvent(QEvent::Type type, Qt::KeyboardModifiers modifiers, + Qt::TouchPointStates touchPointStates, const QList<QTouchEvent::TouchPoint *> &touchPoints) - : QInputEvent(type, modifiers), _touchPoints(touchPoints) + : QInputEvent(type, modifiers), + _touchPointStates(touchPointStates), + _touchPoints(touchPoints) { } /*! @@ -3737,6 +3740,18 @@ QTouchEvent::QTouchEvent(QEvent::Type type, QTouchEvent::~QTouchEvent() { } +/*! \fn Qt::TouchPointStates QTouchEvent::touchPointStates() const + + Returns a bitwise OR of all the touch point states for this event. +*/ + +/*! \fn void QTouchEvent::setTouchPointStates(Qt::TouchPointStates touchPointStates) + + \internal + + Sets a bitwise OR of all the touch point states for this event. +*/ + /*! \fn const QList<QTouchEvent::TouchPoint *> &QTouchEvent::TouchPoints() const Returns the list of touch points contained in the touch event. |