aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qjsengine/tst_qjsengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qjsengine/tst_qjsengine.cpp')
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index 519c57efb2..b34aaea61c 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -615,10 +615,10 @@ void tst_QJSEngine::newQObject()
QObject temp;
{
- QJSValue qobject = eng.newQObject(0);
+ QJSValue qobject = eng.newQObject(nullptr);
QCOMPARE(qobject.isNull(), true);
QCOMPARE(qobject.isObject(), false);
- QCOMPARE(qobject.toQObject(), (QObject *)0);
+ QCOMPARE(qobject.toQObject(), (QObject *)nullptr);
}
{
QJSValue qobject = eng.newQObject(&temp);
@@ -639,7 +639,7 @@ void tst_QJSEngine::newQObject_ownership()
QJSEngine eng;
{
QPointer<QObject> ptr = new QObject();
- QVERIFY(ptr != 0);
+ QVERIFY(ptr != nullptr);
{
QJSValue v = eng.newQObject(ptr);
}
@@ -650,7 +650,7 @@ void tst_QJSEngine::newQObject_ownership()
}
{
QPointer<QObject> ptr = new QObject(this);
- QVERIFY(ptr != 0);
+ QVERIFY(ptr != nullptr);
{
QJSValue v = eng.newQObject(ptr);
}
@@ -665,11 +665,11 @@ void tst_QJSEngine::newQObject_ownership()
QJSValue v = eng.newQObject(child);
QCOMPARE(v.toQObject(), child);
delete parent;
- QCOMPARE(v.toQObject(), (QObject *)0);
+ QCOMPARE(v.toQObject(), (QObject *)nullptr);
}
{
QPointer<QObject> ptr = new QObject();
- QVERIFY(ptr != 0);
+ QVERIFY(ptr != nullptr);
{
QJSValue v = eng.newQObject(ptr);
}
@@ -682,18 +682,18 @@ void tst_QJSEngine::newQObject_ownership()
{
QObject *parent = new QObject();
QPointer<QObject> child = new QObject(parent);
- QVERIFY(child != 0);
+ QVERIFY(child != nullptr);
{
QJSValue v = eng.newQObject(child);
}
eng.collectGarbage();
// has parent, so it should be like QtOwnership
- QVERIFY(child != 0);
+ QVERIFY(child != nullptr);
delete parent;
}
{
QPointer<QObject> ptr = new QObject();
- QVERIFY(ptr != 0);
+ QVERIFY(ptr != nullptr);
{
QQmlEngine::setObjectOwnership(ptr.data(), QQmlEngine::CppOwnership);
QJSValue v = eng.newQObject(ptr);
@@ -1377,7 +1377,7 @@ void tst_QJSEngine::valueConversion_basic()
QCOMPARE(eng.fromScriptValue<QChar>(eng.toScriptValue(c)), c);
}
- QVERIFY(eng.toScriptValue(static_cast<void *>(0)).isNull());
+ QVERIFY(eng.toScriptValue(static_cast<void *>(nullptr)).isNull());
}
void tst_QJSEngine::valueConversion_QVariant()
@@ -1463,7 +1463,7 @@ void tst_QJSEngine::valueConversion_QVariant()
QCOMPARE(qjsvalue_cast<QVariant>(QJSValue(123)), QVariant(123));
- QVERIFY(eng.toScriptValue(QVariant(QMetaType::VoidStar, 0)).isNull());
+ QVERIFY(eng.toScriptValue(QVariant(QMetaType::VoidStar, nullptr)).isNull());
QVERIFY(eng.toScriptValue(QVariant::fromValue(nullptr)).isNull());
{
@@ -1574,7 +1574,7 @@ class Klazz : public QWidget,
Q_INTERFACES(QGraphicsItem)
Q_OBJECT
public:
- Klazz(QWidget *parent = 0) : QWidget(parent) { }
+ Klazz(QWidget *parent = nullptr) : QWidget(parent) { }
virtual QRectF boundingRect() const { return QRectF(); }
virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) { }
};
@@ -1603,7 +1603,7 @@ void tst_QJSEngine::collectGarbage()
a = eng.newObject();
a = eng.newObject();
QPointer<QObject> ptr = new QObject();
- QVERIFY(ptr != 0);
+ QVERIFY(ptr != nullptr);
(void)eng.newQObject(ptr);
eng.collectGarbage();
if (ptr)
@@ -3372,7 +3372,7 @@ void tst_QJSEngine::dynamicProperties()
QQmlEngine qmlEngine;
QQmlComponent component(&qmlEngine);
component.setData("import QtQml 2.0; QtObject { property QtObject subObject: QtObject {} }", QUrl());
- QObject *root = component.create(0);
+ QObject *root = component.create(nullptr);
QVERIFY(root);
QVERIFY(qmlContext(root));