[Qt-qml] Flippable example: some questions

Stephen Collyer scollyer at netspinner.co.uk
Thu Aug 5 16:54:19 CEST 2010


On 4 August 2010 23:43, Eduardo Fleury <eduardo.fleury at openbossa.org> 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 "".
>
> OK, I see what's going on now. But is this documented ? I can't find
anything in the docs that decribe this behaviour of returning to the
previous state (or does it, in fact, return to the default state, if it has
no
more specific state ?)


> 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 "".
>
> Right. So, in this case, the Transition is given its start and end states,
and
passes the start and end properties to the NumberAnimation, which uses
the appropriate item property (here, "angle") to set its own "to" and "from"
properties.

Thanks a lot, I think that's clearer now.

-- 
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100805/46cddbe3/attachment.html 


More information about the Qt-qml mailing list