summaryrefslogtreecommitdiffstats
path: root/examples/gestures
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-09-03 14:36:15 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-09-03 14:36:15 (GMT)
commitf0844f9da7a834c282f6f04b2676f28de444e9dc (patch)
tree8e121429e25959043cc04c4364adbe8239e44a67 /examples/gestures
parentfe763ef6cd255ccb54d0de1894c1a772f959585e (diff)
parentf360180890298618ef3284c08789c2a243e1ba9d (diff)
downloadQt-f0844f9da7a834c282f6f04b2676f28de444e9dc.zip
Qt-f0844f9da7a834c282f6f04b2676f28de444e9dc.tar.gz
Qt-f0844f9da7a834c282f6f04b2676f28de444e9dc.tar.bz2
Merge commit 'qt/4.6' into kinetic-declarativeui
Diffstat (limited to 'examples/gestures')
-rw-r--r--examples/gestures/imageviewer/imageviewer.pro12
-rw-r--r--examples/gestures/imageviewer/imagewidget.cpp6
2 files changed, 10 insertions, 8 deletions
diff --git a/examples/gestures/imageviewer/imageviewer.pro b/examples/gestures/imageviewer/imageviewer.pro
index efbca00..124175e 100644
--- a/examples/gestures/imageviewer/imageviewer.pro
+++ b/examples/gestures/imageviewer/imageviewer.pro
@@ -1,11 +1,11 @@
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
HEADERS += imagewidget.h \
tapandholdgesture.h
SOURCES += imagewidget.cpp \
tapandholdgesture.cpp \
main.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/gestures/imageviewer
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS imageviewer.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/gestures/imageviewer
+INSTALLS += target sources
diff --git a/examples/gestures/imageviewer/imagewidget.cpp b/examples/gestures/imageviewer/imagewidget.cpp
index 7dbd084..c71c461 100644
--- a/examples/gestures/imageviewer/imagewidget.cpp
+++ b/examples/gestures/imageviewer/imagewidget.cpp
@@ -123,8 +123,10 @@ void ImageWidget::panTriggered()
void ImageWidget::pinchTriggered()
{
QPinchGesture *pg = qobject_cast<QPinchGesture*>(sender());
- rotationAngle += pg->rotationAngle();
- scaleFactor += pg->scaleFactor();
+ if (pg->whatChanged() & QPinchGesture::RotationAngleChanged)
+ rotationAngle += pg->rotationAngle() - pg->lastRotationAngle();
+ if (pg->whatChanged() & QPinchGesture::ScaleFactorChanged)
+ scaleFactor += pg->scaleFactor() - pg->lastScaleFactor();
update();
}