[Qt-qml] Flippable example: some questions

Eduardo Fleury eduardo.fleury at openbossa.org
Thu Aug 5 00:43:55 CEST 2010


Hi there

I think you are missing a concept regarding how states work in QtQuick.

Every item has an implicit state called "". By default every item starts in
that state with the initial properties set. With that in mind, the following
makes more sense.


On Wed, Aug 4, 2010 at 1:17 PM, Stephen Collyer
<scollyer at netspinner.co.uk>wrote:

>
> 1) The item enters the "back" state when flipped is true,
> but I can't see anything that should occur when flipped is
> false.


Well, when "flipped" is false, the "when" condition for the "back" state
becomes false.
If the Item can no longer be in the "back" state, then it has to return to
its previous state, which is "".

By going into the "" state, all properties that were changed are then
restored. In this case "flippable.angle" goes back to 0 and you see the face
of the item again.



> 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 ?
>
>
The idea is, if you are in a transition between the state "" and the state
"back", then what is happening with the property "angle"? Well, it is going
from "0" to "180". Then, do you have an Animation for that property? Yes, so
these values (0 and 180) are filled in it as "to" and "from". The opposite
happens in the transition from "back" to "".


BR,

-- 
Eduardo M. Fleury
OpenBossa - INdT
http://eduardofleury.com/
http://www.openbossa.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100804/0a54bffc/attachment.html 


More information about the Qt-qml mailing list