![]() |
Home |
The QtTransition class describes transitions between QtStates. More...
#include <QtTransition>
This class is under development and is subject to change.
Inherits QtAnimationGroup.
This class was introduced in qtanimationframework 4.5.
The QtTransition class describes transitions between QtStates.
QtTransition is a special animation group that describes how certain properties of objects should change as one state is activated or deactivated, or when switching between states. The API is quite simple; in addition to QtAnimationGroup's API, it adds only two properties: fromState, and toState, of which both can be 0 (indicating "any state"). Combining the two properties will allow you to choose between four contexts for this transition:
To define a transition, you start by constructing a QtTransition object, passing a pointer to the fromState and toState to QtTransition's constructor. Then add animations to the transition just like you would add animations to any animation group. What's different from QtAnimationGroup is that you usually do not specifiy neither start nor target values for the animations, as these are automatically initialized from the states you are transitioning from and to.
The transition is managed by QtState. As you enter a state, QtState will initialize and activate all transitions that apply to the activated and deactivated states. The initialization step is what makes QtTransition a special class: before the transition is started, all animations whose target objects and properties are defined in fromState and toState are initialized with the respective start and target values. The first animation in this transition for any object and property is initialized with the property values from fromState (or with the object's current property value if fromState is either 0, or if fromState does not define any property value for that object). The last animation that defines properties for objects are initialized with the target value from toState, or with the implicit default values from the state that was left if toState does not define properties for the particular object.
This allows QtTransition to define arbitrarily complex transitions for all properties between states, including sequential transitions where properties change from a implicit start value, to a sequence of defined values, and finally an implicit target value.
See also QtState, QtAnimation, and The Animation Framework.
This property holds the from-state for the transition.
This property describes the transition's from-state, or starting state. This state will initialize all the transition's animations whose start values are undefined.
QtTransition does not take ownership of the state.
Access functions:
See also toState.
This property holds the to-state for the transition.
This property describes the transition's to-state, or target state. This state will initialize all the transition's animations whose target values are undefined.
QtTransition does not take ownership of the state.
Access functions:
See also fromState.
Constructs a QtTransition instance. parent is passed to QtAnimationGroup's constructor. QtTransition is a parallel animation group.
The properties fromState and toState will be set to 0, causing the transition to activate when leaving from any state, and entering any state.
Constructs a QtTransition instance between fromState and toState. parent is passed to QtAnimationGroup's constructor. QtTransition is a parallel animation group.
If fromState is 0, the transition will activate when entering toState from any state. Similarily, if toState is 0, the transition will activate when leaving fromState, and entering any state.
Destroys the transition.
Copyright © 2008 Nokia | Trademarks | Qt Solutions |