summaryrefslogtreecommitdiffstats
path: root/examples/gestures
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-09-02 17:59:11 +0200
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-09-03 11:30:55 +0200
commit70f5d838e42b6c34a28de54b5294d18b11529c8a (patch)
tree2f97da0618383deafccae40254313c77fa434bef /examples/gestures
parent466bc1ed4bf0c466e54732b2f8f7a16a34b716a8 (diff)
Added a property to QPinchGesture to specify what exactly changed.
Added QPinchGesture::whatChanged() which specifies which property in the pinch gesture changed - the scale factor or rotation angle or both. Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'examples/gestures')
-rw-r--r--examples/gestures/imageviewer/imagewidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/gestures/imageviewer/imagewidget.cpp b/examples/gestures/imageviewer/imagewidget.cpp
index a4ea238d05..c71c461a75 100644
--- a/examples/gestures/imageviewer/imagewidget.cpp
+++ b/examples/gestures/imageviewer/imagewidget.cpp
@@ -123,9 +123,9 @@ void ImageWidget::panTriggered()
void ImageWidget::pinchTriggered()
{
QPinchGesture *pg = qobject_cast<QPinchGesture*>(sender());
- if (pg->rotationAngle() != 0.0)
+ if (pg->whatChanged() & QPinchGesture::RotationAngleChanged)
rotationAngle += pg->rotationAngle() - pg->lastRotationAngle();
- if (pg->scaleFactor() != 1.0)
+ if (pg->whatChanged() & QPinchGesture::ScaleFactorChanged)
scaleFactor += pg->scaleFactor() - pg->lastScaleFactor();
update();
}