44 #ifndef QT_NO_STATEMACHINE 144 errorState(0), initialState(0), childMode(
QState::ExclusiveStates),
145 childStatesListNeedsRefresh(true), transitionsListNeedsRefresh(true)
162 emit q->propertiesAssigned();
201 if (childStatesListNeedsRefresh) {
202 childStatesList.
clear();
206 if (!s || qobject_cast<QHistoryState*>(s))
208 childStatesList.append(s);
210 childStatesListNeedsRefresh =
false;
212 return childStatesList;
229 if (transitionsListNeedsRefresh) {
230 transitionsList.
clear();
235 transitionsList.append(t);
237 transitionsListNeedsRefresh =
false;
239 return transitionsList;
242 #ifndef QT_NO_PROPERTIES 255 qWarning(
"QState::assignProperty: cannot assign property '%s' of null object", name);
258 for (
int i = 0; i <
d->propertyAssignments.size(); ++i) {
268 #endif // QT_NO_PROPERTIES 278 return d->errorState;
291 if (state != 0 && qobject_cast<QStateMachine*>(state)) {
292 qWarning(
"QStateMachine::setErrorState: root state cannot be error state");
295 if (state != 0 && (!state->
machine() || ((state->
machine() !=
machine()) && !qobject_cast<QStateMachine*>(
this)))) {
296 qWarning(
"QState::setErrorState: error state cannot belong " 297 "to a different state machine");
301 d->errorState = state;
312 qWarning(
"QState::addTransition: cannot add null transition");
318 for (
int i = 0; i < targets.
size(); ++i) {
321 qWarning(
"QState::addTransition: cannot add transition to null state");
326 qWarning(
"QState::addTransition: cannot add transition " 327 "to a state in a different state machine");
344 qWarning(
"QState::addTransition: sender cannot be null");
348 qWarning(
"QState::addTransition: signal cannot be null");
352 qWarning(
"QState::addTransition: cannot add transition to null state");
359 qWarning(
"QState::addTransition: no such signal %s::%s",
378 { setTargetState(target); }
380 void onTransition(
QEvent *) {}
381 bool eventTest(
QEvent *) {
return true; }
393 qWarning(
"QState::addTransition: cannot add transition to null state");
396 UnconditionalTransition *trans =
new UnconditionalTransition(target);
411 qWarning(
"QState::removeTransition: cannot remove null transition");
415 qWarning(
"QState::removeTransition: transition %p's source state (%p)" 416 " is different from this state (%p)",
440 return d->transitions();
465 return d->initialState;
476 qWarning(
"QState::setInitialState: ignoring attempt to set initial state " 477 "of parallel state group %p",
this);
481 qWarning(
"QState::setInitialState: state %p is not a child of this state (%p)",
485 d->initialState = state;
513 d->childStatesListNeedsRefresh =
true;
514 d->transitionsListNeedsRefresh =
true;
549 #endif //QT_NO_STATEMACHINE The QVariant class acts like a union for the most common Qt data types.
void onEntry(QEvent *event)
Reimplemented Function
#define QT_END_NAMESPACE
This macro expands to.
QState * parentState() const
Returns this state's parent state, or 0 if the state has no parent state.
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...
void setInitialState(QAbstractState *state)
Sets this state's initial state to be the given state.
#define it(className, varName)
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
QList< QAbstractTransition * > transitions() const
Returns this state's outgoing transitions (i.
T * qobject_cast(QObject *object)
The QObject class is the base class of all Qt objects.
QAbstractState * errorState() const
The QState class provides a general-purpose state for QStateMachine.
void registerTransitions(QAbstractState *state)
void setParent(QObject *)
Makes the object a child of parent.
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
bool event(QEvent *e)
Reimplemented Function
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static QStateMachinePrivate * get(QStateMachine *q)
The QAbstractState class is the base class of states of a QStateMachine.
The QSignalTransition class provides a transition based on a Qt signal.
ChildMode childMode() const
static QAbstractTransitionPrivate * get(QAbstractTransition *q)
const T & at(int i) const
Returns the item at index position i in the list.
void setChildMode(ChildMode mode)
Sets the child mode of this state.
Q_CORE_EXPORT void qWarning(const char *,...)
QList< QAbstractTransition * > transitions() const
void onExit(QEvent *event)
Reimplemented Function
void clear()
Removes all items from the list.
void setTargetState(QAbstractState *target)
Sets the target state of this transition.
ChildMode
This enum specifies how a state's child states are treated.
QStateMachine * machine() const
static QAbstractStatePrivate * get(QAbstractState *q)
The QHistoryState class provides a means of returning to a previously active substate.
QState * sourceState
the source state (parent) of this transition
QList< QHistoryState * > historyStates() const
void removeTransition(QAbstractTransition *transition)
Removes the given transition from this state.
void unregisterTransition(QAbstractTransition *transition)
QList< QWeakPointer< QAbstractState > > targetStates
QList< QAbstractState * > childStates() 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
const QObjectList & children() const
Returns a list of child objects.
return(isPopup||isToolTip)
void emitPropertiesAssigned()
~QState()
Destroys this state.
void assignProperty(QObject *object, const char *name, const QVariant &value)
Instructs this state to set the property with the given name of the given object to the given value w...
QAbstractState * initialState() const
QState(QState *parent=0)
Constructs a new state with the given parent state.
void addTransition(QAbstractTransition *transition)
Adds the given transition.
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
void setErrorState(QAbstractState *state)
Sets this state's error state to be the given state.
The QList class is a template class that provides lists.
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...