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/qqmllistmodelworkerscript | |
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/qqmllistmodelworkerscript')
-rw-r--r-- | tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp b/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp index 6301c35676..6b8002cce5 100644 --- a/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp +++ b/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp @@ -48,7 +48,7 @@ Q_DECLARE_METATYPE(QList<QVariantHash>) inline QVariant runexpr(QQmlEngine *engine, const QString &str) { - QQmlExpression expr(engine->rootContext(), 0, str); + QQmlExpression expr(engine->rootContext(), nullptr, str); return expr.evaluate(); } @@ -111,7 +111,7 @@ bool tst_qqmllistmodelworkerscript::compareVariantList(const QVariantList &testL bool allOk = true; QQmlListModel *model = qobject_cast<QQmlListModel *>(object.value<QObject *>()); - if (model == 0) + if (model == nullptr) return false; if (model->count() != testList.count()) @@ -349,7 +349,7 @@ void tst_qqmllistmodelworkerscript::dynamic_worker() QQmlEngine eng; QQmlComponent component(&eng, testFileUrl("model.qml")); QQuickItem *item = createWorkerTest(&eng, &component, &model); - QVERIFY(item != 0); + QVERIFY(item != nullptr); QSignalSpy spyCount(&model, SIGNAL(countChanged())); @@ -400,7 +400,7 @@ void tst_qqmllistmodelworkerscript::dynamic_worker_sync() QQmlEngine eng; QQmlComponent component(&eng, testFileUrl("model.qml")); QQuickItem *item = createWorkerTest(&eng, &component, &model); - QVERIFY(item != 0); + QVERIFY(item != nullptr); if (script[0] == QLatin1Char('{') && script[script.length()-1] == QLatin1Char('}')) script = script.mid(1, script.length() - 2); @@ -463,7 +463,7 @@ void tst_qqmllistmodelworkerscript::get_worker() QQmlEngine eng; QQmlComponent component(&eng, testFileUrl("model.qml")); QQuickItem *item = createWorkerTest(&eng, &component, &model); - QVERIFY(item != 0); + QVERIFY(item != nullptr); // Add some values like get() test RUNEVAL(item, "model.append({roleA: 100})"); @@ -593,7 +593,7 @@ void tst_qqmllistmodelworkerscript::property_changes_worker() QQmlComponent component(&engine, testFileUrl("model.qml")); QVERIFY2(component.errorString().isEmpty(), component.errorString().toUtf8()); QQuickItem *item = createWorkerTest(&engine, &component, &model); - QVERIFY(item != 0); + QVERIFY(item != nullptr); QQmlExpression expr(engine.rootContext(), &model, script_setup); expr.evaluate(); @@ -640,7 +640,7 @@ void tst_qqmllistmodelworkerscript::worker_sync() QQmlEngine eng; QQmlComponent component(&eng, testFileUrl("workersync.qml")); QQuickItem *item = createWorkerTest(&eng, &component, &model); - QVERIFY(item != 0); + QVERIFY(item != nullptr); QCOMPARE(model.count(), 0); @@ -705,7 +705,7 @@ void tst_qqmllistmodelworkerscript::worker_remove_element() QQmlEngine eng; QQmlComponent component(&eng, testFileUrl("workerremoveelement.qml")); QQuickItem *item = createWorkerTest(&eng, &component, &model); - QVERIFY(item != 0); + QVERIFY(item != nullptr); QSignalSpy spyModelRemoved(&model, SIGNAL(rowsRemoved(QModelIndex,int,int))); @@ -738,7 +738,7 @@ void tst_qqmllistmodelworkerscript::worker_remove_element() QQmlEngine eng; QQmlComponent component(&eng, testFileUrl("workerremoveelement.qml")); QQuickItem *item = createWorkerTest(&eng, &component, model); - QVERIFY(item != 0); + QVERIFY(item != nullptr); QVERIFY(QMetaObject::invokeMethod(item, "addItem")); @@ -768,7 +768,7 @@ void tst_qqmllistmodelworkerscript::worker_remove_list() QQmlEngine eng; QQmlComponent component(&eng, testFileUrl("workerremovelist.qml")); QQuickItem *item = createWorkerTest(&eng, &component, &model); - QVERIFY(item != 0); + QVERIFY(item != nullptr); QSignalSpy spyModelRemoved(&model, SIGNAL(rowsRemoved(QModelIndex,int,int))); @@ -815,7 +815,7 @@ void tst_qqmllistmodelworkerscript::dynamic_role() QQmlEngine engine; QQmlComponent component(&engine, testFileUrl("model.qml")); QQuickItem *item = createWorkerTest(&engine, &component, &model); - QVERIFY(item != 0); + QVERIFY(item != nullptr); QQmlExpression preExp(engine.rootContext(), &model, preamble); QCOMPARE(preExp.evaluate().toInt(), 0); |