Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-156

Having "from" in RotationAnimation inside Transition yields "error: Can't convert real value to var"

    XMLWordPrintable

Details

    • Windows
    • 01c83c49, 92a34dfc, 4a27e642, 38fdb5ea

    Description

      doc link : https://doc.qt.io/QtForMCUs-2.4/qml-qtquick-rotationanimation.html

      I'm using Windows host and the Kit is Qt for MCUs 2.4 - Desktop 32bpp(MSVC).

      In the doc above, it has this code snippet in the section of "from" property.

      Item {
          states: [
              // ...
          ]
      
          transition: Transition {
              RotationAnimation { properties: "angle"; from: 100; duration: 2000 }
          }
      } 

      Here, it has RotationAnimation inside Transition and RotationAnimation has "from" property set to 100.

      I tried the same on my Qt Creator. My project has single QML file like this.

      import QtQuick 2.0
      Rectangle {
          id: root
          width: 1000
          height: 1000
          states: State {
              name: "rotated"
              PropertyChanges {target: rotation; angle: 180}
          }
          transitions: Transition {
              RotationAnimation {
                  duration: 1000
                  from: 0 // this seems to be the cause of the error
                  direction: RotationAnimation.Counterclockwise
              }
          }
          Text {
              id: text
              anchors.centerIn: parent
              text: "rotated"
              transform: Rotation {
                  id: rotation
                  angle: 0
                  origin.x: text.width/2
                  origin.y: text.height/2
              }
          MouseArea {
              anchors.fill: parent
              onClicked: {
                  root.state = "rotated"        
              }
          }
      }
       

      When I built this code, I got an error.

      C:/Users/81808/work/Study/Qt/QC_Sandbox/column/column.qml:14:19: error: Can't convert real value to var
                  from: 0 

      Is it a bug?

       

      Attachments

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

        Activity

          People

            k0rahman Karim Abdelrahman
            mikio_hirai Mikio Hirai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes