From 0580be5026ec66409259ea546454cbd11666bb75 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 24 Jun 2009 10:30:32 +0200 Subject: Fix pressure "emulation" Update the auto test for QTouchEvent to make sure the pressure is set to 1 for Pressed/Moved/Stationary, but for 0 for Released. --- tests/auto/qtouchevent/tst_qtouchevent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/auto/qtouchevent/tst_qtouchevent.cpp') diff --git a/tests/auto/qtouchevent/tst_qtouchevent.cpp b/tests/auto/qtouchevent/tst_qtouchevent.cpp index b21ba40956..a9206bd3d7 100644 --- a/tests/auto/qtouchevent/tst_qtouchevent.cpp +++ b/tests/auto/qtouchevent/tst_qtouchevent.cpp @@ -284,7 +284,7 @@ void tst_QTouchEvent::basicRawEventTranslation() QCOMPARE(touchBeginPoint.rect(), QRectF(pos, QSizeF(0, 0))); QCOMPARE(touchBeginPoint.screenRect(), QRectF(rawTouchPoint.screenPos(), QSizeF(0, 0))); QCOMPARE(touchBeginPoint.sceneRect(), touchBeginPoint.screenRect()); - QCOMPARE(touchBeginPoint.pressure(), qreal(-1.)); + QCOMPARE(touchBeginPoint.pressure(), qreal(1.)); // moving the point should translate to TouchUpdate rawTouchPoint.setState(Qt::TouchPointMoved); @@ -314,7 +314,7 @@ void tst_QTouchEvent::basicRawEventTranslation() QCOMPARE(touchUpdatePoint.rect(), QRectF(pos + delta, QSizeF(0, 0))); QCOMPARE(touchUpdatePoint.screenRect(), QRectF(rawTouchPoint.screenPos(), QSizeF(0, 0))); QCOMPARE(touchUpdatePoint.sceneRect(), touchUpdatePoint.screenRect()); - QCOMPARE(touchUpdatePoint.pressure(), qreal(-1.)); + QCOMPARE(touchUpdatePoint.pressure(), qreal(1.)); // releasing the point translates to TouchEnd rawTouchPoint.setState(Qt::TouchPointReleased); @@ -344,7 +344,7 @@ void tst_QTouchEvent::basicRawEventTranslation() QCOMPARE(touchEndPoint.rect(), QRectF(pos + delta + delta, QSizeF(0, 0))); QCOMPARE(touchEndPoint.screenRect(), QRectF(rawTouchPoint.screenPos(), QSizeF(0, 0))); QCOMPARE(touchEndPoint.sceneRect(), touchEndPoint.screenRect()); - QCOMPARE(touchEndPoint.pressure(), qreal(-1.)); + QCOMPARE(touchEndPoint.pressure(), qreal(0.)); } QTEST_MAIN(tst_QTouchEvent) -- cgit v1.2.3