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 /tests/auto/qml/qqmlmoduleplugin | |
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 'tests/auto/qml/qqmlmoduleplugin')
18 files changed, 30 insertions, 30 deletions
diff --git a/tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/plugin.cpp index fa9782f8c2..b44bc58373 100644 --- a/tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/plugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/plugin.cpp @@ -34,7 +34,7 @@ class MyPluginType : public QObject { Q_OBJECT public: - MyPluginType(QObject *parent=0) : QObject(parent) {} + MyPluginType(QObject *parent=nullptr) : QObject(parent) {} }; diff --git a/tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/plugin.cpp index fe01507412..ccd1066a36 100644 --- a/tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/plugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/plugin.cpp @@ -34,7 +34,7 @@ class MyPluginType : public QObject { Q_OBJECT public: - MyPluginType(QObject *parent=0) : QObject(parent) {} + MyPluginType(QObject *parent=nullptr) : QObject(parent) {} }; diff --git a/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp b/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp index 92d30351a7..610710fbf8 100644 --- a/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp @@ -36,7 +36,7 @@ class MyPluginType : public QObject Q_PROPERTY(QString value READ value) public: - MyPluginType(QObject *parent=0) : QObject(parent) {} + MyPluginType(QObject *parent=nullptr) : QObject(parent) {} QString value() const { return "Hello"; } }; @@ -47,7 +47,7 @@ class MyNestedPluginType : public QObject Q_PROPERTY(QString value READ value) public: - MyNestedPluginType(QObject *parent=0) : QObject(parent) {} + MyNestedPluginType(QObject *parent=nullptr) : QObject(parent) {} QString value() const { return "Goodbye"; } }; diff --git a/tests/auto/qml/qqmlmoduleplugin/nonstrictModule/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/nonstrictModule/plugin.cpp index 5fc05b91bd..4c2109e02a 100644 --- a/tests/auto/qml/qqmlmoduleplugin/nonstrictModule/plugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/nonstrictModule/plugin.cpp @@ -34,7 +34,7 @@ class MyPluginType : public QObject { Q_OBJECT public: - MyPluginType(QObject *parent=0) : QObject(parent) {} + MyPluginType(QObject *parent=nullptr) : QObject(parent) {} }; diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/childplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/childplugin.cpp index 515d56a3c4..cb8c395fdf 100644 --- a/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/childplugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/childplugin.cpp @@ -37,7 +37,7 @@ class MyChildPluginType : public QObject Q_PROPERTY(int valueOnlyIn2 READ value WRITE setValue) public: - MyChildPluginType(QObject *parent=0) : QObject(parent) + MyChildPluginType(QObject *parent=nullptr) : QObject(parent) { qWarning("child import2.1 worked"); } diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/plugin.cpp index 6cae5254bc..ced7e0895d 100644 --- a/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/plugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/plugin.cpp @@ -37,7 +37,7 @@ class MyPluginType : public QObject Q_PROPERTY(int valueOnlyIn2 READ value WRITE setValue) public: - MyPluginType(QObject *parent=0) : QObject(parent) + MyPluginType(QObject *parent=nullptr) : QObject(parent) { qWarning("import2.1 worked"); } diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2.2/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/plugin.2.2/plugin.cpp index ecec870374..67cfc2a579 100644 --- a/tests/auto/qml/qqmlmoduleplugin/plugin.2.2/plugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2.2/plugin.cpp @@ -37,7 +37,7 @@ class MyPluginType : public QObject Q_PROPERTY(int valueOnlyIn2 READ value WRITE setValue) public: - MyPluginType(QObject *parent=0) : QObject(parent) + MyPluginType(QObject *parent=nullptr) : QObject(parent) { qWarning("import2.2 worked"); } diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/childplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/childplugin.cpp index 56545cfa3c..7b8f2a96be 100644 --- a/tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/childplugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/childplugin.cpp @@ -37,7 +37,7 @@ class MyChildPluginType : public QObject Q_PROPERTY(int valueOnlyIn2 READ value WRITE setValue) public: - MyChildPluginType(QObject *parent=0) : QObject(parent) + MyChildPluginType(QObject *parent=nullptr) : QObject(parent) { qWarning("child import2 worked"); } diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/plugin.2/plugin.cpp index 49a2a747a4..8a4598e3bf 100644 --- a/tests/auto/qml/qqmlmoduleplugin/plugin.2/plugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2/plugin.cpp @@ -37,7 +37,7 @@ class MyPluginType : public QObject Q_PROPERTY(int valueOnlyIn2 READ value WRITE setValue) public: - MyPluginType(QObject *parent=0) : QObject(parent) + MyPluginType(QObject *parent=nullptr) : QObject(parent) { qWarning("import2 worked"); } diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/childplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/childplugin.cpp index 28490d3d98..6a2deca1df 100644 --- a/tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/childplugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/childplugin.cpp @@ -36,7 +36,7 @@ class MyChildPluginType : public QObject Q_PROPERTY(int value READ value WRITE setValue) public: - MyChildPluginType(QObject *parent=0) : QObject(parent) + MyChildPluginType(QObject *parent=nullptr) : QObject(parent) { qWarning("child import worked"); } diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/plugin/plugin.cpp index db51185de6..5e39966a2a 100644 --- a/tests/auto/qml/qqmlmoduleplugin/plugin/plugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/plugin/plugin.cpp @@ -36,7 +36,7 @@ class MyPluginType : public QObject Q_PROPERTY(int value READ value WRITE setValue) public: - MyPluginType(QObject *parent=0) : QObject(parent) + MyPluginType(QObject *parent=nullptr) : QObject(parent) { qWarning("import worked"); } diff --git a/tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/plugin.cpp index 7669d65568..5c3c1b81c6 100644 --- a/tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/plugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/plugin.cpp @@ -36,7 +36,7 @@ class MyPluginType : public QObject Q_PROPERTY(int value READ value WRITE setValue) public: - MyPluginType(QObject *parent=0) : QObject(parent) + MyPluginType(QObject *parent=nullptr) : QObject(parent) { qWarning("import worked"); } diff --git a/tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/plugin.cpp index 92211ebf9d..0780ea8325 100644 --- a/tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/plugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/plugin.cpp @@ -34,7 +34,7 @@ class MyPluginType : public QObject { Q_OBJECT public: - MyPluginType(QObject *parent=0) : QObject(parent) {} + MyPluginType(QObject *parent=nullptr) : QObject(parent) {} }; diff --git a/tests/auto/qml/qqmlmoduleplugin/preemptiveModule/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/preemptiveModule/plugin.cpp index 3df3e9cc81..bc896716e2 100644 --- a/tests/auto/qml/qqmlmoduleplugin/preemptiveModule/plugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/preemptiveModule/plugin.cpp @@ -34,7 +34,7 @@ class MyPluginType : public QObject { Q_OBJECT public: - MyPluginType(QObject *parent=0) : QObject(parent) {} + MyPluginType(QObject *parent=nullptr) : QObject(parent) {} }; diff --git a/tests/auto/qml/qqmlmoduleplugin/protectedModule/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/protectedModule/plugin.cpp index afdeea80f4..ae8c231aab 100644 --- a/tests/auto/qml/qqmlmoduleplugin/protectedModule/plugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/protectedModule/plugin.cpp @@ -33,7 +33,7 @@ class MyPluginType : public QObject { Q_OBJECT public: - MyPluginType(QObject *parent=0) : QObject(parent) {} + MyPluginType(QObject *parent=nullptr) : QObject(parent) {} }; diff --git a/tests/auto/qml/qqmlmoduleplugin/strictModule.2/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/strictModule.2/plugin.cpp index 4f5176ae62..312ed325b1 100644 --- a/tests/auto/qml/qqmlmoduleplugin/strictModule.2/plugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/strictModule.2/plugin.cpp @@ -34,7 +34,7 @@ class MyPluginType : public QObject { Q_OBJECT public: - MyPluginType(QObject *parent=0) : QObject(parent) {} + MyPluginType(QObject *parent=nullptr) : QObject(parent) {} }; diff --git a/tests/auto/qml/qqmlmoduleplugin/strictModule/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/strictModule/plugin.cpp index eaa9aeb1d0..a622078159 100644 --- a/tests/auto/qml/qqmlmoduleplugin/strictModule/plugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/strictModule/plugin.cpp @@ -34,7 +34,7 @@ class MyPluginType : public QObject { Q_OBJECT public: - MyPluginType(QObject *parent=0) : QObject(parent) {} + MyPluginType(QObject *parent=nullptr) : QObject(parent) {} }; diff --git a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp index 85e4918b61..fac3ff15fd 100644 --- a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp @@ -217,7 +217,7 @@ void tst_qqmlmoduleplugin::importsPlugin() qWarning() << err; VERIFY_ERRORS(0); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("value").toInt(),123); delete object; } @@ -285,7 +285,7 @@ void tst_qqmlmoduleplugin::importPluginWithQmlFile() qWarning() << err; VERIFY_ERRORS(0); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); delete object; } @@ -301,7 +301,7 @@ void tst_qqmlmoduleplugin::remoteImportWithQuotedUrl() QTRY_COMPARE(component.status(), QQmlComponent::Ready); QObject *object = component.create(); QCOMPARE(object->property("width").toInt(), 300); - QVERIFY(object != 0); + QVERIFY(object != nullptr); delete object; foreach (QQmlError err, component.errors()) @@ -323,7 +323,7 @@ void tst_qqmlmoduleplugin::remoteImportWithUnquotedUri() QTRY_COMPARE(component.status(), QQmlComponent::Ready); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("width").toInt(), 300); delete object; @@ -345,7 +345,7 @@ void tst_qqmlmoduleplugin::importsMixedQmlCppPlugin() QQmlComponent component(&engine, testFileUrl(QStringLiteral("importsMixedQmlCppPlugin.qml"))); QObject *o = component.create(); - QVERIFY2(o != 0, QQmlDataTest::msgComponentError(component, &engine)); + QVERIFY2(o != nullptr, QQmlDataTest::msgComponentError(component, &engine)); QCOMPARE(o->property("test").toBool(), true); delete o; } @@ -354,7 +354,7 @@ void tst_qqmlmoduleplugin::importsMixedQmlCppPlugin() QQmlComponent component(&engine, testFileUrl(QStringLiteral("importsMixedQmlCppPlugin.2.qml"))); QObject *o = component.create(); - QVERIFY2(o != 0, QQmlDataTest::msgComponentError(component, &engine)); + QVERIFY2(o != nullptr, QQmlDataTest::msgComponentError(component, &engine)); QCOMPARE(o->property("test").toBool(), true); QCOMPARE(o->property("test2").toBool(), true); delete o; @@ -482,7 +482,7 @@ void tst_qqmlmoduleplugin::importLocalModule() component.setData(qml.toUtf8(), testFileUrl("empty.qml")); QScopedPointer<QObject> object(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("majorVersion").value<int>(), majorVersion); QCOMPARE(object->property("minorVersion").value<int>(), minorVersion); } @@ -539,7 +539,7 @@ void tst_qqmlmoduleplugin::importStrictModule() if (error.isEmpty()) { QScopedPointer<QObject> object(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); } else { QVERIFY(!component.isReady()); QCOMPARE(component.errors().count(), 1); @@ -623,7 +623,7 @@ void tst_qqmlmoduleplugin::importProtectedModule() //If plugin is loaded due to import, should assert QScopedPointer<QObject> object(component.create()); //qDebug() << component.errorString(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); } void tst_qqmlmoduleplugin::importVersionedModule() @@ -664,7 +664,7 @@ void tst_qqmlmoduleplugin::importsChildPlugin() qWarning() << err; VERIFY_ERRORS(0); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("value").toInt(),123); delete object; } @@ -681,7 +681,7 @@ void tst_qqmlmoduleplugin::importsChildPlugin2() qWarning() << err; VERIFY_ERRORS(0); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("value").toInt(),123); delete object; } @@ -698,7 +698,7 @@ void tst_qqmlmoduleplugin::importsChildPlugin21() qWarning() << err; VERIFY_ERRORS(0); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("value").toInt(),123); delete object; } |