Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.0 FF
-
None
-
8813d9a22 (dev), fa3e60f18 (6.5)
Description
Docs currently have
\c persistentValue is the same as \l {QtQuick::DragHandler::persistentTranslation}{persistentTranslation.x}.
But that's not very useful if we are going to make QQuickDragAxis responsible for setting target properties: the axis object will set exactly the persistentValue on the target item property, NOT the delta. If it wants to store a delta instead, we'd name it that way; but in fact, the axis object does not know how to apply the delta to the target property, which is why QQuickDragAxis::updateValue takes activeValue and accumulatedValue as separate arguments. The handler has to provide the accumulatedValue, which will end up being the same as the target item's property value. In the case of scale, it's multiplied by the delta, whereas for other properties it's added. The axis doesn't know whether to multiply or add, that's why the handler has to provide the result.
Also, it's more consistent to be able to document minimumValue <= persistentValue <= maximumValue.
The reason this happened is that I started working with PinchHandler.scale and rotation first, with tests in which the Item's starting properties are the defaults (scale 1 and rotation 0). But when we apply the same pattern to DragHandler, tests quickly make it clear that we must not neglect the case when the item's starting property value is different than the default. An item might be in a specific place already before you start dragging it; so persistentTranslation is the delta to be applied, to move it according to how far you dragged, whereas the xAxis and yAxis objects are concerned with enforcing that the position itself is kept between min and max. It's not the delta that is bounded, but the result of applying it.
In fact, PinchHandler also needs autotests that work with items that are already rotated, scaled and/or translated before the pinch starts.
Attachments
Issue Links
- is required for
-
QTBUG-109395 PinchHandler needs to provide translation deltas for non-centered zooming even with weird axis target properties and scaling
- Reported
-
QTBUG-108635 enable PinchHandler to control ease of starting rotation
- Reported
-
QTBUG-68108 QtLocation: start using Pointer Handlers and get rid of the C++ gesture recognition logic
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-109373 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
443788,19 | Set arbitrary target props in QQuickDragAxis with arbitrary scaling | dev | qt/qtdeclarative | Status: NEW | 0 | 0 |
448475,5 | Remove QQuickDragAxis::persistentValue and changed signal for now | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
449486,2 | Remove QQuickDragAxis::persistentValue and changed signal for now | 6.5 | qt/qtdeclarative | Status: MERGED | +2 | 0 |