aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlproperty
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-02-21 10:41:54 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-02-26 07:13:18 +0000
commit499ec43937e926e4f2fa57a9baa455fcb3862262 (patch)
tree206c90d47387f8322b68f5e3db613189397e1af3 /tests/auto/qml/qqmlproperty
parent53d1e9ed21d25e65a2f13606af479838f5f21fe7 (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/qqmlproperty')
-rw-r--r--tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp248
1 files changed, 124 insertions, 124 deletions
diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
index 84a1bd9cc5..128dc21b9a 100644
--- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
+++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
@@ -44,7 +44,7 @@ class MyQmlObject : public QObject
Q_OBJECT
Q_PROPERTY(QPoint pointProperty MEMBER m_point)
public:
- MyQmlObject(QObject *parent = 0) : QObject(parent) {}
+ MyQmlObject(QObject *parent = nullptr) : QObject(parent) {}
private:
QPoint m_point;
@@ -56,7 +56,7 @@ class MyQObject : public QObject
{
Q_OBJECT
public:
- MyQObject(QObject *parent = 0) : QObject(parent), m_i(0) {}
+ MyQObject(QObject *parent = nullptr) : QObject(parent), m_i(0) {}
int inc() { return ++m_i; }
@@ -158,21 +158,21 @@ void tst_qqmlproperty::qmlmetaproperty()
QObject *obj = new QObject;
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(nullptr, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(nullptr, QLatin1String("null"), nullptr, QQmlContextData::get(engine.rootContext())));
QVERIFY(binding);
- QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(obj, QObjectPrivate::get(obj)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
+ QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(obj, QObjectPrivate::get(obj)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
- QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
+ QVERIFY(sigExpr != nullptr && !sigExprWatcher.wasDeleted());
QCOMPARE(prop.name(), QString());
QCOMPARE(prop.read(), QVariant());
QCOMPARE(prop.write(QVariant()), false);
QCOMPARE(prop.hasNotifySignal(), false);
QCOMPARE(prop.needsNotifySignal(), false);
- QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, 0), false);
- QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, -1), false);
QVERIFY(!prop.method().isValid());
@@ -183,10 +183,10 @@ void tst_qqmlproperty::qmlmetaproperty()
QCOMPARE(prop.isResettable(), false);
QCOMPARE(prop.isSignalProperty(), false);
QCOMPARE(prop.isValid(), false);
- QCOMPARE(prop.object(), (QObject *)0);
+ QCOMPARE(prop.object(), (QObject *)nullptr);
QCOMPARE(prop.propertyTypeCategory(), QQmlProperty::InvalidCategory);
QCOMPARE(prop.propertyType(), 0);
- QCOMPARE(prop.propertyTypeName(), (const char *)0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)nullptr);
QVERIFY(!prop.property().name());
QVERIFY(!QQmlPropertyPrivate::binding(prop));
QQmlPropertyPrivate::setBinding(prop, binding.data());
@@ -333,7 +333,7 @@ class PropertyObject : public QObject
Q_CLASSINFO("DefaultProperty", "defaultProperty")
public:
- PropertyObject() : m_resetProperty(9), m_qObject(0), m_stringProperty("foo") {}
+ PropertyObject() : m_resetProperty(9), m_qObject(nullptr), m_stringProperty("foo") {}
int defaultProperty() { return 10; }
QRect rectProperty() { return QRect(10, 10, 1, 209); }
@@ -400,11 +400,11 @@ void tst_qqmlproperty::qmlmetaproperty_object()
{
QQmlProperty prop(&object);
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), nullptr, QQmlContextData::get(engine.rootContext())));
QVERIFY(binding);
- QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
+ QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
- QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
+ QVERIFY(sigExpr != nullptr && !sigExprWatcher.wasDeleted());
QObject *obj = new QObject;
@@ -413,10 +413,10 @@ void tst_qqmlproperty::qmlmetaproperty_object()
QCOMPARE(prop.write(QVariant()), false);
QCOMPARE(prop.hasNotifySignal(), false);
QCOMPARE(prop.needsNotifySignal(), false);
- QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, 0), false);
- QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, -1), false);
QVERIFY(!prop.method().isValid());
@@ -427,10 +427,10 @@ void tst_qqmlproperty::qmlmetaproperty_object()
QCOMPARE(prop.isResettable(), false);
QCOMPARE(prop.isSignalProperty(), false);
QCOMPARE(prop.isValid(), false);
- QCOMPARE(prop.object(), (QObject *)0);
+ QCOMPARE(prop.object(), (QObject *)nullptr);
QCOMPARE(prop.propertyTypeCategory(), QQmlProperty::InvalidCategory);
QCOMPARE(prop.propertyType(), 0);
- QCOMPARE(prop.propertyTypeName(), (const char *)0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)nullptr);
QVERIFY(!prop.property().name());
QVERIFY(!QQmlPropertyPrivate::binding(prop));
QQmlPropertyPrivate::setBinding(prop, binding.data());
@@ -448,12 +448,12 @@ void tst_qqmlproperty::qmlmetaproperty_object()
{
QQmlProperty prop(&dobject);
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), nullptr, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
- QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
+ QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
- QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
+ QVERIFY(sigExpr != nullptr && !sigExprWatcher.wasDeleted());
QObject *obj = new QObject;
@@ -462,10 +462,10 @@ void tst_qqmlproperty::qmlmetaproperty_object()
QCOMPARE(prop.write(QVariant()), false);
QCOMPARE(prop.hasNotifySignal(), false);
QCOMPARE(prop.needsNotifySignal(), true);
- QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, 0), false);
- QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, -1), false);
QVERIFY(!prop.method().isValid());
@@ -505,11 +505,11 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
{
QQmlProperty prop(&object, QString("defaultProperty"));
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), nullptr, QQmlContextData::get(engine.rootContext())));
QVERIFY(binding);
- QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
+ QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
- QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
+ QVERIFY(sigExpr != nullptr && !sigExprWatcher.wasDeleted());
QObject *obj = new QObject;
@@ -518,10 +518,10 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
QCOMPARE(prop.write(QVariant()), false);
QCOMPARE(prop.hasNotifySignal(), false);
QCOMPARE(prop.needsNotifySignal(), false);
- QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, 0), false);
- QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, -1), false);
QVERIFY(!prop.method().isValid());
@@ -532,10 +532,10 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
QCOMPARE(prop.isResettable(), false);
QCOMPARE(prop.isSignalProperty(), false);
QCOMPARE(prop.isValid(), false);
- QCOMPARE(prop.object(), (QObject *)0);
+ QCOMPARE(prop.object(), (QObject *)nullptr);
QCOMPARE(prop.propertyTypeCategory(), QQmlProperty::InvalidCategory);
QCOMPARE(prop.propertyType(), 0);
- QCOMPARE(prop.propertyTypeName(), (const char *)0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)nullptr);
QVERIFY(!prop.property().name());
QVERIFY(!QQmlPropertyPrivate::binding(prop));
QQmlPropertyPrivate::setBinding(prop, binding.data());
@@ -553,12 +553,12 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
{
QQmlProperty prop(&dobject, QString("defaultProperty"));
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), nullptr, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
- QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
+ QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
- QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
+ QVERIFY(sigExpr != nullptr && !sigExprWatcher.wasDeleted());
QObject *obj = new QObject;
@@ -567,10 +567,10 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
QCOMPARE(prop.write(QVariant()), false);
QCOMPARE(prop.hasNotifySignal(), false);
QCOMPARE(prop.needsNotifySignal(), true);
- QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, 0), false);
- QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, -1), false);
QVERIFY(!prop.method().isValid());
@@ -604,12 +604,12 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
{
QQmlProperty prop(&dobject, QString("onClicked"));
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), nullptr, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
- QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
+ QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
- QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
+ QVERIFY(sigExpr != nullptr && !sigExprWatcher.wasDeleted());
QObject *obj = new QObject;
@@ -618,10 +618,10 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
QCOMPARE(prop.write(QVariant("Hello")), false);
QCOMPARE(prop.hasNotifySignal(), false);
QCOMPARE(prop.needsNotifySignal(), false);
- QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, 0), false);
- QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, -1), false);
QCOMPARE(QString(prop.method().methodSignature()), QString("clicked()"));
@@ -635,8 +635,8 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
QCOMPARE(prop.object(), qobject_cast<QObject*>(&dobject));
QCOMPARE(prop.propertyTypeCategory(), QQmlProperty::InvalidCategory);
QCOMPARE(prop.propertyType(), 0);
- QCOMPARE(prop.propertyTypeName(), (const char *)0);
- QCOMPARE(prop.property().name(), (const char *)0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)nullptr);
+ QCOMPARE(prop.property().name(), (const char *)nullptr);
QVERIFY(!QQmlPropertyPrivate::binding(prop));
QQmlPropertyPrivate::setBinding(prop, binding.data());
QVERIFY(binding->ref == 1);
@@ -654,12 +654,12 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
{
QQmlProperty prop(&dobject, QString("onPropertyWithNotifyChanged"));
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), nullptr, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
- QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
+ QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
- QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
+ QVERIFY(sigExpr != nullptr && !sigExprWatcher.wasDeleted());
QObject *obj = new QObject;
@@ -668,10 +668,10 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
QCOMPARE(prop.write(QVariant("Hello")), false);
QCOMPARE(prop.hasNotifySignal(), false);
QCOMPARE(prop.needsNotifySignal(), false);
- QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, 0), false);
- QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, -1), false);
QCOMPARE(QString(prop.method().methodSignature()), QString("oddlyNamedNotifySignal()"));
@@ -685,8 +685,8 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
QCOMPARE(prop.object(), qobject_cast<QObject*>(&dobject));
QCOMPARE(prop.propertyTypeCategory(), QQmlProperty::InvalidCategory);
QCOMPARE(prop.propertyType(), 0);
- QCOMPARE(prop.propertyTypeName(), (const char *)0);
- QCOMPARE(prop.property().name(), (const char *)0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)nullptr);
+ QCOMPARE(prop.property().name(), (const char *)nullptr);
QVERIFY(!QQmlPropertyPrivate::binding(prop));
QQmlPropertyPrivate::setBinding(prop, binding.data());
QVERIFY(binding->ref == 1);
@@ -710,11 +710,11 @@ void tst_qqmlproperty::qmlmetaproperty_object_context()
{
QQmlProperty prop(&object, engine.rootContext());
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), nullptr, QQmlContextData::get(engine.rootContext())));
QVERIFY(binding);
- QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
+ QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
- QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
+ QVERIFY(sigExpr != nullptr && !sigExprWatcher.wasDeleted());
QObject *obj = new QObject;
@@ -723,10 +723,10 @@ void tst_qqmlproperty::qmlmetaproperty_object_context()
QCOMPARE(prop.write(QVariant()), false);
QCOMPARE(prop.hasNotifySignal(), false);
QCOMPARE(prop.needsNotifySignal(), false);
- QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, 0), false);
- QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, -1), false);
QVERIFY(!prop.method().isValid());
@@ -737,10 +737,10 @@ void tst_qqmlproperty::qmlmetaproperty_object_context()
QCOMPARE(prop.isResettable(), false);
QCOMPARE(prop.isSignalProperty(), false);
QCOMPARE(prop.isValid(), false);
- QCOMPARE(prop.object(), (QObject *)0);
+ QCOMPARE(prop.object(), (QObject *)nullptr);
QCOMPARE(prop.propertyTypeCategory(), QQmlProperty::InvalidCategory);
QCOMPARE(prop.propertyType(), 0);
- QCOMPARE(prop.propertyTypeName(), (const char *)0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)nullptr);
QVERIFY(!prop.property().name());
QVERIFY(!QQmlPropertyPrivate::binding(prop));
QQmlPropertyPrivate::setBinding(prop, binding.data());
@@ -758,12 +758,12 @@ void tst_qqmlproperty::qmlmetaproperty_object_context()
{
QQmlProperty prop(&dobject, engine.rootContext());
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), nullptr, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
- QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
+ QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
- QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
+ QVERIFY(sigExpr != nullptr && !sigExprWatcher.wasDeleted());
QObject *obj = new QObject;
@@ -772,10 +772,10 @@ void tst_qqmlproperty::qmlmetaproperty_object_context()
QCOMPARE(prop.write(QVariant()), false);
QCOMPARE(prop.hasNotifySignal(), false);
QCOMPARE(prop.needsNotifySignal(), true);
- QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, 0), false);
- QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, -1), false);
QVERIFY(!prop.method().isValid());
@@ -815,11 +815,11 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
{
QQmlProperty prop(&object, QString("defaultProperty"), engine.rootContext());
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), nullptr, QQmlContextData::get(engine.rootContext())));
QVERIFY(binding);
- QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
+ QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
- QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
+ QVERIFY(sigExpr != nullptr && !sigExprWatcher.wasDeleted());
QObject *obj = new QObject;
@@ -828,10 +828,10 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
QCOMPARE(prop.write(QVariant()), false);
QCOMPARE(prop.hasNotifySignal(), false);
QCOMPARE(prop.needsNotifySignal(), false);
- QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, 0), false);
- QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, -1), false);
QVERIFY(!prop.method().isValid());
@@ -842,10 +842,10 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
QCOMPARE(prop.isResettable(), false);
QCOMPARE(prop.isSignalProperty(), false);
QCOMPARE(prop.isValid(), false);
- QCOMPARE(prop.object(), (QObject *)0);
+ QCOMPARE(prop.object(), (QObject *)nullptr);
QCOMPARE(prop.propertyTypeCategory(), QQmlProperty::InvalidCategory);
QCOMPARE(prop.propertyType(), 0);
- QCOMPARE(prop.propertyTypeName(), (const char *)0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)nullptr);
QVERIFY(!prop.property().name());
QVERIFY(!QQmlPropertyPrivate::binding(prop));
QQmlPropertyPrivate::setBinding(prop, binding.data());
@@ -863,12 +863,12 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
{
QQmlProperty prop(&dobject, QString("defaultProperty"), engine.rootContext());
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), nullptr, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
- QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
+ QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
- QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
+ QVERIFY(sigExpr != nullptr && !sigExprWatcher.wasDeleted());
QObject *obj = new QObject;
@@ -877,10 +877,10 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
QCOMPARE(prop.write(QVariant()), false);
QCOMPARE(prop.hasNotifySignal(), false);
QCOMPARE(prop.needsNotifySignal(), true);
- QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, 0), false);
- QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, -1), false);
QVERIFY(!prop.method().isValid());
@@ -914,12 +914,12 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
{
QQmlProperty prop(&dobject, QString("onClicked"), engine.rootContext());
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), nullptr, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
- QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
+ QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
- QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
+ QVERIFY(sigExpr != nullptr && !sigExprWatcher.wasDeleted());
QObject *obj = new QObject;
@@ -928,10 +928,10 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
QCOMPARE(prop.write(QVariant("Hello")), false);
QCOMPARE(prop.hasNotifySignal(), false);
QCOMPARE(prop.needsNotifySignal(), false);
- QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, 0), false);
- QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, -1), false);
QCOMPARE(QString(prop.method().methodSignature()), QString("clicked()"));
@@ -945,8 +945,8 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
QCOMPARE(prop.object(), qobject_cast<QObject*>(&dobject));
QCOMPARE(prop.propertyTypeCategory(), QQmlProperty::InvalidCategory);
QCOMPARE(prop.propertyType(), 0);
- QCOMPARE(prop.propertyTypeName(), (const char *)0);
- QCOMPARE(prop.property().name(), (const char *)0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)nullptr);
+ QCOMPARE(prop.property().name(), (const char *)nullptr);
QVERIFY(!QQmlPropertyPrivate::binding(prop));
QQmlPropertyPrivate::setBinding(prop, binding.data());
QVERIFY(binding->ref == 1);
@@ -964,12 +964,12 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
{
QQmlProperty prop(&dobject, QString("onPropertyWithNotifyChanged"), engine.rootContext());
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), nullptr, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
- QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
+ QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
- QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
+ QVERIFY(sigExpr != nullptr && !sigExprWatcher.wasDeleted());
QObject *obj = new QObject;
@@ -978,10 +978,10 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
QCOMPARE(prop.write(QVariant("Hello")), false);
QCOMPARE(prop.hasNotifySignal(), false);
QCOMPARE(prop.needsNotifySignal(), false);
- QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
QCOMPARE(prop.connectNotifySignal(obj, 0), false);
- QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(nullptr, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
QCOMPARE(prop.connectNotifySignal(obj, -1), false);
QCOMPARE(QString(prop.method().methodSignature()), QString("oddlyNamedNotifySignal()"));
@@ -995,8 +995,8 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
QCOMPARE(prop.object(), qobject_cast<QObject*>(&dobject));
QCOMPARE(prop.propertyTypeCategory(), QQmlProperty::InvalidCategory);
QCOMPARE(prop.propertyType(), 0);
- QCOMPARE(prop.propertyTypeName(), (const char *)0);
- QCOMPARE(prop.property().name(), (const char *)0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)nullptr);
+ QCOMPARE(prop.property().name(), (const char *)nullptr);
QVERIFY(!QQmlPropertyPrivate::binding(prop));
QQmlPropertyPrivate::setBinding(prop, binding.data());
QVERIFY(binding->ref == 1);
@@ -1062,7 +1062,7 @@ void tst_qqmlproperty::name()
}
{
- QQmlProperty p(0, "foo");
+ QQmlProperty p(nullptr, "foo");
QCOMPARE(p.name(), QString());
}
@@ -1150,8 +1150,8 @@ void tst_qqmlproperty::read()
QQmlProperty p(&o, "onClicked");
QCOMPARE(p.read(), QVariant());
- QQmlPropertyPrivate::takeSignalExpression(p, new QQmlBoundSignalExpression(&o, QQmlPropertyPrivate::get(p)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1));
- QVERIFY(0 != QQmlPropertyPrivate::signalExpression(p));
+ QQmlPropertyPrivate::takeSignalExpression(p, new QQmlBoundSignalExpression(&o, QQmlPropertyPrivate::get(p)->signalIndex(), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1));
+ QVERIFY(nullptr != QQmlPropertyPrivate::signalExpression(p));
QCOMPARE(p.read(), QVariant());
}
@@ -1162,8 +1162,8 @@ void tst_qqmlproperty::read()
QQmlProperty p(&o, "onPropertyWithNotifyChanged");
QCOMPARE(p.read(), QVariant());
- QQmlPropertyPrivate::takeSignalExpression(p, new QQmlBoundSignalExpression(&o, QQmlPropertyPrivate::get(p)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1));
- QVERIFY(0 != QQmlPropertyPrivate::signalExpression(p));
+ QQmlPropertyPrivate::takeSignalExpression(p, new QQmlBoundSignalExpression(&o, QQmlPropertyPrivate::get(p)->signalIndex(), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1));
+ QVERIFY(nullptr != QQmlPropertyPrivate::signalExpression(p));
QCOMPARE(p.read(), QVariant());
}
@@ -1213,7 +1213,7 @@ void tst_qqmlproperty::read()
{
QQmlComponent component(&engine, testFileUrl("readSynthesizedObject.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QQmlProperty p(object, "test", &engine);
@@ -1228,7 +1228,7 @@ void tst_qqmlproperty::read()
{ // static
QQmlComponent component(&engine, testFileUrl("readSynthesizedObject.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVariant v = QQmlProperty::read(object, "test", &engine);
QCOMPARE(v.userType(), int(QMetaType::QObjectStar));
@@ -1241,7 +1241,7 @@ void tst_qqmlproperty::read()
QQmlComponent component(&engine);
component.setData("import Test 1.0\nMyContainer { }", QUrl());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QQmlProperty p(object, "MyContainer.foo", qmlContext(object));
QCOMPARE(p.read(), QVariant(13));
@@ -1251,7 +1251,7 @@ void tst_qqmlproperty::read()
QQmlComponent component(&engine);
component.setData("import Test 1.0\nMyContainer { MyContainer.foo: 10 }", QUrl());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QQmlProperty p(object, "MyContainer.foo", qmlContext(object));
QCOMPARE(p.read(), QVariant(10));
@@ -1261,7 +1261,7 @@ void tst_qqmlproperty::read()
QQmlComponent component(&engine);
component.setData("import Test 1.0 as Foo\nFoo.MyContainer { Foo.MyContainer.foo: 10 }", QUrl());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QQmlProperty p(object, "Foo.MyContainer.foo", qmlContext(object));
QCOMPARE(p.read(), QVariant(10));
@@ -1271,7 +1271,7 @@ void tst_qqmlproperty::read()
QQmlComponent component(&engine);
component.setData("import Test 1.0 as Foo\nFoo.MyContainer { Foo.MyContainer.foo: 10 }", QUrl());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(QQmlProperty::read(object, "Foo.MyContainer.foo", qmlContext(object)), QVariant(10));
delete object;
@@ -1341,12 +1341,12 @@ void tst_qqmlproperty::write()
QQmlProperty p(&o, "onClicked");
QCOMPARE(p.write(QVariant("console.log(1921)")), false);
- QQmlPropertyPrivate::takeSignalExpression(p, new QQmlBoundSignalExpression(&o, QQmlPropertyPrivate::get(p)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1));
- QVERIFY(0 != QQmlPropertyPrivate::signalExpression(p));
+ QQmlPropertyPrivate::takeSignalExpression(p, new QQmlBoundSignalExpression(&o, QQmlPropertyPrivate::get(p)->signalIndex(), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1));
+ QVERIFY(nullptr != QQmlPropertyPrivate::signalExpression(p));
QCOMPARE(p.write(QVariant("console.log(1921)")), false);
- QVERIFY(0 != QQmlPropertyPrivate::signalExpression(p));
+ QVERIFY(nullptr != QQmlPropertyPrivate::signalExpression(p));
}
// Automatic signal property
@@ -1355,12 +1355,12 @@ void tst_qqmlproperty::write()
QQmlProperty p(&o, "onPropertyWithNotifyChanged");
QCOMPARE(p.write(QVariant("console.log(1921)")), false);
- QQmlPropertyPrivate::takeSignalExpression(p, new QQmlBoundSignalExpression(&o, QQmlPropertyPrivate::get(p)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1));
- QVERIFY(0 != QQmlPropertyPrivate::signalExpression(p));
+ QQmlPropertyPrivate::takeSignalExpression(p, new QQmlBoundSignalExpression(&o, QQmlPropertyPrivate::get(p)->signalIndex(), QQmlContextData::get(engine.rootContext()), nullptr, QLatin1String("null"), QString(), -1, -1));
+ QVERIFY(nullptr != QQmlPropertyPrivate::signalExpression(p));
QCOMPARE(p.write(QVariant("console.log(1921)")), false);
- QVERIFY(0 != QQmlPropertyPrivate::signalExpression(p));
+ QVERIFY(nullptr != QQmlPropertyPrivate::signalExpression(p));
}
// Value-type property
@@ -1436,7 +1436,7 @@ void tst_qqmlproperty::write()
QQmlComponent component(&engine);
component.setData("import Test 1.0\nPropertyObject { stringProperty: constQChar }", QUrl());
PropertyObject *obj = qobject_cast<PropertyObject*>(component.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
if (obj) {
QQmlProperty stringProperty(obj, "stringProperty");
QCOMPARE(stringProperty.read(), QVariant(QString(obj->constQChar())));
@@ -1476,7 +1476,7 @@ void tst_qqmlproperty::write()
QQmlComponent component(&engine);
component.setData("import Test 1.0\nMyContainer { }", QUrl());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QQmlProperty p(object, "MyContainer.foo", qmlContext(object));
p.write(QVariant(99));
@@ -1487,7 +1487,7 @@ void tst_qqmlproperty::write()
QQmlComponent component(&engine);
component.setData("import Test 1.0 as Foo\nFoo.MyContainer { Foo.MyContainer.foo: 10 }", QUrl());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QQmlProperty p(object, "Foo.MyContainer.foo", qmlContext(object));
p.write(QVariant(99));
@@ -1498,7 +1498,7 @@ void tst_qqmlproperty::write()
{
PropertyObject o;
QQmlProperty p(&o, QString("qObject"));
- QCOMPARE(o.qObject(), (QObject*)0);
+ QCOMPARE(o.qObject(), (QObject*)nullptr);
QObject *newObject = new MyQObject(this);
QCOMPARE(p.write(QVariant::fromValue(newObject)), true);
QCOMPARE(o.qObject(), newObject);
@@ -1515,7 +1515,7 @@ void tst_qqmlproperty::write()
QQmlEngine engine;
PropertyObject o;
QQmlProperty p(&o, QString("qObject"), &engine);
- QCOMPARE(o.qObject(), (QObject*)0);
+ QCOMPARE(o.qObject(), (QObject*)nullptr);
QObject *newObject = new MyQObject(this);
QCOMPARE(p.write(QVariant::fromValue(newObject)), true);
QCOMPARE(o.qObject(), newObject);
@@ -1617,7 +1617,7 @@ void tst_qqmlproperty::writeObjectToList()
QQmlComponent containerComponent(&engine);
containerComponent.setData("import Test 1.0\nMyContainer { children: MyQmlObject {} }", QUrl());
MyContainer *container = qobject_cast<MyContainer*>(containerComponent.create());
- QVERIFY(container != 0);
+ QVERIFY(container != nullptr);
QQmlListReference list(container, "children");
QCOMPARE(list.count(), 1);
@@ -1633,7 +1633,7 @@ void tst_qqmlproperty::writeListToList()
QQmlComponent containerComponent(&engine);
containerComponent.setData("import Test 1.0\nMyContainer { children: MyQmlObject {} }", QUrl());
MyContainer *container = qobject_cast<MyContainer*>(containerComponent.create());
- QVERIFY(container != 0);
+ QVERIFY(container != nullptr);
QQmlListReference list(container, "children");
QCOMPARE(list.count(), 1);
@@ -1817,7 +1817,7 @@ void tst_qqmlproperty::crashOnValueProperty()
component.setData("import Test 1.0\nPropertyObject { wrectProperty.x: 10 }", QUrl());
PropertyObject *obj = qobject_cast<PropertyObject*>(component.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QQmlProperty p(obj, "wrectProperty.x", qmlContext(obj));
QCOMPARE(p.name(), QString("wrectProperty.x"));
@@ -1826,7 +1826,7 @@ void tst_qqmlproperty::crashOnValueProperty()
//don't crash once the engine is deleted
delete engine;
- engine = 0;
+ engine = nullptr;
QCOMPARE(p.propertyTypeName(), "int");
QCOMPARE(p.read(), QVariant(10));
@@ -1852,7 +1852,7 @@ void tst_qqmlproperty::aliasPropertyBindings()
QQmlComponent component(&engine, testFileUrl(file));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// the object where realProperty lives
QObject *realPropertyObject = object;
@@ -1871,8 +1871,8 @@ void tst_qqmlproperty::aliasPropertyBindings()
QQmlProperty aliasProperty(object, QLatin1String("aliasProperty"));
// Check there is a binding on these two properties
- QVERIFY(QQmlPropertyPrivate::binding(realProperty) != 0);
- QVERIFY(QQmlPropertyPrivate::binding(aliasProperty) != 0);
+ QVERIFY(QQmlPropertyPrivate::binding(realProperty) != nullptr);
+ QVERIFY(QQmlPropertyPrivate::binding(aliasProperty) != nullptr);
// Check that its the same binding on these two properties
QCOMPARE(QQmlPropertyPrivate::binding(realProperty),
@@ -1881,8 +1881,8 @@ void tst_qqmlproperty::aliasPropertyBindings()
// Change the binding
object->setProperty("state", QString("switch"));
- QVERIFY(QQmlPropertyPrivate::binding(realProperty) != 0);
- QVERIFY(QQmlPropertyPrivate::binding(aliasProperty) != 0);
+ QVERIFY(QQmlPropertyPrivate::binding(realProperty) != nullptr);
+ QVERIFY(QQmlPropertyPrivate::binding(aliasProperty) != nullptr);
QCOMPARE(QQmlPropertyPrivate::binding(realProperty),
QQmlPropertyPrivate::binding(aliasProperty));
@@ -1903,8 +1903,8 @@ void tst_qqmlproperty::aliasPropertyBindings()
// Revert
object->setProperty("state", QString(""));
- QVERIFY(QQmlPropertyPrivate::binding(realProperty) != 0);
- QVERIFY(QQmlPropertyPrivate::binding(aliasProperty) != 0);
+ QVERIFY(QQmlPropertyPrivate::binding(realProperty) != nullptr);
+ QVERIFY(QQmlPropertyPrivate::binding(aliasProperty) != nullptr);
QCOMPARE(QQmlPropertyPrivate::binding(realProperty),
QQmlPropertyPrivate::binding(aliasProperty));
@@ -1946,7 +1946,7 @@ void tst_qqmlproperty::copy()
QCOMPARE(p2.propertyTypeCategory(), QQmlProperty::Normal);
QCOMPARE(p2.propertyType(), (int)QVariant::Int);
- delete property; property = 0;
+ delete property; property = nullptr;
QCOMPARE(p1.name(), QString("defaultProperty"));
QCOMPARE(p1.read(), QVariant(10));
@@ -1967,9 +1967,9 @@ void tst_qqmlproperty::noContext()
QQmlComponent compB(&engine, testFileUrl("NoContextTypeB.qml"));
QObject *a = compA.create();
- QVERIFY(a != 0);
+ QVERIFY(a != nullptr);
QObject *b = compB.create();
- QVERIFY(b != 0);
+ QVERIFY(b != nullptr);
QVERIFY(QQmlProperty::write(b, "myTypeA", QVariant::fromValue(a), &engine));
@@ -2037,7 +2037,7 @@ void tst_qqmlproperty::readOnlyDynamicProperties()
{
QQmlComponent comp(&engine, testFileUrl("readonlyPrimitiveVsVar.qml"));
QObject *obj = comp.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QVERIFY(!obj->metaObject()->property(obj->metaObject()->indexOfProperty("r_var")).isWritable());
QVERIFY(!obj->metaObject()->property(obj->metaObject()->indexOfProperty("r_int")).isWritable());
@@ -2066,7 +2066,7 @@ void tst_qqmlproperty::floatToStringPrecision()
{
QQmlComponent comp(&engine, testFileUrl("floatToStringPrecision.qml"));
QObject *obj = comp.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QFETCH(QString, propertyName);
QFETCH(double, number);