Qt Declarative (Quick 2)
Go to file
Shawn Rutledge a432970b25 Standardize Drag/PinchHandler active/persistent scale, rotation, translation
PinchHandler.scale is persistent between gestures, whereas rotation and
translation were active-gesture properties; that wasn't consistent.
We fixed up DragHandler in just this way in 6.2.

The translationChanged() signal now comes with a vector delta, which is
often useful when writing an onTranslationChanged JS handler. Likewise,
scaleChanged() and rotationChanged() come with qreal deltas. The
scaleChanged() delta is multiplicative rather than additive, because
an additive delta would not be useful in cases when some target item's
scale can be adjusted by alternative means: you need to multiply it
in your onScaleChanged function.

Now that PinchHandler has 4 axes as grouped properties, some properties
in the handlers themselves begin to look redundant; but at least the
translation properties are useful to group x and y together. So in this
patch we continue to follow the pattern that was set in
60d11e1f69. PinchHandler.scale is
equivalent to persistentScale, whereas rotation is equivalent to
activeRotation; so we have a reason to deprecate those properties, as in
ea63ee5233.

The persistent values have setters, to provide another way for
applications to compensate when the values are adjusted by other means,
as an alternative to incremental changes via a script such as
rotationAxis.onValueDelta, onRotationChanged etc.

[ChangeLog][QtQuick][Event Handlers] PinchHandler.activeTranslation now
holds the amount of movement since the pinch gesture began.
PinchHandler.persistentTranslation holds the accumulated sum of
movement that has occurred during subsequent pinch gestures, and can
be set to arbitrary values between gestures. Likewise, activeScale,
persistentScale, activeRotation and persistentRotation follow the
same pattern. The scaleChanged, rotationChanged, and translationChanged
signals include delta arguments, which are useful for incrementally
adjusting a non-default item property when the target is null.

Fixes: QTBUG-76739
Task-number: QTBUG-94168
Change-Id: I6aaa1aa3356b85e6d27abc64bfa67781ecb4f062
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-12-10 19:18:21 +01:00
LICENSES Use SPDX license identifiers 2022-06-11 08:05:15 +02:00
cmake Make Sure that `qml_compile_hash_p.h` Isn't Missing 2022-10-26 14:02:58 +02:00
coin qmldom: use a released Qt 6.3 2022-10-06 11:41:18 +00:00
dist Merge qtquickcontrols2 into qtdeclarative 2021-07-28 11:21:25 +02:00
examples Add PinchHandler.scaleAxis, rotationAxis; hold values in axes 2022-12-10 03:13:57 +01:00
features
src Standardize Drag/PinchHandler active/persistent scale, rotation, translation 2022-12-10 19:18:21 +01:00
tests Standardize Drag/PinchHandler active/persistent scale, rotation, translation 2022-12-10 19:18:21 +01:00
tools Remove Qt keywords from all headers 2022-12-09 11:55:10 +08:00
.cmake.conf Mark the module free of qAsConst() 2022-12-05 20:46:21 +01:00
.gitattributes qmlformat: improve testing of file based options 2021-11-04 13:35:48 +01:00
.gitignore Remove "2" from Qt Quick Controls directories 2022-12-01 10:26:20 +08:00
.gitmodules
.tag Use tree hash rather than commit hash in .tag file 2022-01-25 23:55:27 +01:00
CMakeLists.txt Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-09-07 17:01:30 +02:00
README.md Rewrite README.md 2021-08-12 13:15:17 +00:00
conanfile.py Use SPDX license identifiers 2022-06-11 08:05:15 +02:00
configure.cmake Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-09-07 17:01:30 +02:00
dependencies.yaml Update dependencies on 'dev' in qt/qtdeclarative 2022-12-08 14:43:51 +00:00
qt_cmdline.cmake Remove "2" from Qt Quick Controls directories 2022-12-01 10:26:20 +08:00
qtdeclarative.doxy
sync.profile Remove "2" from Qt Quick Controls directories 2022-12-01 10:26:20 +08:00