diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-02-21 10:41:54 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-02-26 07:13:18 +0000 |
commit | 499ec43937e926e4f2fa57a9baa455fcb3862262 (patch) | |
tree | 206c90d47387f8322b68f5e3db613189397e1af3 /src/quick/items/qquickloader.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 <simon.hausmann@qt.io>
Diffstat (limited to 'src/quick/items/qquickloader.cpp')
-rw-r--r-- | src/quick/items/qquickloader.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp index 33e22c1e95..34f30e81a3 100644 --- a/src/quick/items/qquickloader.cpp +++ b/src/quick/items/qquickloader.cpp @@ -54,7 +54,7 @@ static const QQuickItemPrivate::ChangeTypes watchedChanges = QQuickItemPrivate::Geometry | QQuickItemPrivate::ImplicitWidth | QQuickItemPrivate::ImplicitHeight; QQuickLoaderPrivate::QQuickLoaderPrivate() - : item(0), object(0), component(0), itemContext(0), incubator(0), updatingSize(false), + : item(nullptr), object(nullptr), component(nullptr), itemContext(nullptr), incubator(nullptr), updatingSize(false), active(true), loadingFromSource(false), asynchronous(false) { } @@ -62,7 +62,7 @@ QQuickLoaderPrivate::QQuickLoaderPrivate() QQuickLoaderPrivate::~QQuickLoaderPrivate() { delete itemContext; - itemContext = 0; + itemContext = nullptr; delete incubator; disposeInitialPropertyValues(); } @@ -96,7 +96,7 @@ void QQuickLoaderPrivate::clear() incubator->clear(); delete itemContext; - itemContext = 0; + itemContext = nullptr; // Prevent any bindings from running while waiting for deletion. Without // this we may get transient errors from use of 'parent', for example. @@ -111,7 +111,7 @@ void QQuickLoaderPrivate::clear() QObject::disconnect(component, SIGNAL(progressChanged(qreal)), q, SIGNAL(progressChanged())); component->deleteLater(); - component = 0; + component = nullptr; } componentStrongReference.clear(); source = QUrl(); @@ -122,13 +122,13 @@ void QQuickLoaderPrivate::clear() // We can't delete immediately because our item may have triggered // the Loader to load a different item. - item->setParentItem(0); + item->setParentItem(nullptr); item->setVisible(false); - item = 0; + item = nullptr; } if (object) { object->deleteLater(); - object = 0; + object = nullptr; } } @@ -356,7 +356,7 @@ void QQuickLoader::setActive(bool newVal) if (d->incubator) { d->incubator->clear(); delete d->itemContext; - d->itemContext = 0; + d->itemContext = nullptr; } // Prevent any bindings from running while waiting for deletion. Without @@ -371,13 +371,13 @@ void QQuickLoader::setActive(bool newVal) // We can't delete immediately because our item may have triggered // the Loader to load a different item. - d->item->setParentItem(0); + d->item->setParentItem(nullptr); d->item->setVisible(false); - d->item = 0; + d->item = nullptr; } if (d->object) { d->object->deleteLater(); - d->object = 0; + d->object = nullptr; emit itemChanged(); } emit statusChanged(); @@ -499,7 +499,7 @@ void QQuickLoader::setSourceComponent(QQmlComponent *comp) void QQuickLoader::resetSourceComponent() { - setSourceComponent(0); + setSourceComponent(nullptr); } void QQuickLoader::loadFromSourceComponent() @@ -656,7 +656,7 @@ void QQuickLoaderPrivate::setInitialState(QObject *obj) if (obj) { QQml_setParent_noEvent(itemContext, obj); QQml_setParent_noEvent(obj, q); - itemContext = 0; + itemContext = nullptr; } if (initialPropertyValues.isUndefined()) @@ -700,7 +700,7 @@ void QQuickLoaderPrivate::incubatorStateChanged(QQmlIncubator::Status status) if (!incubator->errors().isEmpty()) QQmlEnginePrivate::warning(qmlEngine(q), incubator->errors()); delete itemContext; - itemContext = 0; + itemContext = nullptr; delete incubator->object(); source = QUrl(); emit q->itemChanged(); |