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/qqmlvaluetypes/tst_qqmlvaluetypes.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 'tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp')
-rw-r--r-- | tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp | 172 |
1 files changed, 86 insertions, 86 deletions
diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp index ce52afc862..c252bba001 100644 --- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp +++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp @@ -108,7 +108,7 @@ void tst_qqmlvaluetypes::point() { QQmlComponent component(&engine, testFileUrl("point_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("p_x").toInt(), 10); QCOMPARE(object->property("p_y").toInt(), 4); @@ -120,7 +120,7 @@ void tst_qqmlvaluetypes::point() { QQmlComponent component(&engine, testFileUrl("point_write.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->point(), QPoint(11, 12)); @@ -130,7 +130,7 @@ void tst_qqmlvaluetypes::point() { QQmlComponent component(&engine, testFileUrl("point_compare.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QString tostring = QLatin1String("QPoint(10, 4)"); QCOMPARE(object->property("tostring").toString(), tostring); @@ -153,7 +153,7 @@ void tst_qqmlvaluetypes::pointf() { QQmlComponent component(&engine, testFileUrl("pointf_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(float(object->property("p_x").toDouble()), float(11.3)); QCOMPARE(float(object->property("p_y").toDouble()), float(-10.9)); @@ -165,7 +165,7 @@ void tst_qqmlvaluetypes::pointf() { QQmlComponent component(&engine, testFileUrl("pointf_write.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->pointf(), QPointF(6.8, 9.3)); @@ -175,7 +175,7 @@ void tst_qqmlvaluetypes::pointf() { QQmlComponent component(&engine, testFileUrl("pointf_compare.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QString tostring = QLatin1String("QPointF(11.3, -10.9)"); QCOMPARE(object->property("tostring").toString(), tostring); @@ -198,7 +198,7 @@ void tst_qqmlvaluetypes::size() { QQmlComponent component(&engine, testFileUrl("size_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("s_width").toInt(), 1912); QCOMPARE(object->property("s_height").toInt(), 1913); @@ -210,7 +210,7 @@ void tst_qqmlvaluetypes::size() { QQmlComponent component(&engine, testFileUrl("size_write.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->size(), QSize(13, 88)); @@ -220,7 +220,7 @@ void tst_qqmlvaluetypes::size() { QQmlComponent component(&engine, testFileUrl("size_compare.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QString tostring = QLatin1String("QSize(1912, 1913)"); QCOMPARE(object->property("tostring").toString(), tostring); @@ -243,7 +243,7 @@ void tst_qqmlvaluetypes::sizef() { QQmlComponent component(&engine, testFileUrl("sizef_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(float(object->property("s_width").toDouble()), float(0.1)); QCOMPARE(float(object->property("s_height").toDouble()), float(100923.2)); @@ -255,7 +255,7 @@ void tst_qqmlvaluetypes::sizef() { QQmlComponent component(&engine, testFileUrl("sizef_write.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->sizef(), QSizeF(44.3, 92.8)); @@ -265,7 +265,7 @@ void tst_qqmlvaluetypes::sizef() { QQmlComponent component(&engine, testFileUrl("sizef_compare.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QString tostring = QLatin1String("QSizeF(0.1, 100923)"); QCOMPARE(object->property("tostring").toString(), tostring); @@ -288,7 +288,7 @@ void tst_qqmlvaluetypes::variant() { QQmlComponent component(&engine, testFileUrl("variant_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(float(object->property("s_width").toDouble()), float(0.1)); QCOMPARE(float(object->property("s_height").toDouble()), float(100923.2)); @@ -300,7 +300,7 @@ void tst_qqmlvaluetypes::variant() { QQmlComponent component(&engine, testFileUrl("variant_write.1.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QVERIFY(object->property("complete").toBool()); QVERIFY(object->property("success").toBool()); delete object; @@ -309,7 +309,7 @@ void tst_qqmlvaluetypes::variant() { QQmlComponent component(&engine, testFileUrl("variant_write.2.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QVERIFY(object->property("complete").toBool()); QVERIFY(object->property("success").toBool()); delete object; @@ -359,7 +359,7 @@ void tst_qqmlvaluetypes::sizereadonly() { QQmlComponent component(&engine, testFileUrl("sizereadonly_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("s_width").toInt(), 1912); QCOMPARE(object->property("s_height").toInt(), 1913); @@ -403,7 +403,7 @@ void tst_qqmlvaluetypes::rect() { QQmlComponent component(&engine, testFileUrl("rect_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("r_x").toInt(), 2); QCOMPARE(object->property("r_y").toInt(), 3); @@ -421,7 +421,7 @@ void tst_qqmlvaluetypes::rect() { QQmlComponent component(&engine, testFileUrl("rect_write.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->rect(), QRect(1234, 7, 56, 63)); @@ -431,7 +431,7 @@ void tst_qqmlvaluetypes::rect() { QQmlComponent component(&engine, testFileUrl("rect_compare.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QString tostring = QLatin1String("QRect(2, 3, 109, 102)"); QCOMPARE(object->property("tostring").toString(), tostring); @@ -454,7 +454,7 @@ void tst_qqmlvaluetypes::rectf() { QQmlComponent component(&engine, testFileUrl("rectf_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(float(object->property("r_x").toDouble()), float(103.8)); QCOMPARE(float(object->property("r_y").toDouble()), float(99.2)); @@ -472,7 +472,7 @@ void tst_qqmlvaluetypes::rectf() { QQmlComponent component(&engine, testFileUrl("rectf_write.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->rectf(), QRectF(70.1, -113.2, 80924.8, 99.2)); @@ -482,7 +482,7 @@ void tst_qqmlvaluetypes::rectf() { QQmlComponent component(&engine, testFileUrl("rectf_compare.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QString tostring = QLatin1String("QRectF(103.8, 99.2, 88.1, 77.6)"); QCOMPARE(object->property("tostring").toString(), tostring); @@ -505,7 +505,7 @@ void tst_qqmlvaluetypes::vector2d() { QQmlComponent component(&engine, testFileUrl("vector2d_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE((float)object->property("v_x").toDouble(), (float)32.88); QCOMPARE((float)object->property("v_y").toDouble(), (float)1.3); @@ -517,7 +517,7 @@ void tst_qqmlvaluetypes::vector2d() { QQmlComponent component(&engine, testFileUrl("vector2d_write.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->vector2(), QVector2D(-0.3f, -12.9f)); @@ -527,7 +527,7 @@ void tst_qqmlvaluetypes::vector2d() { QQmlComponent component(&engine, testFileUrl("vector2d_compare.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QString tostring = QLatin1String("QVector2D(32.88, 1.3)"); QCOMPARE(object->property("tostring").toString(), tostring); @@ -545,7 +545,7 @@ void tst_qqmlvaluetypes::vector2d() { QQmlComponent component(&engine, testFileUrl("vector2d_invokables.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QVERIFY(object->property("success").toBool()); delete object; } @@ -556,7 +556,7 @@ void tst_qqmlvaluetypes::vector3d() { QQmlComponent component(&engine, testFileUrl("vector3d_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE((float)object->property("v_x").toDouble(), (float)23.88); QCOMPARE((float)object->property("v_y").toDouble(), (float)3.1); @@ -569,7 +569,7 @@ void tst_qqmlvaluetypes::vector3d() { QQmlComponent component(&engine, testFileUrl("vector3d_write.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->vector(), QVector3D(-0.3f, -12.9f, 907.4f)); @@ -579,7 +579,7 @@ void tst_qqmlvaluetypes::vector3d() { QQmlComponent component(&engine, testFileUrl("vector3d_compare.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QString tostring = QLatin1String("QVector3D(23.88, 3.1, 4.3)"); QCOMPARE(object->property("tostring").toString(), tostring); @@ -598,7 +598,7 @@ void tst_qqmlvaluetypes::vector3d() { QQmlComponent component(&engine, testFileUrl("vector3d_invokables.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QVERIFY(object->property("success").toBool()); delete object; } @@ -609,7 +609,7 @@ void tst_qqmlvaluetypes::vector4d() { QQmlComponent component(&engine, testFileUrl("vector4d_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE((float)object->property("v_x").toDouble(), (float)54.2); QCOMPARE((float)object->property("v_y").toDouble(), (float)23.88); @@ -623,7 +623,7 @@ void tst_qqmlvaluetypes::vector4d() { QQmlComponent component(&engine, testFileUrl("vector4d_write.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->vector4(), QVector4D(-0.3f, -12.9f, 907.4f, 88.5f)); @@ -633,7 +633,7 @@ void tst_qqmlvaluetypes::vector4d() { QQmlComponent component(&engine, testFileUrl("vector4d_compare.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QString tostring = QLatin1String("QVector4D(54.2, 23.88, 3.1, 4.3)"); QCOMPARE(object->property("tostring").toString(), tostring); @@ -651,7 +651,7 @@ void tst_qqmlvaluetypes::vector4d() { QQmlComponent component(&engine, testFileUrl("vector4d_invokables.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QVERIFY(object->property("success").toBool()); delete object; } @@ -662,7 +662,7 @@ void tst_qqmlvaluetypes::quaternion() { QQmlComponent component(&engine, testFileUrl("quaternion_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE((float)object->property("v_scalar").toDouble(), (float)4.3); QCOMPARE((float)object->property("v_x").toDouble(), (float)54.2); @@ -676,7 +676,7 @@ void tst_qqmlvaluetypes::quaternion() { QQmlComponent component(&engine, testFileUrl("quaternion_write.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->quaternion(), QQuaternion(88.5f, -0.3f, -12.9f, 907.4f)); @@ -686,7 +686,7 @@ void tst_qqmlvaluetypes::quaternion() { QQmlComponent component(&engine, testFileUrl("quaternion_compare.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QString tostring = QLatin1String("QQuaternion(4.3, 54.2, 23.88, 3.1)"); QCOMPARE(object->property("tostring").toString(), tostring); @@ -707,7 +707,7 @@ void tst_qqmlvaluetypes::matrix4x4() { QQmlComponent component(&engine, testFileUrl("matrix4x4_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE((float)object->property("v_m11").toDouble(), (float)1); QCOMPARE((float)object->property("v_m12").toDouble(), (float)2); @@ -737,7 +737,7 @@ void tst_qqmlvaluetypes::matrix4x4() { QQmlComponent component(&engine, testFileUrl("matrix4x4_write.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->matrix(), QMatrix4x4(11, 12, 13, 14, 21, 22, 23, 24, @@ -750,7 +750,7 @@ void tst_qqmlvaluetypes::matrix4x4() { QQmlComponent component(&engine, testFileUrl("matrix4x4_compare.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QString tostring = QLatin1String("QMatrix4x4(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)"); QCOMPARE(object->property("tostring").toString(), tostring); @@ -768,7 +768,7 @@ void tst_qqmlvaluetypes::matrix4x4() { QQmlComponent component(&engine, testFileUrl("matrix4x4_invokables.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("success").toBool(), true); delete object; } @@ -779,7 +779,7 @@ void tst_qqmlvaluetypes::font() { QQmlComponent component(&engine, testFileUrl("font_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("f_family").toString(), object->font().family()); QCOMPARE(object->property("f_bold").toBool(), object->font().bold()); @@ -802,7 +802,7 @@ void tst_qqmlvaluetypes::font() { QQmlComponent component(&engine, testFileUrl("font_write.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QFont font; font.setFamily("Helvetica"); @@ -835,7 +835,7 @@ void tst_qqmlvaluetypes::font() { QQmlComponent component(&engine, testFileUrl("font_write.2.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->font().pixelSize(), 10); @@ -847,7 +847,7 @@ void tst_qqmlvaluetypes::font() QQmlComponent component(&engine, testFileUrl("font_write.3.qml")); QTest::ignoreMessage(QtWarningMsg, "Both point size and pixel size set. Using pixel size."); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->font().pixelSize(), 10); @@ -857,7 +857,7 @@ void tst_qqmlvaluetypes::font() QQmlComponent component(&engine, testFileUrl("font_write.4.qml")); QTest::ignoreMessage(QtWarningMsg, "Both point size and pixel size set. Using pixel size."); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->font().pixelSize(), 10); @@ -866,11 +866,11 @@ void tst_qqmlvaluetypes::font() { QQmlComponent component(&engine, testFileUrl("font_write.5.qml")); QObject *object = qobject_cast<QObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); MyTypeObject *object1 = object->findChild<MyTypeObject *>("object1"); - QVERIFY(object1 != 0); + QVERIFY(object1 != nullptr); MyTypeObject *object2 = object->findChild<MyTypeObject *>("object2"); - QVERIFY(object2 != 0); + QVERIFY(object2 != nullptr); QCOMPARE(object1->font().pixelSize(), 19); QCOMPARE(object2->font().pointSize(), 14); @@ -881,7 +881,7 @@ void tst_qqmlvaluetypes::font() { QQmlComponent component(&engine, testFileUrl("font_compare.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QString tostring = QLatin1String("QFont(") + object->font().toString() + QLatin1Char(')'); QCOMPARE(object->property("tostring").toString(), tostring); @@ -902,7 +902,7 @@ void tst_qqmlvaluetypes::color() { QQmlComponent component(&engine, testFileUrl("color_read.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE((float)object->property("v_r").toDouble(), (float)0.2); QCOMPARE((float)object->property("v_g").toDouble(), (float)0.88); @@ -930,7 +930,7 @@ void tst_qqmlvaluetypes::color() { QQmlComponent component(&engine, testFileUrl("color_write.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QColor newColor; newColor.setRedF(0.5); @@ -945,7 +945,7 @@ void tst_qqmlvaluetypes::color() { QQmlComponent component(&engine, testFileUrl("color_write_HSV.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QColor newColor; newColor.setHsvF(0.43, 0.77, 0.88, 0.7); @@ -957,7 +957,7 @@ void tst_qqmlvaluetypes::color() { QQmlComponent component(&engine, testFileUrl("color_write_HSL.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QColor newColor; newColor.setHslF(0.43, 0.74, 0.54, 0.7); @@ -969,7 +969,7 @@ void tst_qqmlvaluetypes::color() { QQmlComponent component(&engine, testFileUrl("color_compare.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QString colorString("#5733e199"); QCOMPARE(object->property("colorToString").toString(), colorString); QCOMPARE(object->property("colorEqualsIdenticalRgba").toBool(), true); @@ -1004,7 +1004,7 @@ void tst_qqmlvaluetypes::bindingAssignment() { QQmlComponent component(&engine, testFileUrl("bindingAssignment.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->rect().x(), 10); QCOMPARE(object->rect().y(), 15); @@ -1025,7 +1025,7 @@ void tst_qqmlvaluetypes::bindingAssignment() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); QQmlComponent component(&engine, testFileUrl("bindingAssignment.2.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->rect().x(), 5); object->setProperty("value", QVariant(92)); QCOMPARE(object->rect().x(), 5); @@ -1038,7 +1038,7 @@ void tst_qqmlvaluetypes::bindingRead() { QQmlComponent component(&engine, testFileUrl("bindingRead.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("value").toInt(), 2); @@ -1054,7 +1054,7 @@ void tst_qqmlvaluetypes::staticAssignment() { QQmlComponent component(&engine, testFileUrl("staticAssignment.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->rect().x(), 9); @@ -1066,7 +1066,7 @@ void tst_qqmlvaluetypes::scriptAccess() { QQmlComponent component(&engine, testFileUrl("scriptAccess.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("valuePre").toInt(), 2); QCOMPARE(object->rect().x(), 19); @@ -1081,7 +1081,7 @@ void tst_qqmlvaluetypes::autoBindingRemoval() { QQmlComponent component(&engine, testFileUrl("autoBindingRemoval.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->rect().x(), 10); @@ -1103,7 +1103,7 @@ void tst_qqmlvaluetypes::autoBindingRemoval() { QQmlComponent component(&engine, testFileUrl("autoBindingRemoval.2.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->rect().x(), 10); @@ -1127,7 +1127,7 @@ void tst_qqmlvaluetypes::autoBindingRemoval() QString warning = component.url().toString() + ":6:11: Unable to assign [undefined] to QRect"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); object->setProperty("value", QVariant(QRect(9, 22, 33, 44))); @@ -1150,7 +1150,7 @@ void tst_qqmlvaluetypes::valueSources() { QQmlComponent component(&engine, testFileUrl("valueSources.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->rect().x(), 3345); @@ -1174,7 +1174,7 @@ void tst_qqmlvaluetypes::valueInterceptors() QQmlComponent component(&engine, testFileUrl("valueInterceptors.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); checkNoErrors(component); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->rect().x(), 13); @@ -1208,10 +1208,10 @@ void tst_qqmlvaluetypes::deletedObject() QQmlComponent component(&engine, testFileUrl("deletedObject.qml")); QTest::ignoreMessage(QtDebugMsg, "Test: 2"); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QObject *dObject = qvariant_cast<QObject *>(object->property("object")); - QVERIFY(dObject != 0); + QVERIFY(dObject != nullptr); delete dObject; QTest::ignoreMessage(QtDebugMsg, "Test: undefined"); @@ -1225,7 +1225,7 @@ void tst_qqmlvaluetypes::bindingVariantCopy() { QQmlComponent component(&engine, testFileUrl("bindingVariantCopy.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->rect(), QRect(19, 33, 5, 99)); @@ -1237,7 +1237,7 @@ void tst_qqmlvaluetypes::scriptVariantCopy() { QQmlComponent component(&engine, testFileUrl("scriptVariantCopy.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->rect(), QRect(2, 3, 109, 102)); @@ -1253,7 +1253,7 @@ void tst_qqmlvaluetypes::enums() { QQmlComponent component(&engine, testFileUrl("enums.1.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->font().capitalization(), QFont::AllUppercase); delete object; } @@ -1261,7 +1261,7 @@ void tst_qqmlvaluetypes::enums() { QQmlComponent component(&engine, testFileUrl("enums.2.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->font().capitalization(), QFont::AllUppercase); delete object; } @@ -1269,7 +1269,7 @@ void tst_qqmlvaluetypes::enums() { QQmlComponent component(&engine, testFileUrl("enums.3.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->font().capitalization(), QFont::AllUppercase); delete object; } @@ -1277,7 +1277,7 @@ void tst_qqmlvaluetypes::enums() { QQmlComponent component(&engine, testFileUrl("enums.4.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->font().capitalization(), QFont::AllUppercase); delete object; } @@ -1285,7 +1285,7 @@ void tst_qqmlvaluetypes::enums() { QQmlComponent component(&engine, testFileUrl("enums.5.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->font().capitalization(), QFont::AllUppercase); delete object; } @@ -1298,7 +1298,7 @@ void tst_qqmlvaluetypes::conflictingBindings() { QQmlComponent component(&engine, testFileUrl("conflicting.1.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 12); @@ -1316,7 +1316,7 @@ void tst_qqmlvaluetypes::conflictingBindings() { QQmlComponent component(&engine, testFileUrl("conflicting.2.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 6); @@ -1334,7 +1334,7 @@ void tst_qqmlvaluetypes::conflictingBindings() { QQmlComponent component(&engine, testFileUrl("conflicting.3.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 12); @@ -1354,7 +1354,7 @@ void tst_qqmlvaluetypes::returnValues() { QQmlComponent component(&engine, testFileUrl("returnValues.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("test1").toBool(), true); QCOMPARE(object->property("test2").toBool(), true); @@ -1367,7 +1367,7 @@ void tst_qqmlvaluetypes::varAssignment() { QQmlComponent component(&engine, testFileUrl("varAssignment.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("x").toInt(), 1); QCOMPARE(object->property("y").toInt(), 2); @@ -1382,7 +1382,7 @@ void tst_qqmlvaluetypes::bindingsSpliceCorrectly() { QQmlComponent component(&engine, testFileUrl("bindingsSpliceCorrectly.1.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("test").toBool(), true); @@ -1392,7 +1392,7 @@ void tst_qqmlvaluetypes::bindingsSpliceCorrectly() { QQmlComponent component(&engine, testFileUrl("bindingsSpliceCorrectly.2.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("test").toBool(), true); @@ -1403,7 +1403,7 @@ void tst_qqmlvaluetypes::bindingsSpliceCorrectly() { QQmlComponent component(&engine, testFileUrl("bindingsSpliceCorrectly.3.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("test").toBool(), true); @@ -1413,7 +1413,7 @@ void tst_qqmlvaluetypes::bindingsSpliceCorrectly() { QQmlComponent component(&engine, testFileUrl("bindingsSpliceCorrectly.4.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("test").toBool(), true); @@ -1423,7 +1423,7 @@ void tst_qqmlvaluetypes::bindingsSpliceCorrectly() { QQmlComponent component(&engine, testFileUrl("bindingsSpliceCorrectly.5.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("test").toBool(), true); @@ -1435,7 +1435,7 @@ void tst_qqmlvaluetypes::nonValueTypeComparison() { QQmlComponent component(&engine, testFileUrl("nonValueTypeComparison.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("test1").toBool(), true); QCOMPARE(object->property("test2").toBool(), true); @@ -1447,7 +1447,7 @@ void tst_qqmlvaluetypes::initializeByWrite() { QQmlComponent component(&engine, testFileUrl("initializeByWrite.qml")); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("test").toBool(), true); |