From 588f8daeb52cfea461cbcb8c128de5997ab5a6cf Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 23 Jul 2009 12:41:52 +0200 Subject: make statemachine compile with QT_NO_PROPERTIES --- src/corelib/statemachine/qstate.cpp | 4 ++++ src/corelib/statemachine/qstate.h | 2 ++ src/corelib/statemachine/qstatemachine.cpp | 14 ++++++++++++++ src/corelib/statemachine/qstatemachine_p.h | 2 ++ 4 files changed, 22 insertions(+) diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp index f74edc3..2042288 100644 --- a/src/corelib/statemachine/qstate.cpp +++ b/src/corelib/statemachine/qstate.cpp @@ -215,6 +215,8 @@ QList QStatePrivate::transitions() const return result; } +#ifndef QT_NO_PROPERTIES + /*! Instructs this state to set the property with the given \a name of the given \a object to the given \a value when the state is entered. @@ -239,6 +241,8 @@ void QState::assignProperty(QObject *object, const char *name, d->propertyAssignments.append(QPropertyAssignment(object, name, value)); } +#endif // QT_NO_PROPERTIES + /*! Returns this state's error state. diff --git a/src/corelib/statemachine/qstate.h b/src/corelib/statemachine/qstate.h index 41d32be..ce88b25 100644 --- a/src/corelib/statemachine/qstate.h +++ b/src/corelib/statemachine/qstate.h @@ -87,8 +87,10 @@ public: ChildMode childMode() const; void setChildMode(ChildMode mode); +#ifndef QT_NO_PROPERTIES void assignProperty(QObject *object, const char *name, const QVariant &value); +#endif Q_SIGNALS: void finished(); diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 5402b04..a02480b 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -395,7 +395,9 @@ void QStateMachinePrivate::microstep(QEvent *event, const QList enteredStates = enterStates(event, enabledTransitions); +#ifndef QT_NO_PROPERTIES applyProperties(enabledTransitions, exitedStates, enteredStates); +#endif #ifdef QSTATEMACHINE_DEBUG qDebug() << q_func() << ": configuration after entering states:" << configuration; qDebug() << q_func() << ": end microstep"; @@ -666,6 +668,8 @@ void QStateMachinePrivate::addStatesToEnter(QAbstractState *s, QState *root, } } +#ifndef QT_NO_PROPERTIES + void QStateMachinePrivate::applyProperties(const QList &transitionList, const QList &exitedStates, const QList &enteredStates) @@ -853,6 +857,8 @@ void QStateMachinePrivate::applyProperties(const QList &tr } } +#endif // QT_NO_PROPERTIES + bool QStateMachinePrivate::isFinal(const QAbstractState *s) { return qobject_cast(s) != 0; @@ -932,6 +938,8 @@ bool QStateMachinePrivate::isInFinalState(QAbstractState* s) const return false; } +#ifndef QT_NO_PROPERTIES + void QStateMachinePrivate::registerRestorable(QObject *object, const QByteArray &propertyName) { RestorableId id(object, propertyName); @@ -976,6 +984,8 @@ void QStateMachinePrivate::unregisterRestorable(QObject *object, const QByteArra registeredRestorables.remove(id); } +#endif // QT_NO_PROPERTIES + QAbstractState *QStateMachinePrivate::findErrorState(QAbstractState *context) { // Find error state recursively in parent hierarchy if not set explicitly for context state @@ -1088,12 +1098,14 @@ void QStateMachinePrivate::_q_animationFinished() resetAnimationEndValues.remove(anim); } +#ifndef QT_NO_PROPERTIES // Set the final property value. QPropertyAssignment assn = propertyForAnimation.take(anim); Q_ASSERT(assn.object != 0); assn.object->setProperty(assn.propertyName, assn.value); if (!assn.explicitlySet) unregisterRestorable(assn.object, assn.propertyName); +#endif QAbstractState *state = stateForAnimation.take(anim); Q_ASSERT(state != 0); @@ -1161,8 +1173,10 @@ void QStateMachinePrivate::_q_start() QEvent nullEvent(QEvent::None); executeTransitionContent(&nullEvent, transitions); QList enteredStates = enterStates(&nullEvent, transitions); +#ifndef QT_NO_PROPERTIES applyProperties(transitions, QList() << start, enteredStates); +#endif delete start; #ifdef QSTATEMACHINE_DEBUG diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h index 21e405d..cae21aa 100644 --- a/src/corelib/statemachine/qstatemachine_p.h +++ b/src/corelib/statemachine/qstatemachine_p.h @@ -151,6 +151,7 @@ public: void **args); void scheduleProcess(); +#ifndef QT_NO_PROPERTIES typedef QPair RestorableId; QHash registeredRestorables; void registerRestorable(QObject *object, const QByteArray &propertyName); @@ -158,6 +159,7 @@ public: bool hasRestorable(QObject *object, const QByteArray &propertyName) const; QVariant restorableValue(QObject *object, const QByteArray &propertyName) const; QList restorablesToPropertyList(const QHash &restorables) const; +#endif State state; bool processing; -- cgit v0.12