diff options
author | BogDan Vatra <bogdan.vatra@kdab.com> | 2014-06-21 15:03:03 +0300 |
---|---|---|
committer | BogDan Vatra <bogdan@kde.org> | 2014-06-25 16:24:56 +0200 |
commit | 8429c6a5a249b2e8d2b24c721bf10593c07484b3 (patch) | |
tree | 2ca46f0d5f82bb3bf1d9fb71adc00aad1152d3c0 /src/corelib/statemachine/qhistorystate.cpp | |
parent | dd70e2cb0f84bee434f2f7fb69a26732214ce690 (diff) |
Emit a notifications when defaultState and historyType are changed.
In order to properly use QHistoryState object in QML we need to know
when these properties are changed.
Change-Id: I28c783436410c84bc64a919ac18c183f7a5eb9ad
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Volker Krause <volker.krause@kdab.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/corelib/statemachine/qhistorystate.cpp')
-rw-r--r-- | src/corelib/statemachine/qhistorystate.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/corelib/statemachine/qhistorystate.cpp b/src/corelib/statemachine/qhistorystate.cpp index 65ac2a77a0..1706d86afd 100644 --- a/src/corelib/statemachine/qhistorystate.cpp +++ b/src/corelib/statemachine/qhistorystate.cpp @@ -181,7 +181,10 @@ void QHistoryState::setDefaultState(QAbstractState *state) "to this history state's group (%p)", state, parentState()); return; } - d->defaultState = state; + if (d->defaultState != state) { + d->defaultState = state; + emit defaultStateChanged(QHistoryState::QPrivateSignal()); + } } /*! @@ -199,7 +202,10 @@ QHistoryState::HistoryType QHistoryState::historyType() const void QHistoryState::setHistoryType(HistoryType type) { Q_D(QHistoryState); - d->historyType = type; + if (d->historyType != type) { + d->historyType = type; + emit historyTypeChanged(QHistoryState::QPrivateSignal()); + } } /*! @@ -226,6 +232,24 @@ bool QHistoryState::event(QEvent *e) return QAbstractState::event(e); } +/*! + \fn QHistoryState::defaultStateChanged() + \since 5.4 + + This signal is emitted when the defaultState property is changed. + + \sa QHistoryState::defaultState +*/ + +/*! + \fn QHistoryState::historyTypeChanged() + \since 5.4 + + This signal is emitted when the historyType property is changed. + + \sa QHistoryState::historyType +*/ + QT_END_NAMESPACE #endif //QT_NO_STATEMACHINE |