[solved] 'Unable to assign int to QEasingCurve' even if used property is 'real'
-
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.0Rectangle {
id: myPrivRectangleproperty 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.0Item {
id: itemId
width: 600; height: 500Rectangle { 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 -
Hi,
@NumberAnimation { target: mySpecialRect; properties: "flipped"; to: 90.0; easing: Easing.InQuad}@
The property is easing.type and not easing