diff options
Diffstat (limited to 'src/corelib/statemachine/qstatemachine.cpp')
-rw-r--r-- | src/corelib/statemachine/qstatemachine.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 1350c8d99e..760ac59bf4 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -882,11 +882,10 @@ QVariant QStateMachinePrivate::savedValueForRestorable(const QList<QAbstractStat #ifdef QSTATEMACHINE_RESTORE_PROPERTIES_DEBUG qDebug() << q_func() << ": savedValueForRestorable(" << exitedStates_sorted << object << propertyName << ")"; #endif - RestorableId id(object, propertyName); for (int i = exitedStates_sorted.size() - 1; i >= 0; --i) { QAbstractState *s = exitedStates_sorted.at(i); QHash<RestorableId, QVariant> restorables = registeredRestorablesForState.value(s); - QHash<RestorableId, QVariant>::const_iterator it = restorables.constFind(id); + QHash<RestorableId, QVariant>::const_iterator it = restorables.constFind(RestorableId(object, propertyName)); if (it != restorables.constEnd()) { #ifdef QSTATEMACHINE_RESTORE_PROPERTIES_DEBUG qDebug() << q_func() << ": using" << it.value() << "from" << s; @@ -897,7 +896,7 @@ QVariant QStateMachinePrivate::savedValueForRestorable(const QList<QAbstractStat #ifdef QSTATEMACHINE_RESTORE_PROPERTIES_DEBUG qDebug() << q_func() << ": falling back to current value"; #endif - return id.first->property(id.second); + return object->property(propertyName); } void QStateMachinePrivate::registerRestorable(QAbstractState *state, QObject *object, const QByteArray &propertyName, @@ -948,14 +947,15 @@ QList<QPropertyAssignment> QStateMachinePrivate::restorablesToPropertyList(const QList<QPropertyAssignment> result; QHash<RestorableId, QVariant>::const_iterator it; for (it = restorables.constBegin(); it != restorables.constEnd(); ++it) { - if (!it.key().first) { + const RestorableId &id = it.key(); + if (!id.object()) { // Property object was deleted continue; } #ifdef QSTATEMACHINE_RESTORE_PROPERTIES_DEBUG - qDebug() << q_func() << ": restoring" << it.key().first << it.key().second << "to" << it.value(); + qDebug() << q_func() << ": restoring" << id.object() << id.proertyName() << "to" << it.value(); #endif - result.append(QPropertyAssignment(it.key().first, it.key().second, it.value(), /*explicitlySet=*/false)); + result.append(QPropertyAssignment(id.object(), id.propertyName(), it.value(), /*explicitlySet=*/false)); } return result; } @@ -1303,8 +1303,8 @@ QAbstractTransition *QStateMachinePrivate::createInitialTransition() const : QAbstractTransition() { setTargetStates(targets); } protected: - virtual bool eventTest(QEvent *) { return true; } - virtual void onTransition(QEvent *) {} + virtual bool eventTest(QEvent *) Q_DECL_OVERRIDE { return true; } + virtual void onTransition(QEvent *) Q_DECL_OVERRIDE {} }; QState *root = rootState(); @@ -1629,8 +1629,8 @@ public: : QAbstractTransition() { setTargetState(target); } protected: - void onTransition(QEvent *) { deleteLater(); } - bool eventTest(QEvent *) { return true; } + void onTransition(QEvent *) Q_DECL_OVERRIDE { deleteLater(); } + bool eventTest(QEvent *) Q_DECL_OVERRIDE { return true; } }; } // namespace |