The following example comes from the docs for Flippable:

import Qt 4.7

Flipable {
id: flipable
width: 240
height: 240

property int angle: 0
property bool flipped: false

front: Image { source: "front.png" }
back: Image { source: "back.png" }

transform: Rotation {
origin.x: flipable.width/2; origin.y: flipable.height/2
axis.x: 0; axis.y: 1; axis.z: 0 // rotate around y-axis
angle: flipable.angle
}

states: State {
name: "back"
PropertyChanges { target: flipable; angle: 180 }
when: flipable.flipped
}

transitions: Transition {
NumberAnimation { properties: "angle"; duration: 1000 }
}

MouseArea {
anchors.fill: parent
onClicked: flipable.flipped = !flipable.flipped
}
}

There are a couple of things I don't follow:

1) The item enters the "back" state when flipped is true,
but I can't see anything that should occur when flipped is
false. However, the example performs a flip on every mouse
click, and each mouse click toggles flipped between true and false.

2) Where does the NumberAnimation get its to and from properties ?
The docs mention that it uses the "value set in the start state
of the transition", but it's not clear to me what that means here.

Can anyone explain ?

-- 
Stephen Collyer
_______________________________________________
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to