diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-23 09:24:24 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-23 09:24:24 (GMT) |
commit | b62f4db7526a5b0794940ac358f287398225a411 (patch) | |
tree | 13859a18133ce6e1dc27f8138eb228019c4101ab | |
parent | fbe44b843194f3892e163ecec1be52fb498e2ddd (diff) | |
download | Qt-b62f4db7526a5b0794940ac358f287398225a411.zip Qt-b62f4db7526a5b0794940ac358f287398225a411.tar.gz Qt-b62f4db7526a5b0794940ac358f287398225a411.tar.bz2 |
Set the pressure automatically if not set by the touch implementation
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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; } |