summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-04-30 09:27:43 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-04-30 09:27:43 (GMT)
commitcd260501918ea767e8a3ca33a51b1cb4e1bbd45c (patch)
tree0641d580f7c2226935d2f4b95f3e40735d4149a0 /tests/manual
parentf9b4c7bea991d1786c60406abc9da95354b0d6e3 (diff)
downloadQt-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')
-rw-r--r--tests/manual/qtouchevent/touchwidget.cpp6
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();