diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-10-15 16:09:09 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-10-18 12:39:28 +0200 |
commit | 72c3befaa24e7e6021898061b5bc5389554e7126 (patch) | |
tree | 5aedde3f9e942a5fbb4b25ac03138d4ede5dceea /tests/benchmarks/qml | |
parent | e7618dba5b4e4b59331693e7b3a38601822b6ffb (diff) | |
download | qtdeclarative-72c3befaa24e7e6021898061b5bc5389554e7126.tar.gz |
Replace 0 pointer constants with nullptr
Replaced in most common patterns.
Change-Id: Idcaff1f2e915f29922702d3600a2e5f1e2418a7a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/benchmarks/qml')
-rw-r--r-- | tests/benchmarks/qml/creation/tst_creation.cpp | 2 | ||||
-rw-r--r-- | tests/benchmarks/qml/holistic/testtypes.h | 6 | ||||
-rw-r--r-- | tests/benchmarks/qml/holistic/tst_holistic.cpp | 2 | ||||
-rw-r--r-- | tests/benchmarks/qml/painting/paintbenchmark.cpp | 2 | ||||
-rw-r--r-- | tests/benchmarks/qml/script/tst_script.cpp | 4 | ||||
-rw-r--r-- | tests/benchmarks/qml/typeimports/tst_typeimports.cpp | 8 |
6 files changed, 12 insertions, 12 deletions
diff --git a/tests/benchmarks/qml/creation/tst_creation.cpp b/tests/benchmarks/qml/creation/tst_creation.cpp index 2044360b3d..b200f31f1c 100644 --- a/tests/benchmarks/qml/creation/tst_creation.cpp +++ b/tests/benchmarks/qml/creation/tst_creation.cpp @@ -81,7 +81,7 @@ Q_OBJECT Q_PROPERTY(QQmlListProperty<QObject> resources READ resources) Q_CLASSINFO("DefaultProperty", "resources") public: - TestType(QObject *parent = 0) + TestType(QObject *parent = nullptr) : QObject(parent) {} QQmlListProperty<QObject> resources() { diff --git a/tests/benchmarks/qml/holistic/testtypes.h b/tests/benchmarks/qml/holistic/testtypes.h index 3cf0664ef2..ae56bd6607 100644 --- a/tests/benchmarks/qml/holistic/testtypes.h +++ b/tests/benchmarks/qml/holistic/testtypes.h @@ -186,7 +186,7 @@ class testQObjectApi : public QObject Q_PROPERTY (int qobjectTestProperty READ qobjectTestProperty NOTIFY qobjectTestPropertyChanged) public: - testQObjectApi(QObject* parent = 0) + testQObjectApi(QObject *parent = nullptr) : QObject(parent), m_testProperty(0) { } @@ -209,7 +209,7 @@ class ArbitraryVariantProvider : public QObject Q_PROPERTY(QVariant arbitraryVariant READ arbitraryVariant WRITE setArbitraryVariant NOTIFY arbitraryVariantChanged) public: - ArbitraryVariantProvider(QObject *parent = 0) + ArbitraryVariantProvider(QObject *parent = nullptr) : QObject(parent), m_value(QVariant(QString(QLatin1String("random string value")))), m_count(1) { } @@ -290,7 +290,7 @@ class ScarceResourceProvider : public QObject Q_PROPERTY(QPixmap largeScarceResource READ largeScarceResource WRITE setLargeScarceResource NOTIFY largeScarceResourceChanged) public: - ScarceResourceProvider(QObject *parent = 0) + ScarceResourceProvider(QObject *parent = nullptr) : QObject(parent), m_small(100, 100), m_large(1000, 1000), m_colour(1) { m_small.fill(Qt::blue); diff --git a/tests/benchmarks/qml/holistic/tst_holistic.cpp b/tests/benchmarks/qml/holistic/tst_holistic.cpp index 9186816a16..5fc4138cc6 100644 --- a/tests/benchmarks/qml/holistic/tst_holistic.cpp +++ b/tests/benchmarks/qml/holistic/tst_holistic.cpp @@ -506,7 +506,7 @@ void tst_holistic::cppToJsIndirect() QQmlComponent c(&engine, QString(SRCDIR + QLatin1String("/data/scopeSwitching/ScarceTwo.qml"))); QObject *obj = c.create(); - ScarceResourceProvider *srp = 0; + ScarceResourceProvider *srp = nullptr; srp = qobject_cast<ScarceResourceProvider*>(QQmlProperty::read(obj, "a").value<QObject*>()); QBENCHMARK { diff --git a/tests/benchmarks/qml/painting/paintbenchmark.cpp b/tests/benchmarks/qml/painting/paintbenchmark.cpp index 5b1e908afd..5b4eeae307 100644 --- a/tests/benchmarks/qml/painting/paintbenchmark.cpp +++ b/tests/benchmarks/qml/painting/paintbenchmark.cpp @@ -46,7 +46,7 @@ const int spacing = 36; QSizeF size(1000, 800); const qreal lineWidth = 1000; QString strings[lines]; -QOpenGLWidget *testWidget = 0; +QOpenGLWidget *testWidget = nullptr; void paint_QTextLayout(QPainter &p, bool useCache) { diff --git a/tests/benchmarks/qml/script/tst_script.cpp b/tests/benchmarks/qml/script/tst_script.cpp index a48d6bdec7..0233398481 100644 --- a/tests/benchmarks/qml/script/tst_script.cpp +++ b/tests/benchmarks/qml/script/tst_script.cpp @@ -106,7 +106,7 @@ class TestObject : public QObject Q_PROPERTY(int x READ x WRITE setX) public: - TestObject(QObject *parent = 0); + TestObject(QObject *parent = nullptr); int x(); void setX(int x) { m_x = x; } @@ -199,7 +199,7 @@ void tst_script::property_getter() } } -static TestObject *property_getter_qobject_object = 0; +static TestObject *property_getter_qobject_object = nullptr; static QJSValue property_getter_qobject_method(QScriptContext *, QJSEngine *) { static int idx = -1; diff --git a/tests/benchmarks/qml/typeimports/tst_typeimports.cpp b/tests/benchmarks/qml/typeimports/tst_typeimports.cpp index 9c1698dc3e..151ba46ccc 100644 --- a/tests/benchmarks/qml/typeimports/tst_typeimports.cpp +++ b/tests/benchmarks/qml/typeimports/tst_typeimports.cpp @@ -51,7 +51,7 @@ class TestType1 : public QObject Q_PROPERTY(QQmlListProperty<QObject> resources READ resources); Q_CLASSINFO("DefaultProperty", "resources"); public: - TestType1(QObject *parent = 0) : QObject(parent) {} + TestType1(QObject *parent = nullptr) : QObject(parent) {} QQmlListProperty<QObject> resources() { return QQmlListProperty<QObject>(this, 0, resources_append, 0, 0, 0); @@ -66,7 +66,7 @@ class TestType2 : public TestType1 { Q_OBJECT public: - TestType2(QObject *parent = 0) : TestType1(parent) {} + TestType2(QObject *parent = nullptr) : TestType1(parent) {} }; @@ -74,14 +74,14 @@ class TestType3 : public TestType1 { Q_OBJECT public: - TestType3(QObject *parent = 0) : TestType1(parent) {} + TestType3(QObject *parent = nullptr) : TestType1(parent) {} }; class TestType4 : public TestType1 { Q_OBJECT public: - TestType4(QObject *parent = 0) : TestType1(parent) {} + TestType4(QObject *parent = nullptr) : TestType1(parent) {} }; |