![]() |
Qt 4.8
|
The Flipable item provides a surface that can be flipped. More...
The Flipable item provides a surface that can be flipped.
Flipable is an item that can be visibly "flipped" between its front and back sides, like a card. It is used together with Rotation , State and Transition elements to produce a flipping effect.
The front and back properties are used to hold the items that are shown respectively on the front and back sides of the flipable item.
The following example shows a Flipable item that flips whenever it is clicked, rotating about the y-axis.
This flipable item has a flipped
boolean property that is toggled whenever the MouseArea within the flipable is clicked. When flipped
is true, the item changes to the "back" state; in this state, the angle
of the Rotation item is changed to 180 degrees to produce the flipping effect. When flipped
is false, the item reverts to the default state, in which the angle
value is 0.
The Transition creates the animation that changes the angle over four seconds. When the item changes between its "back" and default states, the NumberAnimation animates the angle between its old and new values.
See QML States for details on state changes and the default state, and QML Animation and Transitions for more information on how animations work within transitions.