diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp index 39651b9736..27cec1d87e 100644 --- a/src/corelib/statemachine/qstate.cpp +++ b/src/corelib/statemachine/qstate.cpp @@ -242,7 +242,7 @@ void QState::assignProperty(QObject *object, const char *name, } for (int i = 0; i < d->propertyAssignments.size(); ++i) { QPropertyAssignment &assn = d->propertyAssignments[i]; - if ((assn.object == object) && (assn.propertyName == name)) { + if (assn.hasTarget(object, name)) { assn.value = value; return; } diff --git a/src/corelib/statemachine/qstate_p.h b/src/corelib/statemachine/qstate_p.h index 8b15f05ada..2c8141dbac 100644 --- a/src/corelib/statemachine/qstate_p.h +++ b/src/corelib/statemachine/qstate_p.h @@ -75,6 +75,8 @@ struct QPropertyAssignment bool objectDeleted() const { return !object; } void write() const { Q_ASSERT(object != 0); object->setProperty(propertyName, value); } + bool hasTarget(QObject *o, const QByteArray &pn) const + { return object == o && propertyName == pn; } QPointer object; QByteArray propertyName; diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index e53d86a134..276e3f603f 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -743,8 +743,7 @@ void QStateMachinePrivate::applyProperties(const QList &tr for (it = propertyAssignmentsForState.constBegin(); it != propertyAssignmentsForState.constEnd(); ++it) { const QList &assignments = it.value(); for (int k = 0; k < assignments.size(); ++k) { - if ((assignments.at(k).object == assn.object) - && (assignments.at(k).propertyName == assn.propertyName)) { + if (assignments.at(k).hasTarget(assn.object, assn.propertyName)) { found = true; break; }