summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qstandardgestures.cpp
diff options
context:
space:
mode:
authorThomas Zander <thomas.zander@trolltech.com>2009-10-20 13:43:05 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-10-22 14:59:20 (GMT)
commit04302702c5e7938fb4ae8bc41d78486725e62ae7 (patch)
treeafc1643a16dec5079f82f219418ba1d2a76dbb04 /src/gui/kernel/qstandardgestures.cpp
parentee6d3a13a04c2fb5cfef8a18fd370ef1f605555a (diff)
downloadQt-04302702c5e7938fb4ae8bc41d78486725e62ae7.zip
Qt-04302702c5e7938fb4ae8bc41d78486725e62ae7.tar.gz
Qt-04302702c5e7938fb4ae8bc41d78486725e62ae7.tar.bz2
Change API; the pan gesture now has points for distance, not size.
Diffstat (limited to 'src/gui/kernel/qstandardgestures.cpp')
-rw-r--r--src/gui/kernel/qstandardgestures.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index dfc3499..a136379 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -73,7 +73,7 @@ QGestureRecognizer::Result QPanGestureRecognizer::filterEvent(QGesture *state, Q
result = QGestureRecognizer::MaybeGesture;
QTouchEvent::TouchPoint p = ev->touchPoints().at(0);
d->lastPosition = p.pos().toPoint();
- d->lastOffset = d->totalOffset = d->offset = QSize();
+ d->lastOffset = d->totalOffset = d->offset = QPointF();
break;
}
case QEvent::TouchEnd: {
@@ -83,7 +83,7 @@ QGestureRecognizer::Result QPanGestureRecognizer::filterEvent(QGesture *state, Q
QTouchEvent::TouchPoint p2 = ev->touchPoints().at(1);
d->lastOffset = d->offset;
d->offset =
- QSize(p1.pos().x() - p1.lastPos().x() + p2.pos().x() - p2.lastPos().x(),
+ QPointF(p1.pos().x() - p1.lastPos().x() + p2.pos().x() - p2.lastPos().x(),
p1.pos().y() - p1.lastPos().y() + p2.pos().y() - p2.lastPos().y()) / 2;
d->totalOffset += d->offset;
}
@@ -99,11 +99,11 @@ QGestureRecognizer::Result QPanGestureRecognizer::filterEvent(QGesture *state, Q
QTouchEvent::TouchPoint p2 = ev->touchPoints().at(1);
d->lastOffset = d->offset;
d->offset =
- QSize(p1.pos().x() - p1.lastPos().x() + p2.pos().x() - p2.lastPos().x(),
+ QPointF(p1.pos().x() - p1.lastPos().x() + p2.pos().x() - p2.lastPos().x(),
p1.pos().y() - p1.lastPos().y() + p2.pos().y() - p2.lastPos().y()) / 2;
d->totalOffset += d->offset;
- if (d->totalOffset.width() > 10 || d->totalOffset.height() > 10 ||
- d->totalOffset.width() < -10 || d->totalOffset.height() < -10) {
+ if (d->totalOffset.x() > 10 || d->totalOffset.y() > 10 ||
+ d->totalOffset.x() < -10 || d->totalOffset.y() < -10) {
result = QGestureRecognizer::GestureTriggered;
} else {
result = QGestureRecognizer::MaybeGesture;
@@ -128,7 +128,7 @@ void QPanGestureRecognizer::reset(QGesture *state)
QPanGesture *pan = static_cast<QPanGesture*>(state);
QPanGesturePrivate *d = pan->d_func();
- d->totalOffset = d->lastOffset = d->offset = QSizeF();
+ d->totalOffset = d->lastOffset = d->offset = QPointF();
d->lastPosition = QPoint();
d->acceleration = 0;