summaryrefslogtreecommitdiffstats
path: root/examples/gestures/imageviewer
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-10-12 12:11:44 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-10-13 12:15:35 (GMT)
commitb6b6da647132f7fdf78d0601cbf7b411fda474f0 (patch)
tree42c6eddc023420111a4c080ad94d77172e24567a /examples/gestures/imageviewer
parent8d9acba3ecac466fa86201e4eb760af1ccea68e3 (diff)
downloadQt-b6b6da647132f7fdf78d0601cbf7b411fda474f0.zip
Qt-b6b6da647132f7fdf78d0601cbf7b411fda474f0.tar.gz
Qt-b6b6da647132f7fdf78d0601cbf7b411fda474f0.tar.bz2
Mac: implement gestures conforming to the new API
Diffstat (limited to 'examples/gestures/imageviewer')
-rw-r--r--examples/gestures/imageviewer/imagewidget.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/gestures/imageviewer/imagewidget.cpp b/examples/gestures/imageviewer/imagewidget.cpp
index b8bb7b5..f3fd8e4 100644
--- a/examples/gestures/imageviewer/imagewidget.cpp
+++ b/examples/gestures/imageviewer/imagewidget.cpp
@@ -104,10 +104,10 @@ bool ImageWidget::gestureEvent(QGestureEvent *event)
panTriggered(static_cast<QPanGesture*>(pan));
return true;
} else if (QGesture *pinch = event->gesture(Qt::PinchGesture)) {
- pinchTriggered(static_cast<QPinchGesture*>(pan));
+ pinchTriggered(static_cast<QPinchGesture*>(pinch));
return true;
} else if (QGesture *swipe = event->gesture(Qt::SwipeGesture)) {
- swipeTriggered(static_cast<QSwipeGesture*>(pan));
+ swipeTriggered(static_cast<QSwipeGesture*>(swipe));
return true;
}
return false;
@@ -125,7 +125,7 @@ void ImageWidget::panTriggered(QPanGesture *gesture)
setCursor(Qt::ArrowCursor);
}
#endif
- QSizeF lastOffset = gesture->property("lastOffset").toSizeF();
+ QSizeF lastOffset = gesture->offset();
horizontalOffset += lastOffset.width();
verticalOffset += lastOffset.height();
update();
@@ -133,7 +133,7 @@ void ImageWidget::panTriggered(QPanGesture *gesture)
void ImageWidget::pinchTriggered(QPinchGesture *gesture)
{
- QPinchGesture::WhatChanged whatChanged = gesture->property("whatChanged").value<QPinchGesture::WhatChanged>();
+ QPinchGesture::WhatChanged whatChanged = gesture->whatChanged();
if (whatChanged & QPinchGesture::RotationAngleChanged) {
qreal value = gesture->property("rotationAngle").toReal();
qreal lastValue = gesture->property("lastRotationAngle").toReal();