diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-06-22 16:37:32 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-06-27 15:31:07 +0000 |
commit | b4d31c9ff5f0c5821ea127c663532d9fc2cae43e (patch) | |
tree | e8cbf769123e2c59a3d42fd4d9f1ae67b722a15e /tests | |
parent | a1adcf34f8784d05467cf3598064a3e83842fdc0 (diff) |
PinchHandler: rename scale to activeScale; scale means target scale
If you want to set target: null and then bind scale to some sort of
rendering scale property directly, it's a lot less trouble if the
scale property does not keep changing back to 1.0 every time a gesture
begins. Added an activeScale property to represent that value, the
one that the scale property had before.
Task-number: QTBUG-68941
Change-Id: Idcb6735d915a523afe1a948609080af7a83f82ad
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp | 4 | ||||
-rw-r--r-- | tests/manual/pointer/map.qml | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp b/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp index 4b096f9c3a..0561a9e4f1 100644 --- a/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp +++ b/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp @@ -210,9 +210,9 @@ void tst_MptaInterop::touchesThenPinch() if (!pinchStoleGrab && pointerEvent->point(0)->exclusiveGrabber() == pinch) pinchStoleGrab = i; } - qCDebug(lcPointerTests) << "pinch started after" << pinchStoleGrab << "moves; ended with scale" << pinch->scale() << "rot" << pinch->rotation(); + qCDebug(lcPointerTests) << "pinch started after" << pinchStoleGrab << "moves; ended with scale" << pinch->activeScale() << "rot" << pinch->rotation(); QTRY_VERIFY(pinch->rotation() > 4); - QVERIFY(pinch->scale() > 1); + QVERIFY(pinch->activeScale() > 1); // Press one more point (pinkie finger) QPoint p4 = mpta->mapToScene(QPointF(300, 200)).toPoint(); diff --git a/tests/manual/pointer/map.qml b/tests/manual/pointer/map.qml index 6ab6badfd0..880f184adb 100644 --- a/tests/manual/pointer/map.qml +++ b/tests/manual/pointer/map.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the manual tests of the Qt Toolkit. @@ -48,6 +48,12 @@ Item { source: "resources/map.svgz" Component.onCompleted: { width = implicitWidth; height = implicitHeight } } + + Text { + anchors.centerIn: parent + text: image.sourceSize.width + " x " + image.sourceSize.height + + " scale " + map.scale.toFixed(2) + " active scale " + pinch.activeScale.toFixed(2) + } } PinchHandler { |