44 #ifndef QT_NO_STATEMACHINE 143 return q->eventTest(e);
194 return d->sourceState();
204 if (
d->targetStates.isEmpty())
206 return d->targetStates.first().data();
216 d->targetStates.clear();
229 for (
int i = 0; i <
d->targetStates.size(); ++i) {
244 for (
int i = 0; i < targets.
size(); ++i) {
247 qWarning(
"QAbstractTransition::setTargetStates: target state(s) cannot be null");
252 d->targetStates.clear();
253 for (
int i = 0; i < targets.
size(); ++i)
254 d->targetStates.append(targets.
at(i));
267 #ifndef QT_NO_ANIMATION 279 qWarning(
"QAbstractTransition::addAnimation: cannot add null animation");
282 d->animations.append(animation);
294 qWarning(
"QAbstractTransition::removeAnimation: cannot remove null animation");
297 d->animations.removeOne(animation);
309 return d->animations;
350 #endif //QT_NO_STATEMACHINE T qobject_cast(QObject *object)
void addAnimation(QAbstractAnimation *animation)
Adds the given animation to this transition.
#define QT_END_NAMESPACE
This macro expands to.
QStateMachine * machine() const
Returns the state machine that this state is part of, or 0 if the state is not part of a state machin...
The QAbstractTransition class is the base class of transitions between QAbstractState objects...
The QStateMachine class provides a hierarchical finite state machine.
QState * sourceState() const
QAbstractTransitionPrivate()
The QObject class is the base class of all Qt objects.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
The QState class provides a general-purpose state for QStateMachine.
QList< QAbstractState * > targetStates() const
QList< QAbstractAnimation * > animations() const
Returns the list of animations associated with this transition, or an empty list if it has no animati...
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QAbstractState class is the base class of states of a QStateMachine.
static QAbstractTransitionPrivate * get(QAbstractTransition *q)
const T & at(int i) const
Returns the item at index position i in the list.
Q_CORE_EXPORT void qWarning(const char *,...)
QState * sourceState() const
The QAbstractAnimation class is the base of all animations.
void setTargetState(QAbstractState *target)
Sets the target state of this transition.
virtual void callOnTransition(QEvent *e)
QAbstractTransition(QState *sourceState=0)
Constructs a new QAbstractTransition object with the given sourceState.
virtual ~QAbstractTransition()
Destroys this transition.
QStateMachine * machine() const
QAbstractState * targetState() const
QObject * parent() const
Returns a pointer to the parent object.
int size() const
Returns the number of items in the list.
bool event(QEvent *e)
Reimplemented Function
void removeAnimation(QAbstractAnimation *animation)
Removes the given animation from this transition.
bool callEventTest(QEvent *e)
QStateMachine * machine() const
Returns the state machine that this transition is part of, or 0 if the transition is not part of a st...
The QEvent class is the base class of all event classes.
void setTargetStates(const QList< QAbstractState *> &targets)
Sets the target states of this transition to be the given targets.
The QList class is a template class that provides lists.