diff options
author | Shawn Rutledge <[email protected]> | 2018-02-21 10:41:54 +0100 |
---|---|---|
committer | Shawn Rutledge <[email protected]> | 2018-02-26 07:13:18 +0000 |
commit | 499ec43937e926e4f2fa57a9baa455fcb3862262 (patch) | |
tree | 206c90d47387f8322b68f5e3db613189397e1af3 /src/quick/util/qquickstategroup.cpp | |
parent | 53d1e9ed21d25e65a2f13606af479838f5f21fe7 (diff) |
use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.
Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).
Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/quick/util/qquickstategroup.cpp')
-rw-r--r-- | src/quick/util/qquickstategroup.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/quick/util/qquickstategroup.cpp b/src/quick/util/qquickstategroup.cpp index ebcbbf93ed..1b99baed9a 100644 --- a/src/quick/util/qquickstategroup.cpp +++ b/src/quick/util/qquickstategroup.cpp @@ -60,7 +60,7 @@ class QQuickStateGroupPrivate : public QObjectPrivate Q_DECLARE_PUBLIC(QQuickStateGroup) public: QQuickStateGroupPrivate() - : nullState(0), componentComplete(true), + : nullState(nullptr), componentComplete(true), ignoreTrans(false), applyingState(false), unnamedCount(0) {} QString currentState; @@ -129,7 +129,7 @@ QQuickStateGroup::~QQuickStateGroup() { Q_D(const QQuickStateGroup); for (int i = 0; i < d->states.count(); ++i) - d->states.at(i)->setStateGroup(0); + d->states.at(i)->setStateGroup(nullptr); } QList<QQuickState *> QQuickStateGroup::states() const @@ -194,7 +194,7 @@ void QQuickStateGroupPrivate::clear_states(QQmlListProperty<QQuickState> *list) QQuickStateGroup *_this = static_cast<QQuickStateGroup *>(list->object); _this->d_func()->setCurrentStateInternal(QString(), true); for (int i = 0; i < _this->d_func()->states.count(); ++i) { - _this->d_func()->states.at(i)->setStateGroup(0); + _this->d_func()->states.at(i)->setStateGroup(nullptr); } _this->d_func()->states.clear(); } @@ -364,7 +364,7 @@ bool QQuickStateGroupPrivate::updateAutoState() QQuickTransition *QQuickStateGroupPrivate::findTransition(const QString &from, const QString &to) { - QQuickTransition *highest = 0; + QQuickTransition *highest = nullptr; int score = 0; bool reversed = false; bool done = false; @@ -444,7 +444,7 @@ void QQuickStateGroupPrivate::setCurrentStateInternal(const QString &state, applyingState = true; - QQuickTransition *transition = ignoreTrans ? 0 : findTransition(currentState, state); + QQuickTransition *transition = ignoreTrans ? nullptr : findTransition(currentState, state); if (stateChangeDebug()) { qWarning() << this << "Changing state. From" << currentState << ". To" << state; if (transition) @@ -452,7 +452,7 @@ void QQuickStateGroupPrivate::setCurrentStateInternal(const QString &state, << transition->toState(); } - QQuickState *oldState = 0; + QQuickState *oldState = nullptr; if (!currentState.isEmpty()) { for (int ii = 0; ii < states.count(); ++ii) { if (states.at(ii)->name() == currentState) { @@ -465,7 +465,7 @@ void QQuickStateGroupPrivate::setCurrentStateInternal(const QString &state, currentState = state; emit q->stateChanged(currentState); - QQuickState *newState = 0; + QQuickState *newState = nullptr; for (int ii = 0; ii < states.count(); ++ii) { if (states.at(ii)->name() == currentState) { newState = states.at(ii); @@ -473,7 +473,7 @@ void QQuickStateGroupPrivate::setCurrentStateInternal(const QString &state, } } - if (oldState == 0 || newState == 0) { + if (oldState == nullptr || newState == nullptr) { if (!nullState) { nullState = new QQuickState; QQml_setParent_noEvent(nullState, q); @@ -496,7 +496,7 @@ QQuickState *QQuickStateGroup::findState(const QString &name) const return state; } - return 0; + return nullptr; } void QQuickStateGroup::removeState(QQuickState *state) |