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

transformOriginPoint not set correctly

XMLWordPrintable

    • 06ef198e0812b514c261ef8f7c82db754450f1fa, 7fb140b63f03b96064ded4ec6f2ec7c93e87b825

      The first time you set the transformOriginPoint of an item, the setting is ignored.
      In the example below - click the "Set rotation" button. The red square is rotated about the centre point, even though the transform origin is set to 10, 10. Click "Reset" then do it again. This time the correct origin is used.

      iimport Qt 4.7

      Rectangle {
      width: 400
      height: 400

      Rectangle

      { id: fred x: 100 y: 100 width: 200 height: 200 color: "red" }

      Rectangle {
      y: 270
      width: 100
      height: 30
      color: "grey"
      Text

      { text: "Set rotation" }

      MouseArea {
      anchors.fill: parent
      onClicked:

      { fred.transformOriginPoint = Qt.point (10, 10); fred.rotation = 45; }

      }

      }

      Rectangle {
      y: 310
      width: 100
      height: 30
      color: "grey"
      Text

      { text: "Reset" }

      MouseArea {
      anchors.fill: parent
      onClicked:

      { fred.rotation = 0; }

      }

      }

      }

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

            martjone Martin Jones (closed Nokia identity) (Inactive)
            clivewhitear Clive Whitear
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes