Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [solved] 'Unable to assign int to QEasingCurve' even if used property is 'real'

[solved] 'Unable to assign int to QEasingCurve' even if used property is 'real'

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 4.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    guziemic
    wrote on last edited by
    #1

    Hi,

    I have problem with assignment of property during animation of custom element. During runtime of program I obtain such error

    @
    RectAnim.qml:31: Unable to assign int to QEasingCurve
    RectAnim.qml:32: Unable to assign int to QEasingCurve
    RectAnim.qml:39: Unable to assign int to QEasingCurve
    RectAnim.qml:40: Unable to assign int to QEasingCurve
    @

    I created simple custom object MyRectangle.qml and within it I set property alias to transformation. And property angle in Rotation is of type real, so should works correctly.
    @
    import QtQuick 2.0

    Rectangle {
    id: myPrivRectangle

    property alias flipped: rot2.angle
    
    transform: Rotation { id: rot2; axis { x: 1; y: 0; z: 0 } origin { y: height/2 } }
    

    }
    @

    My code of RectAnim.qml is below. I think that I do not make there any kind of magic. Just number animation with specified Easing type. I have there also second rectangle with mouse area which I am using to trigger state change.
    @
    import QtQuick 2.0

    Item {
    id: itemId
    width: 600; height: 500

    Rectangle {
        width: 20; height: 20; color: "green"
        MouseArea {
            anchors.fill: parent
            onClicked: {
                itemId.state = "rotated" ; someTimer.start();
            }
        }
    }
    
    MyRectangle {
        id: mySpecialRect
        width: 150; height: 100; anchors.left: parent.left;
        anchors.centerIn: parent
        color: "gray"
        flipped: 180.0
        Text { text: "Something" }
    }
    
    transitions: [
        Transition {
            from: ""; to: "rotated"
            SequentialAnimation {
    
                NumberAnimation { target: mySpecialRect; properties: "flipped"; to: 90.0; easing: Easing.InQuad}
                NumberAnimation { target: mySpecialRect; properties: "flipped"; to: 0.0;  easing: Easing.OutQuad}
            }
        },
        Transition {
            from: "rotated"; to: ""
            SequentialAnimation {
    
                NumberAnimation { target: mySpecialRect; properties: "flipped"; to: 90.0; easing: Easing.InQuad}
                NumberAnimation { target: mySpecialRect; properties: "flipped"; to: 180.0; easing: Easing.OutQuad}
            }
        }
    ]
    
    Timer {
        id: someTimer; interval: 6000
        onTriggered: {
            itemId.state = "";
        }
    }
    

    }
    @

    Does anyone has some idea what could be root cause of this problem or some hint how to solve it?

    Best regards,
    guziemic

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      @NumberAnimation { target: mySpecialRect; properties: "flipped"; to: 90.0; easing: Easing.InQuad}@

      The property is easing.type and not easing

      157

      1 Reply Last reply
      2
      • G Offline
        G Offline
        guziemic
        wrote on last edited by
        #3

        Hi,

        Thank for catch. My fault, I did not notice it.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved