Transition animation not working
-
Hello,
So I'm making a menu and trying to pop a menu item up on a degree of 74 when selected.
However, it moves the image but without the animation..
Can you please take a look what went wrong?
@ StateGroup {
id: stateGroup
states: [
State {
name: "State0"
PropertyChanges {target: iNav; x: 14; y: -50 }
},
State {
name: "State1"
PropertyChanges {target: iMM; x: 163; y: -50 }
},
State {
name: "State2"
PropertyChanges {target: iInfo; x: 311; y: -50}
},
State {
name: "State3"
PropertyChanges {target: iBT; x: 460; y: -50;}
},
State {
name: "State4"
PropertyChanges {target: iWeb; x: 608; y: -50;}
}
]
transitions: [
Transition {
from: ""; to: "State0"
PropertyAnimation {target: iNav; duration: 2000; easing.type: Easing.InQuad }
},
Transition {
from: ""; to: "State1"
PropertyAnimation {target: iMM; duration: 2000; easing.type: Easing.InQuad }
},
Transition {
from: ""; to: "State2"
PropertyAnimation {target: iInfo; duration: 2000; easing.type: Easing.InQuad }
},
Transition {
from: ""; to: "State3"
PropertyAnimation {target: iBT; duration: 2000; easing.type: Easing.InQuad }
},
Transition {
from: "*"; to: "State4"
PropertyAnimation {target: iWeb; duration: 2000; easing.type: Easing.InQuad }
}
]
}@ -
mmh, perhaps there's a problem cause you forget the target property..no?
ex
@ properties: "opacity";
from: 0.99;
to: 1.0@ -
For every animation you need to tell which which property you would like animate. If you want the animation to triggered by default, you can Behaviour on <x> {}
e.g@Rectangle {
id: rect
width: 100; height: 100
color: "red"Behavior on x { NumberAnimation { duration: 1000 } } MouseArea { anchors.fill: parent onClicked: rect.width = 50 }
}@