summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtouchevent
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-18 11:29:28 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-18 11:29:28 (GMT)
commit5a350be913139e2b994878c62ce06eb88604abbe (patch)
tree7662610c7c5e6658ada0cc014b46b48cac1691ab /tests/auto/qtouchevent
parent7e8734879ea7619a632553b59b2a8bd491033cce (diff)
downloadQt-5a350be913139e2b994878c62ce06eb88604abbe.zip
Qt-5a350be913139e2b994878c62ce06eb88604abbe.tar.gz
Qt-5a350be913139e2b994878c62ce06eb88604abbe.tar.bz2
compile after small API changes
Diffstat (limited to 'tests/auto/qtouchevent')
-rw-r--r--tests/auto/qtouchevent/tst_qtouchevent.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/tests/auto/qtouchevent/tst_qtouchevent.cpp b/tests/auto/qtouchevent/tst_qtouchevent.cpp
index 40c3c00..f27641b 100644
--- a/tests/auto/qtouchevent/tst_qtouchevent.cpp
+++ b/tests/auto/qtouchevent/tst_qtouchevent.cpp
@@ -135,8 +135,8 @@ void tst_QTouchEvent::touchEventAcceptedByDefault()
QWidget widget;
widget.setAttribute(Qt::WA_AcceptTouchEvents);
- // QWidget doesn't handle touch event by default, so sending it fails
- // (but the event is accepted)
+ // QWidget handles touch event by converting them into a mouse event, so the event is both
+ // accepted and handled (res == true)
QList<QTouchEvent::TouchPoint> touchPoints;
touchPoints.append(QTouchEvent::TouchPoint(0));
QTouchEvent touchEvent(QEvent::TouchBegin,
@@ -144,7 +144,7 @@ void tst_QTouchEvent::touchEventAcceptedByDefault()
Qt::TouchPointPressed,
touchPoints);
bool res = QApplication::sendEvent(&widget, &touchEvent);
- QVERIFY(!res);
+ QVERIFY(res);
QVERIFY(touchEvent.isAccepted());
// tst_QTouchEventWidget does handle, sending succeeds
@@ -244,8 +244,6 @@ void tst_QTouchEvent::touchUpdateAndEndNeverPropagate()
void tst_QTouchEvent::basicRawEventTranslation()
{
- extern Q_GUI_EXPORT bool qt_translateRawTouchEvent(const QList<QTouchEvent::TouchPoint> &, QWidget *);
-
tst_QTouchEventWidget touchWidget;
touchWidget.setAttribute(Qt::WA_AcceptTouchEvents);
@@ -259,8 +257,7 @@ void tst_QTouchEvent::basicRawEventTranslation()
// this should be translated to a TouchBegin
rawTouchPoint.setState(Qt::TouchPointPressed);
rawTouchPoint.setScreenPos(screenPos);
- bool res = qt_translateRawTouchEvent(QList<QTouchEvent::TouchPoint>() << rawTouchPoint, &touchWidget);
- QVERIFY(res);
+ qt_translateRawTouchEvent(QList<QTouchEvent::TouchPoint>() << rawTouchPoint, &touchWidget);
QVERIFY(touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
QVERIFY(!touchWidget.seenTouchEnd);
@@ -285,8 +282,7 @@ void tst_QTouchEvent::basicRawEventTranslation()
// moving the point should translate to TouchUpdate
rawTouchPoint.setState(Qt::TouchPointMoved);
rawTouchPoint.setScreenPos(screenPos + delta);
- res = qt_translateRawTouchEvent(QList<QTouchEvent::TouchPoint>() << rawTouchPoint, &touchWidget);
- QVERIFY(res);
+ qt_translateRawTouchEvent(QList<QTouchEvent::TouchPoint>() << rawTouchPoint, &touchWidget);
QVERIFY(touchWidget.seenTouchBegin);
QVERIFY(touchWidget.seenTouchUpdate);
QVERIFY(!touchWidget.seenTouchEnd);
@@ -311,8 +307,7 @@ void tst_QTouchEvent::basicRawEventTranslation()
// releasing the point translates to TouchEnd
rawTouchPoint.setState(Qt::TouchPointReleased);
rawTouchPoint.setScreenPos(screenPos + delta + delta);
- res = qt_translateRawTouchEvent(QList<QTouchEvent::TouchPoint>() << rawTouchPoint, &touchWidget);
- QVERIFY(res);
+ qt_translateRawTouchEvent(QList<QTouchEvent::TouchPoint>() << rawTouchPoint, &touchWidget);
QVERIFY(touchWidget.seenTouchBegin);
QVERIFY(touchWidget.seenTouchUpdate);
QVERIFY(touchWidget.seenTouchEnd);