summaryrefslogtreecommitdiff
path: root/src/quick/doc/snippets/pointerHandlers/images
Commit message (Collapse)AuthorAgeFilesLines
* Standardize Drag/PinchHandler active/persistent scale, rotation, translationShawn Rutledge2022-12-101-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 60d11e1f69470d588666b76092cd40ae5644a855. PinchHandler.scale is equivalent to persistentScale, whereas rotation is equivalent to activeRotation; so we have a reason to deprecate those properties, as in ea63ee523377bd11b957a9e74185792edd9b32e8. 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>
* doc: Fix inherited property docs in HoverHandlerShawn Rutledge2022-04-281-0/+0
Some base class snippets use TapHandler, but it's better to show snippets specifically with HoverHandler. These snippets are also runnable and thus testable. Fixes: QTBUG-95395 Task-number: QTBUG-101932 Pick-to: 6.3 6.2 5.15 Change-Id: Ibcdc30ff8a785a3651177c79522332cf09c3013c Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>