From b62f4db7526a5b0794940ac358f287398225a411 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Tue, 23 Jun 2009 11:24:24 +0200 Subject: Set the pressure automatically if not set by the touch implementation --- src/gui/kernel/qapplication.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 5ef453d..ea10fce 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -5260,7 +5260,6 @@ void QApplicationPrivate::updateTouchPointsForWidget(QWidget *widget, QTouchEven rect.moveCenter(widget->mapFromGlobal(screenPos.toPoint()) + delta); touchPoint.setRect(rect); - touchPoint.setStartPos(widget->mapFromGlobal(touchPoint.startScreenPos().toPoint()) + delta); touchPoint.setLastPos(widget->mapFromGlobal(touchPoint.lastScreenPos().toPoint()) + delta); } @@ -5331,6 +5330,8 @@ void QApplicationPrivate::translateRawTouchEvent(QWidget *window, d->widgetForTouchPointId[touchPoint.id()] = widget; touchPoint.setStartScreenPos(touchPoint.screenPos()); touchPoint.setLastScreenPos(touchPoint.screenPos()); + if (touchPoint.pressure() < qreal(0.)) + touchPoint.setPressure(qreal(1.)); d->appCurrentTouchPoints.insert(touchPoint.id(), touchPoint); break; } @@ -5343,6 +5344,8 @@ void QApplicationPrivate::translateRawTouchEvent(QWidget *window, QTouchEvent::TouchPoint previousTouchPoint = d->appCurrentTouchPoints.take(touchPoint.id()); touchPoint.setStartScreenPos(previousTouchPoint.startScreenPos()); touchPoint.setLastScreenPos(previousTouchPoint.screenPos()); + if (touchPoint.pressure() < qreal(0.)) + touchPoint.setPressure(qreal(0.)); break; } default: @@ -5353,6 +5356,8 @@ void QApplicationPrivate::translateRawTouchEvent(QWidget *window, QTouchEvent::TouchPoint previousTouchPoint = d->appCurrentTouchPoints.value(touchPoint.id()); touchPoint.setStartScreenPos(previousTouchPoint.startScreenPos()); touchPoint.setLastScreenPos(previousTouchPoint.screenPos()); + if (touchPoint.pressure() < qreal(0.)) + touchPoint.setPressure(qreal(0.)); d->appCurrentTouchPoints[touchPoint.id()] = touchPoint; break; } -- cgit v0.12