![]() |
Home |
The QtState class describes a state with connections and properties for QObjects, QWidgets and QGraphicsItems. More...
#include <QtState>
This class is under development and is subject to change.
Inherits QObject.
This class was introduced in qtanimationframework 4.5.
The QtState class describes a state with connections and properties for QObjects, QWidgets and QGraphicsItems.
This class is part of {The Animation Framework}.
QtState provides a convenient API for configuring properties, connections and other features related to state changes in your application. When used together with QtTransition, it also allows you to define how these values change, possibly using animations over time.
States can be independent, or part of a group of mutually exclusive states (i.e., only one state in a group can be active at any time). You can activate or deactivate a state by calling the setActive(), activate() or deactivate() slots. When the state is activated, it configures all properties and connections for that state, and it also calls the virtual enterState() and leaveState() functions, which you can reimplement in a subclass of QtState to provide custom state change logic. QtState also emits the activated() and deactivated() signals, so that you can define custom state logic in a connected slot.
See also QtTransition, QtAnimation, and The Animation Framework.
This property holds whether or not the state is active.
This property describes whether this state is active or not. You can activate a state by passing true to setActive(), or by calling activate(). A state can also become active if it's the default state of a QtStateGroup, and another state in the group is deactivated.
To deactivate a group, you can either pass false to setActive(), or call deactivate().
When a state is activated, it emits the activated() signal, and calls the virtual enterState() function. When it loses activation, it emits the deactivated() signal, and calls the virtual leaveState() function. The default implementations of enterState() and leaveState() manage the properties and connections defined for this state.
Access functions:
See also activate() and deactivate().
This property holds the state's group.
This property describes the QtStateGroup that the state belongs to. If the state is not part of a group (i.e., an independent state), the group() function will return 0.
Access functions:
This property holds whether the state should restore previous property values when deactivated.
If restoreProperties is true, the state will store the current value of all properties it changes as the state is activated, and restore these values when the state is deactivated again. By default this value is true.
Access functions:
Constructs a QtState object. parent is passed to QObject's constructor.
Destroys the QtState object.
This function is equivalent to calling setActive(true).
See also deactivate() and active.
QtState emits this signal when the state is either activated or deactivated. If active is true, the state is activated; otherwise, it is deactivated.
See also deactivated() and setActive().
This is an overloaded member function, provided for convenience.
QtState emits this signal when the state is activated.
See also deactivated() and setActive().
Deactivates and clears the state, removing all connections and property values for all objects and items. This function has no effect on the state's group membership, its active state and any defined transitions.
If the state is active and has defined property values, these properties will also be unset in the target objects and items.
See also deactivate().
This function is equivalent to calling setActive(false).
See also activate() and active.
QtState emits this signal when the state is deactivated.
See also activated() and setActive().
This virtual function is called when this state is activated. fromState is the previous state. If there was no previous state, fromState is 0.
The default implementation manages the properties and connections for this state.
See also leaveState().
Returns the geometry for widget when this state is active.
See also setGeometry().
This is an overloaded member function, provided for convenience.
Returns the geometry for widget when this state is active.
See also setGeometry().
This virtual function is called by QtState when the state is deactivated. toState is a pointer to the next state. If there is no next state, toState is 0.
The default implementation manages the properties and connections for this state.
See also enterState().
Returns the opacity for item when this state is active.
See also setOpacity().
Returns the position for item when this state is active.
See also setPos().
This is an overloaded member function, provided for convenience.
Returns the position for widget when this state is active.
See also setPos().
Returns the value that the property propertyName should have for object when this state is active.
See also setProperty() and unsetProperty().
This is an overloaded member function, provided for convenience.
Returns the value that the property propertyName should have for item when this state is active.
See also setProperty() and unsetProperty().
Instructs the state to establish a connection from sender and signal to receiver and member, using connectionType, when this state is activated.
See also unsetConnectionState().
Instructs the state to set the geometry of widget to geom when activated.
See also geometry().
This is an overloaded member function, provided for convenience.
Instructs the state to set the geometry of widget to geom when activated.
See also geometry().
Instructs the state to set the opacity of item to opacity when this state is activated.
See also opacity().
Instructs the state to set the position of item to pos when activated.
See also pos().
This is an overloaded member function, provided for convenience.
Instructs the state to set the position of widget to pos when activated.
See also pos().
Instructs the state to set the property propertyName to value on object when activated.
See also property() and unsetProperty().
This is an overloaded member function, provided for convenience.
Instructs the state to set the property propertyName to value on item when activated.
Although QGraphicsItem doesn't technically support properties like QObject does, this function emulates the behavior for all property-like functions in QGraphicsItem, allowing you as a user to treat the two the same way.
See also property() and unsetProperty().
Removes the connection from sender and signal to receiver and member for this state.
See also setConnectionState().
Removes the value of the property propertyName for object for this state. When activated, this state will no longer affect the property.
See also setProperty() and property().
This is an overloaded member function, provided for convenience.
Removes the value of the property propertyName for item for this state. When activated, this state will no longer affect the property.
See also setProperty() and property().
Copyright © 2008 Nokia | Trademarks | Qt Solutions |