summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/statemachine/qstate_p.h1
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp7
2 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/statemachine/qstate_p.h b/src/corelib/statemachine/qstate_p.h
index 9558bd88a5..5999aca140 100644
--- a/src/corelib/statemachine/qstate_p.h
+++ b/src/corelib/statemachine/qstate_p.h
@@ -72,6 +72,7 @@ struct QPropertyAssignment
{}
bool objectDeleted() const { return !object; }
+ void write() const { Q_ASSERT(object != 0); object->setProperty(propertyName, value); }
QPointer<QObject> object;
QByteArray propertyName;
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 24da4e6937..ec93bb1b2d 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -751,7 +751,7 @@ void QStateMachinePrivate::applyProperties(const QList<QAbstractTransition*> &tr
}
}
if (!found) {
- assn.object->setProperty(assn.propertyName, assn.value);
+ assn.write();
}
}
}
@@ -840,7 +840,7 @@ void QStateMachinePrivate::applyProperties(const QList<QAbstractTransition*> &tr
const QList<QPropertyAssignment> &assignments = it.value();
for (int i = 0; i < assignments.size(); ++i) {
const QPropertyAssignment &assn = assignments.at(i);
- assn.object->setProperty(assn.propertyName, assn.value);
+ assn.write();
}
}
}
@@ -1133,8 +1133,7 @@ void QStateMachinePrivate::_q_animationFinished()
#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);
+ assn.write();
if (!assn.explicitlySet)
unregisterRestorable(assn.object, assn.propertyName);
#endif