summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-08-27 11:40:03 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-08-27 12:06:14 (GMT)
commit41631d2803c72565857d68817b4be55a9701e725 (patch)
tree1f9a7b1e716cd53e28fc4ffb2023caec00082337
parenta69f291170b38166acceef7c93f3b2d6d55c90d1 (diff)
downloadQt-41631d2803c72565857d68817b4be55a9701e725.zip
Qt-41631d2803c72565857d68817b4be55a9701e725.tar.gz
Qt-41631d2803c72565857d68817b4be55a9701e725.tar.bz2
Gestures: make all screen points float
This is more in accordance with touch points, and graphics view Rev-By: Discussed with Denis and Brad
-rw-r--r--src/gui/kernel/qstandardgestures.cpp14
-rw-r--r--src/gui/kernel/qstandardgestures.h12
-rw-r--r--src/gui/kernel/qstandardgestures_p.h6
3 files changed, 16 insertions, 16 deletions
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index 780c41f..0c4cadf 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -230,8 +230,8 @@ bool QPanGesture::filterEvent(QEvent *event)
// INVARIANT: The singleTouchTimer has still not fired.
// Lets check if the user moved his finger so much from
// the starting point that it makes sense to cancel:
- const QPoint startPos = ev->touchPoints().at(0).startPos().toPoint();
- const QPoint p = ev->touchPoints().at(0).pos().toPoint();
+ const QPointF startPos = ev->touchPoints().at(0).startPos().toPoint();
+ const QPointF p = ev->touchPoints().at(0).pos().toPoint();
if ((startPos - p).manhattanLength() > panBeginRadius)
reset();
else
@@ -367,7 +367,7 @@ bool QPinchGesture::eventFilter(QObject *receiver, QEvent *event)
d->state = Qt::NoGesture;
d->scaleFactor = d->lastScaleFactor = 1;
d->rotationAngle = d->lastRotationAngle = 0;
- d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPoint();
+ d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPointF();
#if defined(Q_WS_WIN)
d->initialDistance = 0;
#endif
@@ -433,7 +433,7 @@ void QPinchGesture::reset()
Q_D(QPinchGesture);
d->scaleFactor = d->lastScaleFactor = 0;
d->rotationAngle = d->lastRotationAngle = 0;
- d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPoint();
+ d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPointF();
QGesture::reset();
}
@@ -483,7 +483,7 @@ qreal QPinchGesture::lastRotationAngle() const
Specifies a center point of the gesture. The point can be used as a center
point that the object is rotated around.
*/
-QPoint QPinchGesture::centerPoint() const
+QPointF QPinchGesture::centerPoint() const
{
return d_func()->centerPoint;
}
@@ -493,7 +493,7 @@ QPoint QPinchGesture::centerPoint() const
Specifies a previous center point of the gesture.
*/
-QPoint QPinchGesture::lastCenterPoint() const
+QPointF QPinchGesture::lastCenterPoint() const
{
return d_func()->lastCenterPoint;
}
@@ -505,7 +505,7 @@ QPoint QPinchGesture::lastCenterPoint() const
startCenterPoint and the centerPoint is the distance at which pinching
fingers has shifted.
*/
-QPoint QPinchGesture::startCenterPoint() const
+QPointF QPinchGesture::startCenterPoint() const
{
return d_func()->startCenterPoint;
}
diff --git a/src/gui/kernel/qstandardgestures.h b/src/gui/kernel/qstandardgestures.h
index a877fed..9f2f204 100644
--- a/src/gui/kernel/qstandardgestures.h
+++ b/src/gui/kernel/qstandardgestures.h
@@ -92,9 +92,9 @@ class Q_GUI_EXPORT QPinchGesture : public QGesture
Q_PROPERTY(qreal rotationAngle READ rotationAngle)
Q_PROPERTY(qreal lastRotationAngle READ lastRotationAngle)
- Q_PROPERTY(QPoint startCenterPoint READ startCenterPoint)
- Q_PROPERTY(QPoint lastCenterPoint READ lastCenterPoint)
- Q_PROPERTY(QPoint centerPoint READ centerPoint)
+ Q_PROPERTY(QPointF startCenterPoint READ startCenterPoint)
+ Q_PROPERTY(QPointF lastCenterPoint READ lastCenterPoint)
+ Q_PROPERTY(QPointF centerPoint READ centerPoint)
public:
QPinchGesture(QWidget *gestureTarget, QObject *parent = 0);
@@ -102,9 +102,9 @@ public:
bool filterEvent(QEvent *event);
void reset();
- QPoint startCenterPoint() const;
- QPoint lastCenterPoint() const;
- QPoint centerPoint() const;
+ QPointF startCenterPoint() const;
+ QPointF lastCenterPoint() const;
+ QPointF centerPoint() const;
qreal scaleFactor() const;
qreal lastScaleFactor() const;
diff --git a/src/gui/kernel/qstandardgestures_p.h b/src/gui/kernel/qstandardgestures_p.h
index 5adcf3a..0a4debe 100644
--- a/src/gui/kernel/qstandardgestures_p.h
+++ b/src/gui/kernel/qstandardgestures_p.h
@@ -102,9 +102,9 @@ public:
qreal lastScaleFactor;
qreal rotationAngle;
qreal lastRotationAngle;
- QPoint startCenterPoint;
- QPoint lastCenterPoint;
- QPoint centerPoint;
+ QPointF startCenterPoint;
+ QPointF lastCenterPoint;
+ QPointF centerPoint;
#ifdef Q_WS_WIN
int initialDistance;
#endif