Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QAbstractTransition Class

TheQAbstractTransition class is the base class of transitions betweenQAbstractState objects.More...

Header:#include <QAbstractTransition>
Since: Qt 4.6
Inherits:QObject
Inherited By:

QEventTransition andQSignalTransition

Properties

Public Functions

QAbstractTransition(QState * sourceState = 0)
virtual~QAbstractTransition()
voidaddAnimation(QAbstractAnimation * animation)
QList<QAbstractAnimation *>animations() const
QStateMachine *machine() const
voidremoveAnimation(QAbstractAnimation * animation)
voidsetTargetState(QAbstractState * target)
voidsetTargetStates(const QList<QAbstractState *> & targets)
QState *sourceState() const
QAbstractState *targetState() const
QList<QAbstractState *>targetStates() const
  • 29 public functions inherited fromQObject

Signals

voidtriggered()

Protected Functions

virtual booleventTest(QEvent * event) = 0
virtual voidonTransition(QEvent * event) = 0

Reimplemented Protected Functions

virtual boolevent(QEvent * e)
  • 8 protected functions inherited fromQObject

Additional Inherited Members

  • 1 public slot inherited fromQObject
  • 7 static public members inherited fromQObject

Detailed Description

TheQAbstractTransition class is the base class of transitions betweenQAbstractState objects.

TheQAbstractTransition class is the abstract base class of transitions between states (QAbstractState objects) of aQStateMachine.QAbstractTransition is part ofThe State Machine Framework.

ThesourceState() function returns the source of the transition. ThetargetStates() function returns the targets of the transition. Themachine() function returns the state machine that the transition is part of.

Thetriggered() signal is emitted when the transition has been triggered.

Transitions can cause animations to be played. Use theaddAnimation() function to add an animation to the transition.

Subclassing

TheeventTest() function is called by the state machine to determine whether an event should trigger the transition. In your reimplementation you typically check the event type and cast the event object to the proper type, and check that one or more properties of the event meet your criteria.

TheonTransition() function is called when the transition is triggered; reimplement this function to perform custom processing for the transition.

Property Documentation

sourceState :QState * const

This property holds the source state (parent) of this transition.

Access functions:

QState *sourceState() const

targetState :QAbstractState *

This property holds the target state of this transition.

If a transition has no target state, the transition may still be triggered, but this will not cause the state machine's configuration to change (i.e. the current state will not be exited and re-entered).

Access functions:

QAbstractState *targetState() const
voidsetTargetState(QAbstractState * target)

targetStates :QList<QAbstractState *>

This property holds the target states of this transition.

If multiple states are specified, all must be descendants of the same parallel group state.

Access functions:

QList<QAbstractState *>targetStates() const
voidsetTargetStates(const QList<QAbstractState *> & targets)

Member Function Documentation

QAbstractTransition::QAbstractTransition(QState * sourceState = 0)

Constructs a newQAbstractTransition object with the givensourceState.

[virtual]QAbstractTransition::~QAbstractTransition()

Destroys this transition.

void QAbstractTransition::addAnimation(QAbstractAnimation * animation)

Adds the givenanimation to this transition. The transition does not take ownership of the animation.

See alsoremoveAnimation() andanimations().

QList<QAbstractAnimation *> QAbstractTransition::animations() const

Returns the list of animations associated with this transition, or an empty list if it has no animations.

See alsoaddAnimation().

[virtual protected]bool QAbstractTransition::event(QEvent * e)

Reimplemented fromQObject::event().

[pure virtual protected]bool QAbstractTransition::eventTest(QEvent * event)

This function is called to determine whether the givenevent should cause this transition to trigger. Reimplement this function and return true if the event should trigger the transition, otherwise return false.

QStateMachine * QAbstractTransition::machine() const

Returns the state machine that this transition is part of, or 0 if the transition is not part of a state machine.

[pure virtual protected]void QAbstractTransition::onTransition(QEvent * event)

This function is called when the transition is triggered. The givenevent is what caused the transition to trigger. Reimplement this function to perform custom processing when the transition is triggered.

void QAbstractTransition::removeAnimation(QAbstractAnimation * animation)

Removes the givenanimation from this transition.

See alsoaddAnimation().

[signal]void QAbstractTransition::triggered()

This signal is emitted when the transition has been triggered (afteronTransition() has been called).

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp