From 4af00753fad57989a6ae366cc3dbfc56d88508f4 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 6 Sep 2019 23:24:56 +0200 Subject: Cleanup QtWidgets examples Cleanup QtWidgets examples: - use nullptr (clang-tidy) - use member-initialization - adjust the style - fix includes Change-Id: Ic5448606aacc525ea60b615a69227017aa2b821a Reviewed-by: Paul Wicking --- examples/widgets/touch/pinchzoom/graphicsview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/widgets/touch/pinchzoom/graphicsview.cpp') 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 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; } -- cgit v1.2.3