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/qml/qml/qqmlglobal.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/qml/qml/qqmlglobal.cpp')
-rw-r--r-- | src/qml/qml/qqmlglobal.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/qml/qqmlglobal.cpp b/src/qml/qml/qqmlglobal.cpp index 6418812bae..1d60c518c4 100644 --- a/src/qml/qml/qqmlglobal.cpp +++ b/src/qml/qml/qqmlglobal.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE QQmlValueTypeProvider::QQmlValueTypeProvider() - : next(0) + : next(nullptr) { } @@ -65,7 +65,7 @@ const QMetaObject *QQmlValueTypeProvider::metaObjectForMetaType(int type) return mo; } while ((p = p->next)); - return 0; + return nullptr; } bool QQmlValueTypeProvider::initValueType(int type, QVariant& dst) @@ -218,7 +218,7 @@ bool QQmlValueTypeProvider::writeValueType(int type, const void *src, QVariant& return false; } -const QMetaObject *QQmlValueTypeProvider::getMetaObjectForMetaType(int) { return 0; } +const QMetaObject *QQmlValueTypeProvider::getMetaObjectForMetaType(int) { return nullptr; } bool QQmlValueTypeProvider::init(int, QVariant&) { return false; } bool QQmlValueTypeProvider::create(int, int, const void *[], QVariant *) { return false; } bool QQmlValueTypeProvider::createFromString(int, const QString &, void *, size_t) { return false; } @@ -232,11 +232,11 @@ bool QQmlValueTypeProvider::read(const QVariant&, void *, int) { return false; } bool QQmlValueTypeProvider::write(int, const void *, QVariant&) { return false; } Q_GLOBAL_STATIC(QQmlValueTypeProvider, nullValueTypeProvider) -static QQmlValueTypeProvider *valueTypeProvider = 0; +static QQmlValueTypeProvider *valueTypeProvider = nullptr; static QQmlValueTypeProvider **getValueTypeProvider(void) { - if (valueTypeProvider == 0) { + if (valueTypeProvider == nullptr) { valueTypeProvider = nullValueTypeProvider; } @@ -294,7 +294,7 @@ QVariant QQmlColorProvider::lighter(const QVariant &, qreal) { return QVariant() QVariant QQmlColorProvider::darker(const QVariant &, qreal) { return QVariant(); } QVariant QQmlColorProvider::tint(const QVariant &, const QVariant &) { return QVariant(); } -static QQmlColorProvider *colorProvider = 0; +static QQmlColorProvider *colorProvider = nullptr; Q_QML_PRIVATE_EXPORT QQmlColorProvider *QQml_setColorProvider(QQmlColorProvider *newProvider) { @@ -305,7 +305,7 @@ Q_QML_PRIVATE_EXPORT QQmlColorProvider *QQml_setColorProvider(QQmlColorProvider static QQmlColorProvider **getColorProvider(void) { - if (colorProvider == 0) { + if (colorProvider == nullptr) { qWarning() << "Warning: QQml_colorProvider: no color provider has been set!"; static QQmlColorProvider nullColorProvider; colorProvider = &nullColorProvider; @@ -345,7 +345,7 @@ QObject *QQmlGuiProvider::styleHints() QString QQmlGuiProvider::pluginName() const { return QString(); } -static QQmlGuiProvider *guiProvider = 0; +static QQmlGuiProvider *guiProvider = nullptr; Q_QML_PRIVATE_EXPORT QQmlGuiProvider *QQml_setGuiProvider(QQmlGuiProvider *newProvider) { @@ -356,7 +356,7 @@ Q_QML_PRIVATE_EXPORT QQmlGuiProvider *QQml_setGuiProvider(QQmlGuiProvider *newPr static QQmlGuiProvider **getGuiProvider(void) { - if (guiProvider == 0) { + if (guiProvider == nullptr) { static QQmlGuiProvider nullGuiProvider; //Still provides an application with no GUI support guiProvider = &nullGuiProvider; } |