summaryrefslogtreecommitdiffstats
path: root/examples/touch
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-06-25 19:44:44 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-26 04:18:14 +0200
commit62d4840011c3b5038402a4b043a7f7f85995b8f3 (patch)
tree54b8a7e2c182a0e4651f6fcdd25e3cfd2d1cf805 /examples/touch
parenta1f9149ac75f08877074d4898399b46943eb9cd2 (diff)
Replace the QGraphicsItem deprecated transforming functions
The scale(), rotate() and translate() functions are replaced with QGraphicsItem::setTransform. Change-Id: Icb81c71b1513c049e2fd607995ca3a868108ee30 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Andreas Aardal Hanssen <andrhans@cisco.com>
Diffstat (limited to 'examples/touch')
-rw-r--r--examples/touch/knobs/knob.cpp2
-rw-r--r--examples/touch/pinchzoom/mouse.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/touch/knobs/knob.cpp b/examples/touch/knobs/knob.cpp
index b3d07e7335..fbba7f2cbb 100644
--- a/examples/touch/knobs/knob.cpp
+++ b/examples/touch/knobs/knob.cpp
@@ -74,7 +74,7 @@ bool Knob::sceneEvent(QEvent *event)
QLineF line1(touchPoint1.lastScenePos(), touchPoint2.lastScenePos());
QLineF line2(touchPoint1.scenePos(), touchPoint2.scenePos());
- rotate(line2.angleTo(line1));
+ setTransform(QTransform().rotate(line2.angleTo(line1)), true);
}
break;
diff --git a/examples/touch/pinchzoom/mouse.cpp b/examples/touch/pinchzoom/mouse.cpp
index 1f5af2776e..a49b4aa85d 100644
--- a/examples/touch/pinchzoom/mouse.cpp
+++ b/examples/touch/pinchzoom/mouse.cpp
@@ -63,7 +63,7 @@ Mouse::Mouse()
: angle(0), speed(0), mouseEyeDirection(0),
color(qrand() % 256, qrand() % 256, qrand() % 256)
{
- rotate(qrand() % (360 * 16));
+ setTransform(QTransform().rotate(qrand() % (360 * 16)), true);
startTimer(1000 / 33);
}
//! [0]
@@ -193,7 +193,7 @@ void Mouse::timerEvent(QTimerEvent *)
qreal dx = ::sin(angle) * 10;
mouseEyeDirection = (qAbs(dx / 5) < 1) ? 0 : dx / 5;
- rotate(dx);
+ setTransform(QTransform().rotate(dx), true);
setPos(mapToParent(0, -(3 + sin(speed) * 3)));
}
//! [11]