Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-111220

PinchHandler.persistentTranslation has inconsistent meaning with native pinch gesture

    XMLWordPrintable

Details

    • 07aaa7c1b (dev), 79b83a188 (6.5)

    Description

      The docs say:

      activeTranslation : QPointF

      The translation of the cluster of points while the pinch gesture is being performed. It is 0, 0 when the gesture begins, and increases as the eventPoint(s) are dragged downward and to the right. After the gesture ends, it stays the same; and when the next pinch gesture begins, it is reset to 0, 0 again.

      persistentTranslation : QPointF

      The translation to be applied to the target if it is not null. Otherwise, bindings can be used to do arbitrary things with this value. While the pinch gesture is being performed, activeTranslation is continuously added to it; after the gesture ends, it stays the same.

      It's possible to set this property, as a way of synchronizing the basis translation with a translation that was set in some other way, for example by another handler. If you set this property directly, activeTranslation does not change, and translationChanged(0, 0) is emitted.

      note On some touchpads, such as on a macOS trackpad, native gestures do not generate any translation values, and this property stays at 0, 0.

      But while writing a native-gesture autotest, it seems rather that persistentTranslation is the same as the target item position. It's not the delta by which QQuickItemPrivate::adjustedPosForTransform() moved it, and it doesn't stay at 0, 0 either.

      On an Apple trackpad on macOS, the native gesture event does not tell us that the "cluster of points" moves during the pinch (and this agrees with the fact that the mouse cursor does not move); so it seems correct that activeTranslation stays at 0, 0 (as it currently does). But we can also test on other OSes, in case the gesture and the cursor are actually seen to move.

      Anyway we need better test coverage for these properties, both with native gestures and touchpoint-handling cases.

      And the meaning of these properies should be consistent between PinchHandler and DragHandler.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              srutledg Shawn Rutledge
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: