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

Properties of PinchHandler's centroid are all empty

    XMLWordPrintable

Details

    • macOS
    • c4c27857e0de964a57ae2b919a045f3a82206f56 (qt/qtdeclarative/5.12)

    Description

      I'm trying to get the centre of the pinch but regardless of whether a target is set on the handler or not, the values are always zero:

      import QtQuick 2.12
      import QtQuick.Window 2.2
      
      Window {
          id: window
          objectName: "window"
          width: 600
          height: 800
          visible: true
      
          Rectangle {
              id: rect
              anchors.fill: parent
              color: "blue"
      
              PinchHandler {
                  id: handler
                  target: null//rect
                  onScaleChanged: {
                      print(scale, centroid.position, centroid.pressPosition, centroid.sceneGrabPosition, centroid.scenePosition, centroid.scenePressPosition)
                  }
              }
          }
      }
      

      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
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes