[Development] Toolability of mixing QML and JS

Thomas Hartmann Thomas.Hartmann at digia.com
Fri Jun 28 11:36:34 CEST 2013


Hi,

Am 28/06/2013 09:59, schrieb Alan Alpert:
> So I like the idea, but definitely on States and not Transitions
> (these Triggers have nothing to do with how a State change is
> animated).  If someone wanted to pick this up and implement something,
> I bet it could make Qt 5.2 ;) .

Maybe I find the time to do at least a prototype.


>> Another feature that I needed sometimes (independent from tooling) was a
>> state that automatically changes into another state (for animations).
>>
>> Something like:
>>
>> State {
>>      name: "someState"
>>      nextState: "someOtherState"
>> }
>
> How is this supposed to work? That as soon as you reach state A, you
> immediately go to state B, just to apply the X->A->B transitions in
> sequence?
>
> Couldn't that be better done with an X->B transition which looks like
> Transition {
>      SequentialAnimation { id: xToB; animations: [ xToA, aToB] }
> }

If I remember correctly I had two use cases.

(1) Many animations have some kind of peak (Or even several peaks). And 
if the peak is a formal state it can be edited using the designer.
This really helps with tooling, because key frames in animations are 
defined as normal states in this cases. Triggering the transition to the 
next "animation state" requires currently a ScriptAction which works, 
but is not declarative.

(2) It sometimes helps with the logic of animations.

Imagine you have to states A and B and add the animation state A_B 
explicitly as state.

Now instead of going directly from A to B you enter A_B or if different 
B_A.

The animations are defined in the transition from A to A_B and B to B_A, 
while A_B to B and B_A to A are not animated.

Now B_A and A_B define the fact that the ui is animated and whenever the 
ui is fixed we are in either A or B.

Now we can turn on/off effects in B_A and A_B or "disable" items during 
animation, easily.

We can also skip animations (if required) by going directly from A to B 
or B to A.

You of course get the same by using ScriptActions and setting a flag, 
but this also adds another state, which just is implicit in this case.

In short these "epsilon" transitions allow to structure animations using 
intermediate states.

Kind Regards,
Thomas Hartmann





More information about the Development mailing list