summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication.cpp
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-23 10:45:26 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-23 10:45:26 (GMT)
commit5e21e9b357a51eb6b3fa349dccf63e33c621fc72 (patch)
treefad2769e30786b098c2986232e1bbd8bbeb69ebe /src/gui/kernel/qapplication.cpp
parentf11f41fe9e507d1f3eb8994960f0226f229bc76c (diff)
downloadQt-5e21e9b357a51eb6b3fa349dccf63e33c621fc72.zip
Qt-5e21e9b357a51eb6b3fa349dccf63e33c621fc72.tar.gz
Qt-5e21e9b357a51eb6b3fa349dccf63e33c621fc72.tar.bz2
Add functions to report normalized positions in QTouchEvent::TouchPoint
This introduces normalizedPos(), startNormalizedPos(), and lastNormalizedPos() in QTouchEvent::TouchPoint, and must be set by the implementation before being fed into Qt. We are assuming and hoping that these functions will make it easier to implement certain types of gestures (especially on a touchpad).
Diffstat (limited to 'src/gui/kernel/qapplication.cpp')
-rw-r--r--src/gui/kernel/qapplication.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 5ef453d..4671ded 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -5331,6 +5331,8 @@ void QApplicationPrivate::translateRawTouchEvent(QWidget *window,
d->widgetForTouchPointId[touchPoint.id()] = widget;
touchPoint.setStartScreenPos(touchPoint.screenPos());
touchPoint.setLastScreenPos(touchPoint.screenPos());
+ touchPoint.setStartNormalizedPos(touchPoint.normalizedPos());
+ touchPoint.setLastNormalizedPos(touchPoint.normalizedPos());
d->appCurrentTouchPoints.insert(touchPoint.id(), touchPoint);
break;
}
@@ -5343,6 +5345,8 @@ void QApplicationPrivate::translateRawTouchEvent(QWidget *window,
QTouchEvent::TouchPoint previousTouchPoint = d->appCurrentTouchPoints.take(touchPoint.id());
touchPoint.setStartScreenPos(previousTouchPoint.startScreenPos());
touchPoint.setLastScreenPos(previousTouchPoint.screenPos());
+ touchPoint.setStartNormalizedPos(previousTouchPoint.startNormalizedPos());
+ touchPoint.setLastNormalizedPos(previousTouchPoint.normalizedPos());
break;
}
default:
@@ -5353,6 +5357,8 @@ void QApplicationPrivate::translateRawTouchEvent(QWidget *window,
QTouchEvent::TouchPoint previousTouchPoint = d->appCurrentTouchPoints.value(touchPoint.id());
touchPoint.setStartScreenPos(previousTouchPoint.startScreenPos());
touchPoint.setLastScreenPos(previousTouchPoint.screenPos());
+ touchPoint.setStartNormalizedPos(previousTouchPoint.startNormalizedPos());
+ touchPoint.setLastNormalizedPos(previousTouchPoint.normalizedPos());
d->appCurrentTouchPoints[touchPoint.id()] = touchPoint;
break;
}