summaryrefslogtreecommitdiffstats
path: root/examples/widgets/touch/pinchzoom/graphicsview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/touch/pinchzoom/graphicsview.cpp')
-rw-r--r--examples/widgets/touch/pinchzoom/graphicsview.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/widgets/touch/pinchzoom/graphicsview.cpp b/examples/widgets/touch/pinchzoom/graphicsview.cpp
index 54e134aea2..6412f350a7 100644
--- a/examples/widgets/touch/pinchzoom/graphicsview.cpp
+++ b/examples/widgets/touch/pinchzoom/graphicsview.cpp
@@ -54,7 +54,7 @@
#include <QTouchEvent>
GraphicsView::GraphicsView(QGraphicsScene *scene, QWidget *parent)
- : QGraphicsView(scene, parent), totalScaleFactor(1)
+ : QGraphicsView(scene, parent)
{
viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
setDragMode(ScrollHandDrag);
@@ -83,8 +83,8 @@ bool GraphicsView::viewportEvent(QEvent *event)
totalScaleFactor *= currentScaleFactor;
currentScaleFactor = 1;
}
- setTransform(QTransform().scale(totalScaleFactor * currentScaleFactor,
- totalScaleFactor * currentScaleFactor));
+ setTransform(QTransform::fromScale(totalScaleFactor * currentScaleFactor,
+ totalScaleFactor * currentScaleFactor));
}
return true;
}