diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-04-30 09:27:43 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-04-30 09:27:43 (GMT) |
commit | cd260501918ea767e8a3ca33a51b1cb4e1bbd45c (patch) | |
tree | 0641d580f7c2226935d2f4b95f3e40735d4149a0 /tests/manual/qtouchevent | |
parent | f9b4c7bea991d1786c60406abc9da95354b0d6e3 (diff) | |
download | Qt-cd260501918ea767e8a3ca33a51b1cb4e1bbd45c.zip Qt-cd260501918ea767e8a3ca33a51b1cb4e1bbd45c.tar.gz Qt-cd260501918ea767e8a3ca33a51b1cb4e1bbd45c.tar.bz2 |
Made the Touch* event detection very strict
TouchBegin is only "seen" once before all other touch events, TouchUpdate
must be after TouchBegin but before TouchEnd, and TouchEnd is only seen
once after all other touch events.
Diffstat (limited to 'tests/manual/qtouchevent')
-rw-r--r-- | tests/manual/qtouchevent/touchwidget.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/manual/qtouchevent/touchwidget.cpp b/tests/manual/qtouchevent/touchwidget.cpp index 0516c5b..f029f8b 100644 --- a/tests/manual/qtouchevent/touchwidget.cpp +++ b/tests/manual/qtouchevent/touchwidget.cpp @@ -31,7 +31,7 @@ bool TouchWidget::event(QEvent *event) { switch (event->type()) { case QEvent::TouchBegin: - seenTouchBegin = true; + seenTouchBegin = !seenTouchBegin && !seenTouchUpdate && !seenTouchEnd; touchPointCount = qMax(touchPointCount, static_cast<QTouchEvent *>(event)->touchPoints().count()); if (acceptTouchBegin) { event->accept(); @@ -39,7 +39,7 @@ bool TouchWidget::event(QEvent *event) } break; case QEvent::TouchUpdate: - seenTouchUpdate = true; + seenTouchUpdate = seenTouchBegin && !seenTouchEnd; touchPointCount = qMax(touchPointCount, static_cast<QTouchEvent *>(event)->touchPoints().count()); if (acceptTouchUpdate) { event->accept(); @@ -47,7 +47,7 @@ bool TouchWidget::event(QEvent *event) } break; case QEvent::TouchEnd: - seenTouchEnd = true; + seenTouchEnd = seenTouchBegin && !seenTouchEnd; touchPointCount = qMax(touchPointCount, static_cast<QTouchEvent *>(event)->touchPoints().count()); if (closeWindowOnTouchEnd) window()->close(); |