aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
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
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')
-rw-r--r--tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp2
-rw-r--r--tests/auto/qml/bindingdependencyapi/tst_bindingdependencyapi.cpp8
-rw-r--r--tests/auto/qml/debugger/qpacketprotocol/tst_qpacketprotocol.cpp2
-rw-r--r--tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp8
-rw-r--r--tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp4
-rw-r--r--tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp14
-rw-r--r--tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp24
-rw-r--r--tests/auto/qml/debugger/qqmlnativeconnector/tst_qqmlnativeconnector.cpp2
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp2
-rw-r--r--tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp8
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp28
-rw-r--r--tests/auto/qml/qjsvalue/tst_qjsvalue.cpp40
-rw-r--r--tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp26
-rw-r--r--tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp36
-rw-r--r--tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp32
-rw-r--r--tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp12
-rw-r--r--tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp42
-rw-r--r--tests/auto/qml/qqmlcpputils/tst_qqmlcpputils.cpp2
-rw-r--r--tests/auto/qml/qqmlecmascript/testtypes.cpp16
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp762
-rw-r--r--tests/auto/qml/qqmlengine/tst_qqmlengine.cpp54
-rw-r--r--tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp6
-rw-r--r--tests/auto/qml/qqmlexpression/tst_qqmlexpression.cpp8
-rw-r--r--tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp6
-rw-r--r--tests/auto/qml/qqmlincubator/testtypes.cpp28
-rw-r--r--tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp84
-rw-r--r--tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp48
-rw-r--r--tests/auto/qml/qqmlinstantiator/tst_qqmlinstantiator.cpp18
-rw-r--r--tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp4
-rw-r--r--tests/auto/qml/qqmllanguage/testtypes.cpp4
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp404
-rw-r--r--tests/auto/qml/qqmllistcompositor/tst_qqmllistcompositor.cpp120
-rw-r--r--tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp30
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp22
-rw-r--r--tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp36
-rw-r--r--tests/auto/qml/qqmllocale/tst_qqmllocale.cpp8
-rw-r--r--tests/auto/qml/qqmlmetaobject/tst_qqmlmetaobject.cpp8
-rw-r--r--tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/plugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/plugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp4
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/nonstrictModule/plugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/childplugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/plugin.2.1/plugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/plugin.2.2/plugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/childplugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/plugin.2/plugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/childplugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/plugin/plugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/plugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/plugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/preemptiveModule/plugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/protectedModule/plugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/strictModule.2/plugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/strictModule/plugin.cpp2
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp24
-rw-r--r--tests/auto/qml/qqmlnotifier/tst_qqmlnotifier.cpp16
-rw-r--r--tests/auto/qml/qqmlopenmetaobject/tst_qqmlopenmetaobject.cpp2
-rw-r--r--tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp248
-rw-r--r--tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp6
-rw-r--r--tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp4
-rw-r--r--tests/auto/qml/qqmlqt/tst_qqmlqt.cpp74
-rw-r--r--tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp2
-rw-r--r--tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp2
-rw-r--r--tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp2
-rw-r--r--tests/auto/qml/qqmltimer/tst_qqmltimer.cpp24
-rw-r--r--tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp4
-rw-r--r--tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp6
-rw-r--r--tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp18
-rw-r--r--tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp172
-rw-r--r--tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp20
-rw-r--r--tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp24
-rw-r--r--tests/auto/qml/qtqmlmodules/tst_qtqmlmodules.cpp6
73 files changed, 1325 insertions, 1325 deletions
diff --git a/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp b/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp
index 476ad2e955..bb7e50dbbd 100644
--- a/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp
+++ b/tests/auto/qml/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp
@@ -848,7 +848,7 @@ void tst_QParallelAnimationGroupJob::addAndRemoveDuration()
QCOMPARE(group.duration(), 250);
group.removeAnimation(test); // remove the last one (with duration = 250)
- QCOMPARE(test->group(), static_cast<QAnimationGroupJob*>(0));
+ QCOMPARE(test->group(), static_cast<QAnimationGroupJob*>(nullptr));
QCOMPARE(group.duration(), 0);
delete test;
}
diff --git a/tests/auto/qml/bindingdependencyapi/tst_bindingdependencyapi.cpp b/tests/auto/qml/bindingdependencyapi/tst_bindingdependencyapi.cpp
index 6f24f85f6d..82c997a5b8 100644
--- a/tests/auto/qml/bindingdependencyapi/tst_bindingdependencyapi.cpp
+++ b/tests/auto/qml/bindingdependencyapi/tst_bindingdependencyapi.cpp
@@ -131,7 +131,7 @@ void tst_bindingdependencyapi::testSingleDep()
c.setData(code, QUrl());
QObject *rect = c.create();
QTest::qWait(10);
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QObject *text = rect->findChildren<QQuickText *>().front();
QObject *referencedObject = rect->objectName() == referencedObjectName ? rect : rect->findChild<QObject *>(referencedObjectName);
@@ -213,7 +213,7 @@ void tst_bindingdependencyapi::testManyDeps()
qWarning() << c.errorString();
}
QTest::qWait(100);
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QObject *text = rect->findChildren<QQuickText *>().front();
QObject *configObj = rect->findChild<QObject *>("config");
@@ -290,7 +290,7 @@ void tst_bindingdependencyapi::testConditionalDependencies()
c.setData(code, QUrl());
QObject *rect = c.create();
QTest::qWait(10);
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QObject *text = rect->findChildren<QQuickText *>().front();
QObject *referencedObject = rect->objectName() == referencedObjectName ? rect : rect->findChild<QObject *>(referencedObjectName);
@@ -336,7 +336,7 @@ void tst_bindingdependencyapi::testBindingLoop()
qWarning() << c.errorString();
}
QTest::qWait(100);
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QObject *text = rect->findChildren<QQuickText *>().front();
auto data = QQmlData::get(text);
diff --git a/tests/auto/qml/debugger/qpacketprotocol/tst_qpacketprotocol.cpp b/tests/auto/qml/debugger/qpacketprotocol/tst_qpacketprotocol.cpp
index cadc2a7cc4..21ca921304 100644
--- a/tests/auto/qml/debugger/qpacketprotocol/tst_qpacketprotocol.cpp
+++ b/tests/auto/qml/debugger/qpacketprotocol/tst_qpacketprotocol.cpp
@@ -60,7 +60,7 @@ private slots:
void tst_QPacketProtocol::init()
{
m_server = new QTcpServer(this);
- m_serverConn = 0;
+ m_serverConn = nullptr;
QVERIFY(m_server->listen(QHostAddress("127.0.0.1")));
m_client = new QTcpSocket(this);
diff --git a/tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp b/tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp
index 04bc5c3c1a..452520cf11 100644
--- a/tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp
+++ b/tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp
@@ -72,11 +72,11 @@ void tst_QQmlDebugClient::initTestCase()
m_service = new QQmlDebugTestService("tst_QQmlDebugClient::handshake()");
foreach (const QString &service, QQmlDebuggingEnabler::debuggerServices())
- QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)0);
+ QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)nullptr);
foreach (const QString &service, QQmlDebuggingEnabler::inspectorServices())
- QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)0);
+ QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)nullptr);
foreach (const QString &service, QQmlDebuggingEnabler::profilerServices())
- QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)0);
+ QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)nullptr);
const QString waitingMsg = QString("QML Debugger: Waiting for connection on port %1...").arg(PORT);
QTest::ignoreMessage(QtDebugMsg, waitingMsg.toLatin1().constData());
@@ -126,7 +126,7 @@ void tst_QQmlDebugClient::state()
QQmlDebugClient client2("tst_QQmlDebugClient::state()", m_conn);
QCOMPARE(client2.state(), QQmlDebugClient::NotConnected);
- QQmlDebugClient client3("tst_QQmlDebugClient::state3()", 0);
+ QQmlDebugClient client3("tst_QQmlDebugClient::state3()", nullptr);
QCOMPARE(client3.state(), QQmlDebugClient::NotConnected);
}
diff --git a/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp b/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp
index 4b28857fc0..9f0501241d 100644
--- a/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp
+++ b/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp
@@ -64,7 +64,7 @@ private slots:
void tst_QQmlDebugLocal::initTestCase()
{
- fileName = QString::fromLatin1("tst_QQmlDebugLocal%1").arg(std::time(0));
+ fileName = QString::fromLatin1("tst_QQmlDebugLocal%1").arg(std::time(nullptr));
QQmlDebugConnector::setPluginKey("QQmlDebugServer");
QTest::ignoreMessage(QtWarningMsg,
"QML debugger: Cannot set plugin key after loading the plugin.");
@@ -119,7 +119,7 @@ void tst_QQmlDebugLocal::state()
QQmlDebugClient client2("tst_QQmlDebugLocal::state()", m_conn);
QCOMPARE(client2.state(), QQmlDebugClient::NotConnected);
- QQmlDebugClient client3("tst_QQmlDebugLocal::state3()", 0);
+ QQmlDebugClient client3("tst_QQmlDebugLocal::state3()", nullptr);
QCOMPARE(client3.state(), QQmlDebugClient::NotConnected);
}
diff --git a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
index 4e103e9a65..1daf6b581e 100644
--- a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
+++ b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
@@ -80,11 +80,11 @@ void tst_QQmlDebugService::initTestCase()
m_service = new QQmlDebugTestService("tst_QQmlDebugService", 2);
foreach (const QString &service, QQmlDebuggingEnabler::debuggerServices())
- QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)0);
+ QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)nullptr);
foreach (const QString &service, QQmlDebuggingEnabler::inspectorServices())
- QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)0);
+ QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)nullptr);
foreach (const QString &service, QQmlDebuggingEnabler::profilerServices())
- QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)0);
+ QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)nullptr);
const QString waitingMsg = QString("QML Debugger: Waiting for connection on port %1...").arg(PORT);
QTest::ignoreMessage(QtDebugMsg, waitingMsg.toLatin1().constData());
@@ -209,7 +209,7 @@ void tst_QQmlDebugService::checkSupportForDataStreamVersion()
void tst_QQmlDebugService::idForObject()
{
- QCOMPARE(QQmlDebugService::idForObject(0), -1);
+ QCOMPARE(QQmlDebugService::idForObject(nullptr), -1);
QObject *objA = new QObject;
@@ -231,15 +231,15 @@ void tst_QQmlDebugService::idForObject()
void tst_QQmlDebugService::objectForId()
{
- QCOMPARE(QQmlDebugService::objectForId(-1), static_cast<QObject*>(0));
- QCOMPARE(QQmlDebugService::objectForId(1), static_cast<QObject*>(0));
+ QCOMPARE(QQmlDebugService::objectForId(-1), static_cast<QObject*>(nullptr));
+ QCOMPARE(QQmlDebugService::objectForId(1), static_cast<QObject*>(nullptr));
QObject *obj = new QObject;
int id = QQmlDebugService::idForObject(obj);
QCOMPARE(QQmlDebugService::objectForId(id), obj);
delete obj;
- QCOMPARE(QQmlDebugService::objectForId(id), static_cast<QObject*>(0));
+ QCOMPARE(QQmlDebugService::objectForId(id), static_cast<QObject*>(nullptr));
}
void tst_QQmlDebugService::checkSupportForOldDataStreamVersion()
diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
index 8993ce7cf4..d01d9a6791 100644
--- a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
+++ b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
@@ -77,7 +77,7 @@ class CustomTypes : public QObject
Q_OBJECT
Q_PROPERTY(QModelIndex modelIndex READ modelIndex)
public:
- CustomTypes(QObject *parent = 0) : QObject(parent) {}
+ CustomTypes(QObject *parent = nullptr) : QObject(parent) {}
QModelIndex modelIndex() { return QModelIndex(); }
};
@@ -86,7 +86,7 @@ class tst_QQmlEngineDebugService : public QObject
{
Q_OBJECT
public:
- tst_QQmlEngineDebugService() : m_conn(0), m_dbg(0), m_engine(0), m_rootItem(0) {}
+ tst_QQmlEngineDebugService() : m_conn(nullptr), m_dbg(nullptr), m_engine(nullptr), m_rootItem(nullptr) {}
private:
QmlDebugObjectReference findRootObject(int context = 0,
@@ -445,7 +445,7 @@ void tst_QQmlEngineDebugService::watch_property()
bool success;
- QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
+ QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr);
unconnected->addWatch(prop, &success);
QVERIFY(!success);
delete unconnected;
@@ -489,7 +489,7 @@ void tst_QQmlEngineDebugService::watch_object()
bool success;
- QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
+ QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr);
unconnected->addWatch(obj, &success);
QVERIFY(!success);
delete unconnected;
@@ -555,7 +555,7 @@ void tst_QQmlEngineDebugService::watch_expression()
bool success;
- QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
+ QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr);
unconnected->addWatch(obj, expr, &success);
QVERIFY(!success);
delete unconnected;
@@ -630,7 +630,7 @@ void tst_QQmlEngineDebugService::queryAvailableEngines()
{
bool success;
- QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
+ QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr);
unconnected->queryAvailableEngines(&success);
QVERIFY(!success);
delete unconnected;
@@ -658,7 +658,7 @@ void tst_QQmlEngineDebugService::queryRootContexts()
QVERIFY(m_dbg->engines().count());
int engineId = m_dbg->engines()[0].debugId;
- QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
+ QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr);
unconnected->queryRootContexts(engineId, &success);
QVERIFY(!success);
delete unconnected;
@@ -689,7 +689,7 @@ void tst_QQmlEngineDebugService::queryObject()
QmlDebugObjectReference rootObject = findRootObject();
QVERIFY(!rootObject.className.isEmpty());
- QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
+ QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr);
recursive ? unconnected->queryObjectRecursive(rootObject, &success) : unconnected->queryObject(rootObject, &success);
QVERIFY(!success);
delete unconnected;
@@ -761,7 +761,7 @@ void tst_QQmlEngineDebugService::queryObjectsForLocation()
int lineNumber = rootObject.source.lineNumber;
int columnNumber = rootObject.source.columnNumber;
- QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
+ QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr);
recursive ? unconnected->queryObjectsForLocationRecursive(fileName, lineNumber,
columnNumber, &success)
: unconnected->queryObjectsForLocation(fileName, lineNumber,
@@ -898,7 +898,7 @@ void tst_QQmlEngineDebugService::queryObjectWithNonStreamableTypes()
QmlDebugObjectReference rootObject = findRootObject(4, true);
QVERIFY(!rootObject.className.isEmpty());
- QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
+ QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr);
unconnected->queryObject(rootObject, &success);
QVERIFY(!success);
delete unconnected;
@@ -924,7 +924,7 @@ void tst_QQmlEngineDebugService::queryExpressionResult()
bool success;
- QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
+ QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr);
unconnected->queryExpressionResult(objectId, expr, &success);
QVERIFY(!success);
delete unconnected;
@@ -972,7 +972,7 @@ void tst_QQmlEngineDebugService::queryExpressionResultBC()
bool success;
- QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
+ QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr);
unconnected->queryExpressionResultBC(objectId, expr, &success);
QVERIFY(!success);
delete unconnected;
diff --git a/tests/auto/qml/debugger/qqmlnativeconnector/tst_qqmlnativeconnector.cpp b/tests/auto/qml/debugger/qqmlnativeconnector/tst_qqmlnativeconnector.cpp
index 33d3c6369f..6283a93881 100644
--- a/tests/auto/qml/debugger/qqmlnativeconnector/tst_qqmlnativeconnector.cpp
+++ b/tests/auto/qml/debugger/qqmlnativeconnector/tst_qqmlnativeconnector.cpp
@@ -113,7 +113,7 @@ int main(int argc, char *argv[])
argv2[i] = argv[i];
argv2[argc] = strdup("-qmljsdebugger=native,services:NativeQmlDebugger");
++argc;
- argv2[argc] = 0;
+ argv2[argc] = nullptr;
Application app(argc, argv2);
return QTest::qExec(&app, argc, argv);
}
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
index db28d3202d..cd8e4216f3 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
@@ -344,7 +344,7 @@ bool tst_QQmlProfilerService::verify(tst_QQmlProfilerService::MessageListType ty
int expectedPosition, const QQmlProfilerEventType &expected,
quint32 checks, const QVector<qint64> &expectedNumbers)
{
- const QVector<QQmlProfilerEvent> *target = 0;
+ const QVector<QQmlProfilerEvent> *target = nullptr;
switch (type) {
case MessageListQML: target = &(m_client->qmlMessages); break;
case MessageListJavaScript: target = &(m_client->javascriptMessages); break;
diff --git a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
index b569ad6b3c..5dd62da15a 100644
--- a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
+++ b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
@@ -166,7 +166,7 @@ public:
, m_thrownValue(-1)
, collector(engine)
, m_resumeSpeed(QV4Debugger::FullThrottle)
- , m_debugger(0)
+ , m_debugger(nullptr)
{
}
@@ -355,10 +355,10 @@ void tst_qv4debugger::cleanup()
m_javaScriptThread->wait();
delete m_engine;
delete m_javaScriptThread;
- m_engine = 0;
- m_v4 = 0;
+ m_engine = nullptr;
+ m_v4 = nullptr;
delete m_debuggerAgent;
- m_debuggerAgent = 0;
+ m_debuggerAgent = nullptr;
}
void tst_qv4debugger::breakAnywhere()
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));
diff --git a/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp b/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
index db99c44261..6587408ae4 100644
--- a/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
+++ b/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
@@ -30,7 +30,7 @@
#include <QtWidgets/QPushButton>
tst_QJSValue::tst_QJSValue()
- : engine(0)
+ : engine(nullptr)
{
}
@@ -45,7 +45,7 @@ void tst_QJSValue::ctor_invalid()
{
QJSValue v;
QVERIFY(v.isUndefined());
- QCOMPARE(v.engine(), (QJSEngine *)0);
+ QCOMPARE(v.engine(), (QJSEngine *)nullptr);
}
}
@@ -111,7 +111,7 @@ void tst_QJSValue::ctor_int()
QCOMPARE(v.isNumber(), true);
QCOMPARE(v.isObject(), false);
QCOMPARE(v.toNumber(), 1.0);
- QCOMPARE(v.engine(), (QJSEngine *)0);
+ QCOMPARE(v.engine(), (QJSEngine *)nullptr);
}
}
@@ -141,7 +141,7 @@ void tst_QJSValue::ctor_uint()
QCOMPARE(v.isNumber(), true);
QCOMPARE(v.isObject(), false);
QCOMPARE(v.toNumber(), 1.0);
- QCOMPARE(v.engine(), (QJSEngine *)0);
+ QCOMPARE(v.engine(), (QJSEngine *)nullptr);
}
}
@@ -171,7 +171,7 @@ void tst_QJSValue::ctor_float()
QCOMPARE(v.isNumber(), true);
QCOMPARE(v.isObject(), false);
QCOMPARE(v.toNumber(), 1.0);
- QCOMPARE(v.engine(), (QJSEngine *)0);
+ QCOMPARE(v.engine(), (QJSEngine *)nullptr);
}
}
@@ -196,7 +196,7 @@ void tst_QJSValue::ctor_string()
QCOMPARE(v.isString(), true);
QCOMPARE(v.isObject(), false);
QCOMPARE(v.toString(), QLatin1String("ciao"));
- QCOMPARE(v.engine(), (QJSEngine *)0);
+ QCOMPARE(v.engine(), (QJSEngine *)nullptr);
}
{
QJSValue v("ciao");
@@ -204,7 +204,7 @@ void tst_QJSValue::ctor_string()
QCOMPARE(v.isString(), true);
QCOMPARE(v.isObject(), false);
QCOMPARE(v.toString(), QLatin1String("ciao"));
- QCOMPARE(v.engine(), (QJSEngine *)0);
+ QCOMPARE(v.engine(), (QJSEngine *)nullptr);
}
}
@@ -246,7 +246,7 @@ void tst_QJSValue::ctor_undefined()
QJSValue v(QJSValue::UndefinedValue);
QVERIFY(v.isUndefined());
QCOMPARE(v.isObject(), false);
- QCOMPARE(v.engine(), (QJSEngine *)0);
+ QCOMPARE(v.engine(), (QJSEngine *)nullptr);
}
void tst_QJSValue::ctor_null()
@@ -255,7 +255,7 @@ void tst_QJSValue::ctor_null()
QVERIFY(!v.isUndefined());
QCOMPARE(v.isNull(), true);
QCOMPARE(v.isObject(), false);
- QCOMPARE(v.engine(), (QJSEngine *)0);
+ QCOMPARE(v.engine(), (QJSEngine *)nullptr);
}
void tst_QJSValue::ctor_bool()
@@ -266,7 +266,7 @@ void tst_QJSValue::ctor_bool()
QCOMPARE(v.isBool(), true);
QCOMPARE(v.isObject(), false);
QCOMPARE(v.toBool(), false);
- QCOMPARE(v.engine(), (QJSEngine *)0);
+ QCOMPARE(v.engine(), (QJSEngine *)nullptr);
}
void tst_QJSValue::ctor_copyAndAssign()
@@ -274,12 +274,12 @@ void tst_QJSValue::ctor_copyAndAssign()
QJSValue v(1.0);
QJSValue v2(v);
QCOMPARE(v2.strictlyEquals(v), true);
- QCOMPARE(v2.engine(), (QJSEngine *)0);
+ QCOMPARE(v2.engine(), (QJSEngine *)nullptr);
QJSValue v3(v);
QCOMPARE(v3.strictlyEquals(v), true);
QCOMPARE(v3.strictlyEquals(v2), true);
- QCOMPARE(v3.engine(), (QJSEngine *)0);
+ QCOMPARE(v3.engine(), (QJSEngine *)nullptr);
QJSValue v4(2.0);
QCOMPARE(v4.strictlyEquals(v), false);
@@ -1107,16 +1107,16 @@ void tst_QJSValue::toQObject_nonQObject_data()
QTest::newRow("array") << engine->newArray();
QTest::newRow("date") << engine->evaluate("new Date(124)");
QTest::newRow("variant(12345)") << engine->toScriptValue(QVariant(12345));
- QTest::newRow("variant((QObject*)0)") << engine->toScriptValue(qVariantFromValue((QObject*)0));
- QTest::newRow("newQObject(0)") << engine->newQObject(0);
+ QTest::newRow("variant((QObject*)0)") << engine->toScriptValue(qVariantFromValue((QObject*)nullptr));
+ QTest::newRow("newQObject(0)") << engine->newQObject(nullptr);
}
void tst_QJSValue::toQObject_nonQObject()
{
QFETCH(QJSValue, value);
- QCOMPARE(value.toQObject(), (QObject *)0);
- QCOMPARE(qjsvalue_cast<QObject*>(value), (QObject *)0);
+ QCOMPARE(value.toQObject(), (QObject *)nullptr);
+ QCOMPARE(qjsvalue_cast<QObject*>(value), (QObject *)nullptr);
}
// unfortunately, this is necessary in order to do qscriptvalue_cast<QPushButton*>(...)
@@ -1130,7 +1130,7 @@ void tst_QJSValue::toQObject()
QJSValue qobject = eng.newQObject(&temp);
QCOMPARE(qobject.toQObject(), (QObject *)&temp);
QCOMPARE(qjsvalue_cast<QObject*>(qobject), (QObject *)&temp);
- QCOMPARE(qjsvalue_cast<QWidget*>(qobject), (QWidget *)0);
+ QCOMPARE(qjsvalue_cast<QWidget*>(qobject), (QWidget *)nullptr);
QWidget widget;
QJSValue qwidget = eng.newQObject(&widget);
@@ -1594,7 +1594,7 @@ void tst_QJSValue::getSetProperty()
QCOMPARE(object.property("baz").toNumber(), num.toNumber());
QJSValue strstr = QJSValue("bar");
- QCOMPARE(strstr.engine(), (QJSEngine *)0);
+ QCOMPARE(strstr.engine(), (QJSEngine *)nullptr);
object.setProperty("foo", strstr);
QCOMPARE(object.property("foo").toString(), strstr.toString());
QCOMPARE(strstr.engine(), &eng); // the value has been bound to the engine
@@ -2095,7 +2095,7 @@ void tst_QJSValue::equals()
QJSValue qobj1 = eng.newQObject(&temp);
QJSValue qobj2 = eng.newQObject(&temp);
- QJSValue qobj3 = eng.newQObject(0);
+ QJSValue qobj3 = eng.newQObject(nullptr);
// FIXME: No ScriptOwnership: QJSValue qobj4 = eng.newQObject(new QObject(), QScriptEngine::ScriptOwnership);
QJSValue qobj4 = eng.newQObject(new QObject());
@@ -2281,7 +2281,7 @@ void tst_QJSValue::castToPointer()
QColor c(123, 210, 231);
QJSValue v = eng.toScriptValue(c);
QColor *cp = qjsvalue_cast<QColor*>(v);
- QVERIFY(cp != 0);
+ QVERIFY(cp != nullptr);
QCOMPARE(*cp, c);
QBrush *bp = qjsvalue_cast<QBrush*>(v);
diff --git a/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp b/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp
index 4b485d2ce8..34cf21024d 100644
--- a/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp
+++ b/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp
@@ -65,10 +65,10 @@ void tst_qqmlbinding::binding()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("test-binding.qml"));
QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QQmlBind *binding3 = qobject_cast<QQmlBind*>(rect->findChild<QQmlBind*>("binding3"));
- QVERIFY(binding3 != 0);
+ QVERIFY(binding3 != nullptr);
QCOMPARE(rect->color(), QColor("yellow"));
QCOMPARE(rect->property("text").toString(), QString("Hello"));
@@ -80,7 +80,7 @@ void tst_qqmlbinding::binding()
QCOMPARE(binding3->when(), true);
QQmlBind *binding = qobject_cast<QQmlBind*>(rect->findChild<QQmlBind*>("binding1"));
- QVERIFY(binding != 0);
+ QVERIFY(binding != nullptr);
QCOMPARE(binding->object(), qobject_cast<QObject*>(rect));
QCOMPARE(binding->property(), QLatin1String("text"));
QCOMPARE(binding->value().toString(), QLatin1String("Hello"));
@@ -94,7 +94,7 @@ void tst_qqmlbinding::whenAfterValue()
QQmlComponent c(&engine, testFileUrl("test-binding2.qml"));
QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QCOMPARE(rect->color(), QColor("yellow"));
QCOMPARE(rect->property("text").toString(), QString("Hello"));
@@ -109,10 +109,10 @@ void tst_qqmlbinding::restoreBinding()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("restoreBinding.qml"));
QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QQuickRectangle *myItem = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("myItem"));
- QVERIFY(myItem != 0);
+ QVERIFY(myItem != nullptr);
myItem->setY(25);
QCOMPARE(myItem->x(), qreal(100-25));
@@ -139,10 +139,10 @@ void tst_qqmlbinding::restoreBindingWithLoop()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("restoreBindingWithLoop.qml"));
QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QQuickRectangle *myItem = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("myItem"));
- QVERIFY(myItem != 0);
+ QVERIFY(myItem != nullptr);
myItem->setY(25);
QCOMPARE(myItem->x(), qreal(25 + 100));
@@ -175,10 +175,10 @@ void tst_qqmlbinding::restoreBindingWithoutCrash()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("restoreBindingWithoutCrash.qml"));
QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
QQuickRectangle *myItem = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("myItem"));
- QVERIFY(myItem != 0);
+ QVERIFY(myItem != nullptr);
myItem->setY(25);
QCOMPARE(myItem->x(), qreal(100-25));
@@ -215,9 +215,9 @@ void tst_qqmlbinding::deletedObject()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("deletedObject.qml"));
QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
- QVERIFY(rect != 0);
+ QVERIFY(rect != nullptr);
- QGuiApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QGuiApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
//don't crash
rect->setProperty("activateBinding", true);
@@ -289,7 +289,7 @@ void tst_qqmlbinding::delayed()
QQmlComponent c(&engine, testFileUrl("delayed.qml"));
QQuickItem *item = qobject_cast<QQuickItem*>(c.create());
- QVERIFY(item != 0);
+ QVERIFY(item != nullptr);
// update on creation
QCOMPARE(item->property("changeCount").toInt(), 1);
diff --git a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
index 105469fbcf..6a0dc28ca4 100644
--- a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
+++ b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
@@ -89,7 +89,7 @@ public slots:
static void gc(QQmlEngine &engine)
{
engine.collectGarbage();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
}
@@ -157,7 +157,7 @@ void tst_qqmlcomponent::qmlIncubateObject()
{
QQmlComponent component(&engine, testFileUrl("incubateObject.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1").toBool(), true);
QCOMPARE(object->property("test2").toBool(), false);
@@ -236,8 +236,8 @@ void tst_qqmlcomponent::qmlCreateObjectAutoParent()
QCOMPARE(window_item->parent(), windowParent);
QCOMPARE(window_window->parent(), windowParent);
- QCOMPARE(qobject_cast<QQuickItem *>(qtobject_item)->parentItem(), (QQuickItem *)0);
- QCOMPARE(qobject_cast<QQuickWindow *>(qtobject_window)->transientParent(), (QQuickWindow *)0);
+ QCOMPARE(qobject_cast<QQuickItem *>(qtobject_item)->parentItem(), (QQuickItem *)nullptr);
+ QCOMPARE(qobject_cast<QQuickWindow *>(qtobject_window)->transientParent(), (QQuickWindow *)nullptr);
QCOMPARE(qobject_cast<QQuickItem *>(item_item)->parentItem(), itemParent);
QCOMPARE(qobject_cast<QQuickWindow *>(item_window)->transientParent(), itemParent->window());
QCOMPARE(qobject_cast<QQuickItem *>(window_item)->parentItem(), windowParent->contentItem());
@@ -250,7 +250,7 @@ void tst_qqmlcomponent::qmlCreateObjectWithProperties()
QQmlComponent component(&engine, testFileUrl("createObjectWithScript.qml"));
QVERIFY2(component.errorString().isEmpty(), component.errorString().toUtf8());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QObject *testObject1 = object->property("declarativerectangle").value<QObject*>();
QVERIFY(testObject1);
@@ -301,7 +301,7 @@ void tst_qqmlcomponent::qmlCreateParentReference()
QQmlComponent component(&engine, testFileUrl("createParentReference.qml"));
QVERIFY2(component.errorString().isEmpty(), component.errorString().toUtf8());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(QMetaObject::invokeMethod(object, "createChild"));
delete object;
@@ -327,7 +327,7 @@ void tst_qqmlcomponent::async()
QCOMPARE(watcher.error, 0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -348,7 +348,7 @@ void tst_qqmlcomponent::asyncHierarchy()
QCOMPARE(watcher.error, 0);
QObject *root = component.create();
- QVERIFY(root != 0);
+ QVERIFY(root != nullptr);
// ensure that the parent-child relationship hierarchy is correct
// (use QQuickItem* for all children rather than types which are not publicly exported)
@@ -413,7 +413,7 @@ void tst_qqmlcomponent::componentUrlCanonicalization()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("componentUrlCanonicalization.qml"));
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("success").toBool());
}
@@ -423,7 +423,7 @@ void tst_qqmlcomponent::componentUrlCanonicalization()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("componentUrlCanonicalization.2.qml"));
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("success").toBool());
}
@@ -432,7 +432,7 @@ void tst_qqmlcomponent::componentUrlCanonicalization()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("componentUrlCanonicalization.3.qml"));
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("success").toBool());
}
@@ -441,7 +441,7 @@ void tst_qqmlcomponent::componentUrlCanonicalization()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("componentUrlCanonicalization.4.qml"));
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("success").toBool());
}
@@ -461,7 +461,7 @@ void tst_qqmlcomponent::onDestructionLookup()
QQmlComponent component(&engine, testFileUrl("onDestructionLookup.qml"));
QScopedPointer<QObject> object(component.create());
gc(engine);
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("success").toBool());
}
@@ -477,7 +477,7 @@ void tst_qqmlcomponent::onDestructionCount()
QTest::ignoreMessage(QtWarningMsg, warning.data());
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
// Warning should not be emitted any further
@@ -487,7 +487,7 @@ void tst_qqmlcomponent::onDestructionCount()
{
QQmlTestMessageHandler messageHandler;
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
warnings = messageHandler.messages();
}
@@ -505,7 +505,7 @@ void tst_qqmlcomponent::recursion()
QTest::ignoreMessage(QtWarningMsg, QLatin1String("QQmlComponent: Component creation is recursing - aborting").data());
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// Sub-object creation does not succeed
QCOMPARE(object->property("success").toBool(), false);
@@ -520,7 +520,7 @@ void tst_qqmlcomponent::recursionContinuation()
QTest::ignoreMessage(QtWarningMsg, QLatin1String("QQmlComponent: Component creation is recursing - aborting").data());
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// Eventual sub-object creation succeeds
QVERIFY(object->property("success").toBool());
@@ -538,7 +538,7 @@ public:
int value() const { return m_value; }
void setValue(int v) {
scopeObject.clear();
- callingContextData.setContextData(0);
+ callingContextData.setContextData(nullptr);
m_value = v;
QJSEngine *jsEngine = qjsEngine(this);
diff --git a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
index 22e9724c61..8ef00f8080 100644
--- a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
+++ b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
@@ -70,7 +70,7 @@ void tst_qqmlconnections::defaultValues()
QQmlComponent c(&engine, testFileUrl("test-connection3.qml"));
QQmlConnections *item = qobject_cast<QQmlConnections*>(c.create());
- QVERIFY(item != 0);
+ QVERIFY(item != nullptr);
QVERIFY(!item->target());
delete item;
@@ -82,9 +82,9 @@ void tst_qqmlconnections::properties()
QQmlComponent c(&engine, testFileUrl("test-connection2.qml"));
QQmlConnections *item = qobject_cast<QQmlConnections*>(c.create());
- QVERIFY(item != 0);
+ QVERIFY(item != nullptr);
- QVERIFY(item != 0);
+ QVERIFY(item != nullptr);
QCOMPARE(item->target(), item);
delete item;
@@ -96,7 +96,7 @@ void tst_qqmlconnections::connection()
QQmlComponent c(&engine, testFileUrl("test-connection.qml"));
QQuickItem *item = qobject_cast<QQuickItem*>(c.create());
- QVERIFY(item != 0);
+ QVERIFY(item != nullptr);
QCOMPARE(item->property("tested").toBool(), false);
QCOMPARE(item->width(), 50.);
@@ -113,7 +113,7 @@ void tst_qqmlconnections::trimming()
QQmlComponent c(&engine, testFileUrl("trimming.qml"));
QObject *object = c.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("tested").toString(), QString(""));
int index = object->metaObject()->indexOfSignal("testMe(int,QString)");
@@ -133,7 +133,7 @@ void tst_qqmlconnections::targetChanged()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("connection-targetchange.qml"));
QQuickItem *item = qobject_cast<QQuickItem*>(c.create());
- QVERIFY(item != 0);
+ QVERIFY(item != nullptr);
QQmlConnections *connections = item->findChild<QQmlConnections*>("connections");
QVERIFY(connections);
@@ -178,7 +178,7 @@ void tst_qqmlconnections::unknownSignals()
QQmlEngine engine;
QQmlComponent c(&engine, url);
QObject *object = c.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// check that connection is created (they are all runtime errors)
QQmlConnections *connections = object->findChild<QQmlConnections*>("connections");
@@ -222,7 +222,7 @@ class TestObject : public QObject
Q_PROPERTY(bool ran READ ran WRITE setRan)
public:
- TestObject(QObject *parent = 0) : QObject(parent), m_ran(false) {}
+ TestObject(QObject *parent = nullptr) : QObject(parent), m_ran(false) {}
~TestObject() {}
bool ran() const { return m_ran; }
@@ -244,7 +244,7 @@ void tst_qqmlconnections::rewriteErrors()
QQmlComponent c(&engine, testFileUrl("rewriteError-unnamed.qml"));
QTest::ignoreMessage(QtWarningMsg, (c.url().toString() + ":5:35: QML Connections: Signal uses unnamed parameter followed by named parameter.").toLatin1());
TestObject *obj = qobject_cast<TestObject*>(c.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
obj->unnamedArgumentSignal(1, .5, "hello");
QCOMPARE(obj->ran(), false);
@@ -256,7 +256,7 @@ void tst_qqmlconnections::rewriteErrors()
QQmlComponent c(&engine, testFileUrl("rewriteError-global.qml"));
QTest::ignoreMessage(QtWarningMsg, (c.url().toString() + ":5:35: QML Connections: Signal parameter \"parseInt\" hides global variable.").toLatin1());
TestObject *obj = qobject_cast<TestObject*>(c.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
obj->signalWithGlobalName(10);
QCOMPARE(obj->ran(), false);
@@ -272,7 +272,7 @@ Q_OBJECT
Q_PROPERTY(int intProp READ intProp WRITE setIntProp NOTIFY intPropChanged)
public:
- MyTestSingletonType(QObject *parent = 0) : QObject(parent), m_intProp(0), m_changeCount(0) {}
+ MyTestSingletonType(QObject *parent = nullptr) : QObject(parent), m_intProp(0), m_changeCount(0) {}
~MyTestSingletonType() {}
Q_INVOKABLE int otherMethod(int val) { return val + 4; }
@@ -307,7 +307,7 @@ void tst_qqmlconnections::singletonTypeTarget()
qmlRegisterSingletonType<MyTestSingletonType>("MyTestSingletonType", 1, 0, "Api", module_api_factory);
QQmlComponent component(&engine, testFileUrl("singletontype-target.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("moduleIntPropChangedCount").toInt(), 0);
QCOMPARE(object->property("moduleOtherSignalCount").toInt(), 0);
@@ -333,7 +333,7 @@ void tst_qqmlconnections::enableDisable_QTBUG_36350()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("test-connection.qml"));
QQuickItem *item = qobject_cast<QQuickItem*>(c.create());
- QVERIFY(item != 0);
+ QVERIFY(item != nullptr);
QQmlConnections *connections = item->findChild<QQmlConnections*>("connections");
QVERIFY(connections);
@@ -361,7 +361,7 @@ void tst_qqmlconnections::disabledAtStart()
QQmlComponent c(&engine, testFileUrl("disabled-at-start.qml"));
QObject * const object = c.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("tested").toBool(), false);
const int index = object->metaObject()->indexOfSignal("testMe()");
@@ -379,7 +379,7 @@ void tst_qqmlconnections::clearImplicitTarget()
QQmlComponent c(&engine, testFileUrl("test-connection-implicit.qml"));
QQuickItem *item = qobject_cast<QQuickItem*>(c.create());
- QVERIFY(item != 0);
+ QVERIFY(item != nullptr);
// normal case: fire Connections
item->setWidth(100.);
@@ -389,7 +389,7 @@ void tst_qqmlconnections::clearImplicitTarget()
// clear the implicit target
QQmlConnections *connections = item->findChild<QQmlConnections*>();
QVERIFY(connections);
- connections->setTarget(0);
+ connections->setTarget(nullptr);
// target cleared: no longer fire Connections
item->setWidth(150.);
diff --git a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp
index f832143935..0d915f98f8 100644
--- a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp
+++ b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp
@@ -84,7 +84,7 @@ void tst_qqmlconsole::logging()
QQmlComponent component(&engine, testUrl);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -102,7 +102,7 @@ void tst_qqmlconsole::categorized_logging()
QQmlComponent component(&engine, testUrl);
QObject *object = component.create();
- QVERIFY2(object != 0, component.errorString().toUtf8());
+ QVERIFY2(object != nullptr, component.errorString().toUtf8());
QVERIFY(messageHandler.messages().contains("qt.test: console.info"));
QVERIFY(messageHandler.messages().contains("qt.test: console.warn"));
@@ -135,7 +135,7 @@ void tst_qqmlconsole::tracing()
QQmlComponent component(&engine, testUrl);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -149,7 +149,7 @@ void tst_qqmlconsole::profiling()
QQmlComponent component(&engine, testUrl);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -170,7 +170,7 @@ void tst_qqmlconsole::testAssert()
QQmlComponent component(&engine, testUrl);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -191,7 +191,7 @@ void tst_qqmlconsole::exception()
QQmlComponent component(&engine, testUrl);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
diff --git a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
index 783b5cb786..5999bc42e9 100644
--- a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
+++ b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
@@ -116,7 +116,7 @@ void tst_qqmlcontext::resolvedUrl()
QQmlContext ctxt2(ctxt);
QCOMPARE(ctxt2.resolvedUrl(QUrl("main2.qml")), QUrl("http://www.qt-project.org/main2.qml"));
- delete ctxt; ctxt = 0;
+ delete ctxt; ctxt = nullptr;
QCOMPARE(ctxt2.resolvedUrl(QUrl("main2.qml")), QUrl());
}
@@ -144,7 +144,7 @@ void tst_qqmlcontext::engineMethod()
QCOMPARE(ctxt3.engine(), engine);
QCOMPARE(ctxt4.engine(), engine);
- delete engine; engine = 0;
+ delete engine; engine = nullptr;
QCOMPARE(ctxt.engine(), engine);
QCOMPARE(ctxt2.engine(), engine);
@@ -156,7 +156,7 @@ void tst_qqmlcontext::parentContext()
{
QQmlEngine *engine = new QQmlEngine;
- QCOMPARE(engine->rootContext()->parentContext(), (QQmlContext *)0);
+ QCOMPARE(engine->rootContext()->parentContext(), (QQmlContext *)nullptr);
QQmlContext *ctxt = new QQmlContext(engine);
QQmlContext *ctxt2 = new QQmlContext(ctxt);
@@ -174,23 +174,23 @@ void tst_qqmlcontext::parentContext()
QCOMPARE(ctxt6->parentContext(), engine->rootContext());
QCOMPARE(ctxt7->parentContext(), engine->rootContext());
- delete ctxt2; ctxt2 = 0;
+ delete ctxt2; ctxt2 = nullptr;
QCOMPARE(ctxt->parentContext(), engine->rootContext());
- QCOMPARE(ctxt3->parentContext(), (QQmlContext *)0);
- QCOMPARE(ctxt4->parentContext(), (QQmlContext *)0);
+ QCOMPARE(ctxt3->parentContext(), (QQmlContext *)nullptr);
+ QCOMPARE(ctxt4->parentContext(), (QQmlContext *)nullptr);
QCOMPARE(ctxt5->parentContext(), ctxt);
QCOMPARE(ctxt6->parentContext(), engine->rootContext());
QCOMPARE(ctxt7->parentContext(), engine->rootContext());
- delete engine; engine = 0;
+ delete engine; engine = nullptr;
- QCOMPARE(ctxt->parentContext(), (QQmlContext *)0);
- QCOMPARE(ctxt3->parentContext(), (QQmlContext *)0);
- QCOMPARE(ctxt4->parentContext(), (QQmlContext *)0);
- QCOMPARE(ctxt5->parentContext(), (QQmlContext *)0);
- QCOMPARE(ctxt6->parentContext(), (QQmlContext *)0);
- QCOMPARE(ctxt7->parentContext(), (QQmlContext *)0);
+ QCOMPARE(ctxt->parentContext(), (QQmlContext *)nullptr);
+ QCOMPARE(ctxt3->parentContext(), (QQmlContext *)nullptr);
+ QCOMPARE(ctxt4->parentContext(), (QQmlContext *)nullptr);
+ QCOMPARE(ctxt5->parentContext(), (QQmlContext *)nullptr);
+ QCOMPARE(ctxt6->parentContext(), (QQmlContext *)nullptr);
+ QCOMPARE(ctxt7->parentContext(), (QQmlContext *)nullptr);
delete ctxt7;
delete ctxt6;
@@ -453,12 +453,12 @@ void tst_qqmlcontext::destruction()
QObject obj;
QQmlEngine::setContextForObject(&obj, ctxt);
- QQmlExpression expr(ctxt, 0, "a");
+ QQmlExpression expr(ctxt, nullptr, "a");
QCOMPARE(ctxt, QQmlEngine::contextForObject(&obj));
QCOMPARE(ctxt, expr.context());
- delete ctxt; ctxt = 0;
+ delete ctxt; ctxt = nullptr;
QCOMPARE(ctxt, QQmlEngine::contextForObject(&obj));
QCOMPARE(ctxt, expr.context());
@@ -507,7 +507,7 @@ void tst_qqmlcontext::readOnlyContexts()
QCOMPARE(context->contextProperty("hello"), QVariant());
QTest::ignoreMessage(QtWarningMsg, "QQmlContext: Cannot set context object for internal context.");
- context->setContextObject(0);
+ context->setContextObject(nullptr);
QCOMPARE(context->contextObject(), obj);
delete obj;
@@ -535,7 +535,7 @@ void tst_qqmlcontext::nameForObject()
component.setData("import QtQuick 2.0; QtObject { id: root; property QtObject o: QtObject { id: nested } }", QUrl());
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(qmlContext(o)->nameForObject(o), QString("root"));
QCOMPARE(qmlContext(o)->nameForObject(qvariant_cast<QObject*>(o->property("o"))), QString("nested"));
@@ -548,12 +548,12 @@ class DeleteCommand : public QObject
{
Q_OBJECT
public:
- DeleteCommand() : object(0) {}
+ DeleteCommand() : object(nullptr) {}
QObject *object;
public slots:
- void doCommand() { if (object) delete object; object = 0; }
+ void doCommand() { if (object) delete object; object = nullptr; }
};
// Calling refresh expressions would crash if an expression or context was deleted during
@@ -686,7 +686,7 @@ void tst_qqmlcontext::skipExpressionRefresh_qtbug_53431()
{
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("qtbug_53431.qml"));
- QScopedPointer<QObject> object(component.create(0));
+ QScopedPointer<QObject> object(component.create(nullptr));
QVERIFY(!object.isNull());
QCOMPARE(object->property("value").toInt(), 1);
object->setProperty("value", 10);
@@ -713,7 +713,7 @@ void tst_qqmlcontext::evalAfterInvalidate()
QQmlComponent component(&engine, testFileUrl("evalAfterInvalidate.qml"));
QScopedPointer<QObject> o(component.create());
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
}
diff --git a/tests/auto/qml/qqmlcpputils/tst_qqmlcpputils.cpp b/tests/auto/qml/qqmlcpputils/tst_qqmlcpputils.cpp
index 63b5de044e..99cabb4b09 100644
--- a/tests/auto/qml/qqmlcpputils/tst_qqmlcpputils.cpp
+++ b/tests/auto/qml/qqmlcpputils/tst_qqmlcpputils.cpp
@@ -102,7 +102,7 @@ void tst_qqmlcpputils::fastCast()
}
{
- QObject *nullObj = 0;
+ QObject *nullObj = nullptr;
QObject *obj = qmlobject_cast<QObject *>(nullObj);
QCOMPARE(obj, nullObj); // shouldn't crash/assert.
}
diff --git a/tests/auto/qml/qqmlecmascript/testtypes.cpp b/tests/auto/qml/qqmlecmascript/testtypes.cpp
index 80da5d7e52..89887fe6c3 100644
--- a/tests/auto/qml/qqmlecmascript/testtypes.cpp
+++ b/tests/auto/qml/qqmlecmascript/testtypes.cpp
@@ -56,7 +56,7 @@ class AbstractExtensionObject : public QObject
Q_PROPERTY(int abstractProperty READ abstractProperty WRITE setAbstractProperty NOTIFY abstractPropertyChanged)
public:
- AbstractExtensionObject(QObject *parent = 0) : QObject(parent), m_abstractProperty(-1) {}
+ AbstractExtensionObject(QObject *parent = nullptr) : QObject(parent), m_abstractProperty(-1) {}
void setAbstractProperty(int abstractProperty) { m_abstractProperty = abstractProperty; emit abstractPropertyChanged(); }
int abstractProperty() const { return m_abstractProperty; }
@@ -75,7 +75,7 @@ class ImplementedExtensionObject : public AbstractExtensionObject
Q_OBJECT
Q_PROPERTY(int implementedProperty READ implementedProperty WRITE setImplementedProperty NOTIFY implementedPropertyChanged)
public:
- ImplementedExtensionObject(QObject *parent = 0) : AbstractExtensionObject(parent), m_implementedProperty(883) {}
+ ImplementedExtensionObject(QObject *parent = nullptr) : AbstractExtensionObject(parent), m_implementedProperty(883) {}
void shouldBeImplemented() {}
void setImplementedProperty(int implementedProperty) { m_implementedProperty = implementedProperty; emit implementedPropertyChanged(); }
@@ -340,7 +340,7 @@ public:
}
};
-static MyInheritedQmlObject *theSingletonObject = 0;
+static MyInheritedQmlObject *theSingletonObject = nullptr;
static QObject *inheritedQmlObject_provider(QQmlEngine* /* engine */, QJSEngine* /* scriptEngine */)
{
@@ -382,7 +382,7 @@ private:
static int a = 0;
static int *ptr = &a;
*ptr = 1;
- ptr = 0;
+ ptr = nullptr;
}
};
@@ -401,13 +401,13 @@ static QObject *create_singletonWithEnum(QQmlEngine *, QJSEngine *)
}
QObjectContainer::QObjectContainer()
- : widgetParent(0)
+ : widgetParent(nullptr)
, gcOnAppend(false)
{}
QQmlListProperty<QObject> QObjectContainer::data()
{
- return QQmlListProperty<QObject>(this, 0, children_append, children_count, children_at, children_clear);
+ return QQmlListProperty<QObject>(this, nullptr, children_append, children_count, children_at, children_clear);
}
void QObjectContainer::children_append(QQmlListProperty<QObject> *prop, QObject *o)
@@ -419,7 +419,7 @@ void QObjectContainer::children_append(QQmlListProperty<QObject> *prop, QObject
if (that->gcOnAppend) {
QQmlEngine *engine = qmlEngine(that);
engine->collectGarbage();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
}
}
@@ -448,7 +448,7 @@ void QObjectContainer::childDestroyed(QObject *child) {
void FloatingQObject::classBegin()
{
- setParent(0);
+ setParent(nullptr);
}
void FloatingQObject::componentComplete()
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index ecd7bea1c4..5ff959515e 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -373,7 +373,7 @@ private:
static void gc(QQmlEngine &engine)
{
engine.collectGarbage();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
}
@@ -392,7 +392,7 @@ void tst_qqmlecmascript::assignBasicTypes()
{
QQmlComponent component(&engine, testFileUrl("assignBasicTypes.qml"));
MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->flagProperty(), MyTypeObject::FlagVal1 | MyTypeObject::FlagVal3);
QCOMPARE(object->enumProperty(), MyTypeObject::EnumVal2);
QCOMPARE(object->relatedEnumProperty(), MyEnumContainer::RelatedValue);
@@ -421,7 +421,7 @@ void tst_qqmlecmascript::assignBasicTypes()
{
QQmlComponent component(&engine, testFileUrl("assignBasicTypes.2.qml"));
MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->flagProperty(), MyTypeObject::FlagVal1 | MyTypeObject::FlagVal3);
QCOMPARE(object->enumProperty(), MyTypeObject::EnumVal2);
QCOMPARE(object->relatedEnumProperty(), MyEnumContainer::RelatedValue);
@@ -471,7 +471,7 @@ void tst_qqmlecmascript::assignDate()
QQmlComponent component(&engine, source);
QScopedPointer<QObject> obj(component.create());
MyTypeObject *object = qobject_cast<MyTypeObject *>(obj.data());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QDate expectedDate(2009, 5, 12);
QDateTime expectedDateTime;
@@ -542,7 +542,7 @@ void tst_qqmlecmascript::exportDate()
QQmlComponent component(&e, source);
QScopedPointer<QObject> obj(component.create());
MyTypeObject *object = qobject_cast<MyTypeObject *>(obj.data());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->boolProperty(), true);
}
@@ -551,8 +551,8 @@ void tst_qqmlecmascript::idShortcutInvalidates()
{
QQmlComponent component(&engine, testFileUrl("idShortcutInvalidates.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
- QVERIFY(object->objectProperty() != 0);
+ QVERIFY(object != nullptr);
+ QVERIFY(object->objectProperty() != nullptr);
delete object->objectProperty();
QVERIFY(!object->objectProperty());
delete object;
@@ -561,8 +561,8 @@ void tst_qqmlecmascript::idShortcutInvalidates()
{
QQmlComponent component(&engine, testFileUrl("idShortcutInvalidates.1.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
- QVERIFY(object->objectProperty() != 0);
+ QVERIFY(object != nullptr);
+ QVERIFY(object->objectProperty() != nullptr);
delete object->objectProperty();
QVERIFY(!object->objectProperty());
delete object;
@@ -574,14 +574,14 @@ void tst_qqmlecmascript::boolPropertiesEvaluateAsBool()
{
QQmlComponent component(&engine, testFileUrl("boolPropertiesEvaluateAsBool.1.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->stringProperty(), QLatin1String("pass"));
delete object;
}
{
QQmlComponent component(&engine, testFileUrl("boolPropertiesEvaluateAsBool.2.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->stringProperty(), QLatin1String("pass"));
delete object;
}
@@ -592,7 +592,7 @@ void tst_qqmlecmascript::signalAssignment()
{
QQmlComponent component(&engine, testFileUrl("signalAssignment.1.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->string(), QString());
emit object->basicSignal();
QCOMPARE(object->string(), QString("pass"));
@@ -602,7 +602,7 @@ void tst_qqmlecmascript::signalAssignment()
{
QQmlComponent component(&engine, testFileUrl("signalAssignment.2.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->string(), QString());
emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
QCOMPARE(object->string(), QString("pass 19 Hello world! 10.25 3 2"));
@@ -629,7 +629,7 @@ void tst_qqmlecmascript::signalArguments()
{
QQmlComponent component(&engine, testFileUrl("signalArguments.1.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->string(), QString());
emit object->basicSignal();
QCOMPARE(object->string(), QString("pass"));
@@ -640,7 +640,7 @@ void tst_qqmlecmascript::signalArguments()
{
QQmlComponent component(&engine, testFileUrl("signalArguments.2.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->string(), QString());
emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
QCOMPARE(object->string(), QString("pass 19 Hello world! 10.25 3 2"));
@@ -654,7 +654,7 @@ void tst_qqmlecmascript::methods()
{
QQmlComponent component(&engine, testFileUrl("methods.1.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->methodCalled(), false);
QCOMPARE(object->methodIntCalled(), false);
emit object->basicSignal();
@@ -666,7 +666,7 @@ void tst_qqmlecmascript::methods()
{
QQmlComponent component(&engine, testFileUrl("methods.2.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->methodCalled(), false);
QCOMPARE(object->methodIntCalled(), false);
emit object->basicSignal();
@@ -678,7 +678,7 @@ void tst_qqmlecmascript::methods()
{
QQmlComponent component(&engine, testFileUrl("methods.3.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toInt(), 19);
delete object;
}
@@ -686,7 +686,7 @@ void tst_qqmlecmascript::methods()
{
QQmlComponent component(&engine, testFileUrl("methods.4.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toInt(), 19);
QCOMPARE(object->property("test2").toInt(), 17);
QCOMPARE(object->property("test3").toInt(), 16);
@@ -696,7 +696,7 @@ void tst_qqmlecmascript::methods()
{
QQmlComponent component(&engine, testFileUrl("methods.5.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toInt(), 9);
delete object;
}
@@ -708,7 +708,7 @@ void tst_qqmlecmascript::bindingLoop()
QString warning = component.url().toString() + ":9:9: QML MyQmlObject: Binding loop detected for property \"stringProperty\"";
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -894,7 +894,7 @@ void tst_qqmlecmascript::objectPropertiesTriggerReeval()
expr.changed = false;
QCOMPARE(expr.evaluate(), QVariant("Cat"));
- object1.setObjectProperty(0);
+ object1.setObjectProperty(nullptr);
QCOMPARE(expr.changed, true);
expr.changed = false;
QCOMPARE(expr.evaluate(), QVariant());
@@ -928,16 +928,16 @@ void tst_qqmlecmascript::deferredProperties()
QQmlComponent component(&engine, testFileUrl("deferredProperties.qml"));
MyDeferredObject *object =
qobject_cast<MyDeferredObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->value(), 0);
QVERIFY(!object->objectProperty());
- QVERIFY(object->objectProperty2() != 0);
+ QVERIFY(object->objectProperty2() != nullptr);
qmlExecuteDeferred(object);
QCOMPARE(object->value(), 10);
- QVERIFY(object->objectProperty() != 0);
+ QVERIFY(object->objectProperty() != nullptr);
MyQmlObject *qmlObject =
qobject_cast<MyQmlObject *>(object->objectProperty());
- QVERIFY(qmlObject != 0);
+ QVERIFY(qmlObject != nullptr);
QCOMPARE(qmlObject->value(), 10);
object->setValue(19);
QCOMPARE(qmlObject->value(), 19);
@@ -951,7 +951,7 @@ void tst_qqmlecmascript::deferredPropertiesErrors()
QQmlComponent component(&engine, testFileUrl("deferredPropertiesErrors.qml"));
MyDeferredObject *object =
qobject_cast<MyDeferredObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->value(), 0);
QVERIFY(!object->objectProperty());
QVERIFY(!object->objectProperty2());
@@ -971,25 +971,25 @@ void tst_qqmlecmascript::deferredPropertiesInComponents()
QObject *object = component.create();
if (!object)
qDebug() << component.errorString();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("value").value<int>(), 10);
MyDeferredObject *defObjectA =
qobject_cast<MyDeferredObject *>(object->property("deferredInside").value<QObject*>());
- QVERIFY(defObjectA != 0);
+ QVERIFY(defObjectA != nullptr);
QVERIFY(!defObjectA->objectProperty());
qmlExecuteDeferred(defObjectA);
- QVERIFY(defObjectA->objectProperty() != 0);
+ QVERIFY(defObjectA->objectProperty() != nullptr);
QCOMPARE(defObjectA->objectProperty()->property("value").value<int>(), 10);
MyDeferredObject *defObjectB =
qobject_cast<MyDeferredObject *>(object->property("deferredOutside").value<QObject*>());
- QVERIFY(defObjectB != 0);
+ QVERIFY(defObjectB != nullptr);
QVERIFY(!defObjectB->objectProperty());
qmlExecuteDeferred(defObjectB);
- QVERIFY(defObjectB->objectProperty() != 0);
+ QVERIFY(defObjectB->objectProperty() != nullptr);
QCOMPARE(defObjectB->objectProperty()->property("value").value<int>(), 10);
delete object;
@@ -1004,7 +1004,7 @@ void tst_qqmlecmascript::deferredPropertiesInDestruction()
QObject *object = component.create();
if (!object)
qDebug() << component.errorString();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object; //QTBUG-33112 was that this used to cause a crash
}
@@ -1013,7 +1013,7 @@ void tst_qqmlecmascript::extensionObjects()
QQmlComponent component(&engine, testFileUrl("extensionObjects.qml"));
MyExtendedObject *object =
qobject_cast<MyExtendedObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->baseProperty(), 13);
QCOMPARE(object->coreProperty(), 9);
object->setProperty("extendedProperty", QVariant(11));
@@ -1038,8 +1038,8 @@ void tst_qqmlecmascript::overrideExtensionProperties()
QQmlComponent component(&engine, testFileUrl("extensionObjectsPropertyOverride.qml"));
OverrideDefaultPropertyObject *object =
qobject_cast<OverrideDefaultPropertyObject *>(component.create());
- QVERIFY(object != 0);
- QVERIFY(object->secondProperty() != 0);
+ QVERIFY(object != nullptr);
+ QVERIFY(object->secondProperty() != nullptr);
QVERIFY(!object->firstProperty());
delete object;
@@ -1050,7 +1050,7 @@ void tst_qqmlecmascript::attachedProperties()
{
QQmlComponent component(&engine, testFileUrl("attachedProperty.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("a").toInt(), 19);
QCOMPARE(object->property("b").toInt(), 19);
QCOMPARE(object->property("c").toInt(), 19);
@@ -1061,7 +1061,7 @@ void tst_qqmlecmascript::attachedProperties()
{
QQmlComponent component(&engine, testFileUrl("attachedProperty.2.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("a").toInt(), 26);
QCOMPARE(object->property("b").toInt(), 26);
QCOMPARE(object->property("c").toInt(), 26);
@@ -1073,13 +1073,13 @@ void tst_qqmlecmascript::attachedProperties()
{
QQmlComponent component(&engine, testFileUrl("writeAttachedProperty.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "writeValue2");
MyQmlAttachedObject *attached =
qobject_cast<MyQmlAttachedObject *>(qmlAttachedPropertiesObject<MyQmlObject>(object));
- QVERIFY(attached != 0);
+ QVERIFY(attached != nullptr);
QCOMPARE(attached->value2(), 9);
delete object;
@@ -1092,7 +1092,7 @@ void tst_qqmlecmascript::enums()
{
QQmlComponent component(&engine, testFileUrl("enums.1.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("enumProperty").toInt(), (int)MyQmlObject::EnumValue2);
QCOMPARE(object->property("relatedEnumProperty").toInt(), (int)MyEnumContainer::RelatedValue);
@@ -1135,7 +1135,7 @@ void tst_qqmlecmascript::enums()
QQmlComponent component(&engine, testFileUrl("enums.2.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("a").toInt(), 0);
QCOMPARE(object->property("b").toInt(), 0);
QCOMPARE(object->property("c").toInt(), 0);
@@ -1162,7 +1162,7 @@ void tst_qqmlecmascript::enums()
{
QQmlComponent component(&engine, testFileUrl("enums.3.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// check the values are what we expect
QCOMPARE(object->property("a").toInt(), 4);
@@ -1196,7 +1196,7 @@ void tst_qqmlecmascript::valueTypeFunctions()
{
QQmlComponent component(&engine, testFileUrl("valueTypeFunctions.qml"));
MyTypeObject *obj = qobject_cast<MyTypeObject*>(component.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QCOMPARE(obj->rectProperty(), QRect(0,0,100,100));
QCOMPARE(obj->rectFProperty(), QRectF(0,0.5,100,99.5));
@@ -1213,7 +1213,7 @@ void tst_qqmlecmascript::constantsOverrideBindings()
{
QQmlComponent component(&engine, testFileUrl("constantsOverrideBindings.1.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("c2").toInt(), 0);
object->setProperty("c1", QVariant(9));
@@ -1232,7 +1232,7 @@ void tst_qqmlecmascript::constantsOverrideBindings()
{
QQmlComponent component(&engine, testFileUrl("constantsOverrideBindings.2.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("c1").toInt(), 0);
QCOMPARE(object->property("c2").toInt(), 10);
@@ -1268,7 +1268,7 @@ void tst_qqmlecmascript::constantsOverrideBindings()
{
QQmlComponent component(&engine, testFileUrl("constantsOverrideBindings.4.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("c1").toInt(), 0);
QCOMPARE(object->property("c3").toInt(), 10);
@@ -1289,7 +1289,7 @@ void tst_qqmlecmascript::outerBindingOverridesInnerBinding()
QQmlComponent component(&engine,
testFileUrl("outerBindingOverridesInnerBinding.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("c1").toInt(), 0);
QCOMPARE(object->property("c2").toInt(), 0);
@@ -1321,7 +1321,7 @@ void tst_qqmlecmascript::nonExistentAttachedObject()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -1331,7 +1331,7 @@ void tst_qqmlecmascript::scope()
{
QQmlComponent component(&engine, testFileUrl("scope.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1").toInt(), 1);
QCOMPARE(object->property("test2").toInt(), 2);
@@ -1350,7 +1350,7 @@ void tst_qqmlecmascript::scope()
{
QQmlComponent component(&engine, testFileUrl("scope.2.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1").toInt(), 19);
QCOMPARE(object->property("test2").toInt(), 19);
@@ -1365,7 +1365,7 @@ void tst_qqmlecmascript::scope()
{
QQmlComponent component(&engine, testFileUrl("scope.3.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1").toBool(), true);
QEXPECT_FAIL("", "Properties resolvable at compile time come before the global object, which is not 100% compatible with older QML versions", Continue);
@@ -1379,7 +1379,7 @@ void tst_qqmlecmascript::scope()
{
QQmlComponent component(&engine, testFileUrl("scope.4.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toInt(), 0);
QCOMPARE(object->property("test2").toString(), QString());
@@ -1395,7 +1395,7 @@ void tst_qqmlecmascript::scope()
{
QQmlComponent component(&engine, testFileUrl("scope.5.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1").toBool(), true);
QCOMPARE(object->property("test2").toBool(), true);
@@ -1406,7 +1406,7 @@ void tst_qqmlecmascript::scope()
{
QQmlComponent component(&engine, testFileUrl("scope.6.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), true);
@@ -1420,7 +1420,7 @@ void tst_qqmlecmascript::importScope()
{
QQmlComponent component(&engine, testFileUrl("importScope.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toInt(), 240);
@@ -1435,7 +1435,7 @@ void tst_qqmlecmascript::signalParameterTypes()
{
QQmlComponent component(&engine, testFileUrl("signalParameterTypes.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
emit object->basicSignal();
@@ -1462,7 +1462,7 @@ void tst_qqmlecmascript::objectsCompareAsEqual()
{
QQmlComponent component(&engine, testFileUrl("objectsCompareAsEqual.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1").toBool(), true);
QCOMPARE(object->property("test2").toBool(), true);
@@ -1482,7 +1482,7 @@ void tst_qqmlecmascript::aliasPropertyAndBinding()
{
QQmlComponent component(&engine, testFileUrl("aliasPropertyAndBinding.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("c2").toInt(), 3);
QCOMPARE(object->property("c3").toInt(), 3);
@@ -1501,12 +1501,12 @@ and that the aliased property is reset correctly if possible.
*/
void tst_qqmlecmascript::aliasPropertyReset()
{
- QObject *object = 0;
+ QObject *object = nullptr;
// test that a manual write (of undefined) to a resettable aliased property succeeds
QQmlComponent c1(&engine, testFileUrl("aliasreset/aliasPropertyReset.1.qml"));
object = c1.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("sourceComponentAlias").value<QQmlComponent*>() != 0);
QCOMPARE(object->property("aliasIsUndefined"), QVariant(false));
QMetaObject::invokeMethod(object, "resetAliased");
@@ -1517,7 +1517,7 @@ void tst_qqmlecmascript::aliasPropertyReset()
// test that a manual write (of undefined) to a resettable alias property succeeds
QQmlComponent c2(&engine, testFileUrl("aliasreset/aliasPropertyReset.2.qml"));
object = c2.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("sourceComponentAlias").value<QQmlComponent*>() != 0);
QCOMPARE(object->property("loaderSourceComponentIsUndefined"), QVariant(false));
QMetaObject::invokeMethod(object, "resetAlias");
@@ -1528,7 +1528,7 @@ void tst_qqmlecmascript::aliasPropertyReset()
// test that an alias to a bound property works correctly
QQmlComponent c3(&engine, testFileUrl("aliasreset/aliasPropertyReset.3.qml"));
object = c3.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("sourceComponentAlias").value<QQmlComponent*>() != 0);
QCOMPARE(object->property("loaderOneSourceComponentIsUndefined"), QVariant(false));
QCOMPARE(object->property("loaderTwoSourceComponentIsUndefined"), QVariant(false));
@@ -1542,10 +1542,10 @@ void tst_qqmlecmascript::aliasPropertyReset()
// whose aliased property's object has been deleted, does not crash.
QQmlComponent c4(&engine, testFileUrl("aliasreset/aliasPropertyReset.4.qml"));
object = c4.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("sourceComponentAlias").value<QQmlComponent*>() != 0);
QObject *loader = object->findChild<QObject*>("loader");
- QVERIFY(loader != 0);
+ QVERIFY(loader != nullptr);
delete loader;
QVERIFY(object->property("sourceComponentAlias").value<QQmlComponent*>() == 0); // deletion should have caused value unset.
QMetaObject::invokeMethod(object, "resetAlias"); // shouldn't crash.
@@ -1557,7 +1557,7 @@ void tst_qqmlecmascript::aliasPropertyReset()
// test that binding an alias property to an undefined value works correctly
QQmlComponent c5(&engine, testFileUrl("aliasreset/aliasPropertyReset.5.qml"));
object = c5.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("sourceComponentAlias").value<QQmlComponent*>() == 0); // bound to undefined value.
delete object;
@@ -1566,7 +1566,7 @@ void tst_qqmlecmascript::aliasPropertyReset()
QString warning1 = url.toString() + QLatin1String(":15: Error: Cannot assign [undefined] to int");
QQmlComponent e1(&engine, url);
object = e1.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("intAlias").value<int>(), 12);
QCOMPARE(object->property("aliasedIntIsUndefined"), QVariant(false));
QTest::ignoreMessage(QtWarningMsg, warning1.toLatin1().constData());
@@ -1638,7 +1638,7 @@ void tst_qqmlecmascript::componentCreation()
QQmlComponent component(&engine, testUrl);
MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, method.toUtf8());
QQmlComponent *created = object->componentProperty();
@@ -1650,7 +1650,7 @@ void tst_qqmlecmascript::componentCreation()
if (createdParent == QLatin1String("obj")) {
expectedParent = object;
} else if ((createdParent == QLatin1String("null")) || createdParent.isEmpty()) {
- expectedParent = 0;
+ expectedParent = nullptr;
}
QCOMPARE(created->parent(), expectedParent);
}
@@ -1677,7 +1677,7 @@ void tst_qqmlecmascript::dynamicCreation()
QQmlComponent component(&engine, testFileUrl("dynamicCreation.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, method.toUtf8());
QObject *created = object->objectProperty();
@@ -1695,8 +1695,8 @@ void tst_qqmlecmascript::dynamicDestruction()
{
QQmlComponent component(&engine, testFileUrl("dynamicDeletion.qml"));
QPointer<MyQmlObject> object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
- QPointer<QObject> createdQmlObject = 0;
+ QVERIFY(object != nullptr);
+ QPointer<QObject> createdQmlObject = nullptr;
QMetaObject::invokeMethod(object, "create");
createdQmlObject = object->objectProperty();
@@ -1706,13 +1706,13 @@ void tst_qqmlecmascript::dynamicDestruction()
QMetaObject::invokeMethod(object, "killOther");
QVERIFY(createdQmlObject);
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
QVERIFY(createdQmlObject);
for (int ii = 0; createdQmlObject && ii < 50; ++ii) { // After 5 seconds we should give up
if (createdQmlObject) {
QTest::qWait(100);
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
}
}
@@ -1721,7 +1721,7 @@ void tst_qqmlecmascript::dynamicDestruction()
QQmlEngine::setObjectOwnership(object, QQmlEngine::JavaScriptOwnership);
QMetaObject::invokeMethod(object, "killMe");
QVERIFY(object);
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
QVERIFY(!object);
}
@@ -1729,7 +1729,7 @@ void tst_qqmlecmascript::dynamicDestruction()
{
QQmlComponent component(&engine, testFileUrl("dynamicDeletion.2.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QVERIFY(!qvariant_cast<QObject*>(o->property("objectProperty")));
@@ -1739,7 +1739,7 @@ void tst_qqmlecmascript::dynamicDestruction()
QMetaObject::invokeMethod(o, "destroy");
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
QVERIFY(!qvariant_cast<QObject*>(o->property("objectProperty")));
@@ -1749,10 +1749,10 @@ void tst_qqmlecmascript::dynamicDestruction()
{
// QTBUG-23451
- QPointer<QObject> createdQmlObject = 0;
+ QPointer<QObject> createdQmlObject = nullptr;
QQmlComponent component(&engine, testFileUrl("dynamicDeletion.3.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QVERIFY(!qvariant_cast<QObject*>(o->property("objectProperty")));
QMetaObject::invokeMethod(o, "create");
createdQmlObject = qvariant_cast<QObject*>(o->property("objectProperty"));
@@ -1761,7 +1761,7 @@ void tst_qqmlecmascript::dynamicDestruction()
QCOMPARE(qvariant_cast<bool>(o->property("test")), false);
for (int ii = 0; createdQmlObject && ii < 50; ++ii) { // After 5 seconds we should give up
QTest::qWait(100);
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
}
QVERIFY(!qvariant_cast<QObject*>(o->property("objectProperty")));
@@ -1777,7 +1777,7 @@ void tst_qqmlecmascript::objectToString()
{
QQmlComponent component(&engine, testFileUrl("qmlToString.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "testToString");
QVERIFY(object->stringProperty().startsWith("MyQmlObject_QML_"));
QVERIFY(object->stringProperty().endsWith(", \"objName\")"));
@@ -1797,7 +1797,7 @@ void tst_qqmlecmascript::objectHasOwnProperty()
QQmlComponent component(&engine, url);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// test QObjects in QML
QMetaObject::invokeMethod(object, "testHasOwnPropertySuccess");
@@ -1807,7 +1807,7 @@ void tst_qqmlecmascript::objectHasOwnProperty()
// now test other types in QML
QObject *child = object->findChild<QObject*>("typeObj");
- QVERIFY(child != 0);
+ QVERIFY(child != nullptr);
QMetaObject::invokeMethod(child, "testHasOwnPropertySuccess");
QCOMPARE(child->property("valueTypeHasOwnProperty").toBool(), true);
QCOMPARE(child->property("valueTypeHasOwnProperty2").toBool(), true);
@@ -1844,7 +1844,7 @@ void tst_qqmlecmascript::selfDeletingBinding()
{
QQmlComponent component(&engine, testFileUrl("selfDeletingBinding.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
object->setProperty("triggerDelete", true);
delete object;
}
@@ -1852,7 +1852,7 @@ void tst_qqmlecmascript::selfDeletingBinding()
{
QQmlComponent component(&engine, testFileUrl("selfDeletingBinding.2.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
object->setProperty("triggerDelete", true);
delete object;
}
@@ -1869,7 +1869,7 @@ void tst_qqmlecmascript::extendedObjectPropertyLookup()
{
QQmlComponent component(&engine, testFileUrl("extendedObjectPropertyLookup.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -1880,7 +1880,7 @@ void tst_qqmlecmascript::extendedObjectPropertyLookup2()
{
QQmlComponent component(&engine, testFileUrl("extendedObjectPropertyLookup2.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVariant returnValue;
QVERIFY(QMetaObject::invokeMethod(object, "getValue", Q_RETURN_ARG(QVariant, returnValue)));
@@ -1908,7 +1908,7 @@ void tst_qqmlecmascript::extendedObjectPropertyLookup3()
QQmlComponent component(&engine, testFileUrl("extendedObjectPropertyLookup3.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVariant returnValue;
QVERIFY(QMetaObject::invokeMethod(object, "getAbstractProperty", Q_RETURN_ARG(QVariant, returnValue)));
@@ -1943,7 +1943,7 @@ void tst_qqmlecmascript::scriptErrors()
QTest::ignoreMessage(QtWarningMsg, warning5.toLatin1().constData());
QTest::ignoreMessage(QtWarningMsg, warning6.toLatin1().constData());
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QTest::ignoreMessage(QtWarningMsg, warning4.toLatin1().constData());
emit object->basicSignal();
@@ -1970,14 +1970,14 @@ void tst_qqmlecmascript::functionErrors()
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
// test that if an exception occurs while invoking js function from cpp, it is reported as expected.
QQmlComponent componentTwo(&engine, testFileUrl("scarceResourceFunctionFail.var.qml"));
url = componentTwo.url().toString();
object = componentTwo.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QObject *resource = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
warning = url + QLatin1String(":16: TypeError: Property 'scarceResource' of object ScarceResourceObject(0x%1) is not a function");
@@ -1997,7 +1997,7 @@ void tst_qqmlecmascript::propertyAssignmentErrors()
QString url = component.url().toString();
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1").toBool(), true);
QCOMPARE(object->property("test2").toBool(), true);
@@ -2013,7 +2013,7 @@ void tst_qqmlecmascript::signalTriggeredBindings()
{
QQmlComponent component(&engine, testFileUrl("signalTriggeredBindings.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("base").toReal(), 50.);
QCOMPARE(object->property("test1").toReal(), 50.);
@@ -2041,7 +2041,7 @@ void tst_qqmlecmascript::listProperties()
{
QQmlComponent component(&engine, testFileUrl("listProperties.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1").toInt(), 21);
QCOMPARE(object->property("test2").toInt(), 2);
@@ -2060,7 +2060,7 @@ void tst_qqmlecmascript::exceptionClearsOnReeval()
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), false);
@@ -2083,7 +2083,7 @@ void tst_qqmlecmascript::exceptionSlotProducesWarning()
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -2096,7 +2096,7 @@ void tst_qqmlecmascript::exceptionBindingProducesWarning()
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -2105,7 +2105,7 @@ void tst_qqmlecmascript::compileInvalidBinding()
// QTBUG-23387: ensure that invalid bindings don't cause a crash.
QQmlComponent component(&engine, testFileUrl("v8bindingException.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -2118,7 +2118,7 @@ void tst_qqmlecmascript::transientErrors()
QQmlTestMessageHandler messageHandler;
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY2(messageHandler.messages().isEmpty(), qPrintable(messageHandler.messageString()));
@@ -2132,7 +2132,7 @@ void tst_qqmlecmascript::transientErrors()
QQmlTestMessageHandler messageHandler;
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY2(messageHandler.messages().isEmpty(), qPrintable(messageHandler.messageString()));
@@ -2145,7 +2145,7 @@ void tst_qqmlecmascript::shutdownErrors()
{
QQmlComponent component(&engine, testFileUrl("shutdownErrors.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QQmlTestMessageHandler messageHandler;
@@ -2168,7 +2168,7 @@ void tst_qqmlecmascript::jsObject()
{
QQmlComponent component(&engine, testFileUrl("jsObject.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toInt(), 92);
@@ -2180,7 +2180,7 @@ void tst_qqmlecmascript::undefinedResetsProperty()
{
QQmlComponent component(&engine, testFileUrl("undefinedResetsProperty.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("resettableProperty").toInt(), 92);
@@ -2197,7 +2197,7 @@ void tst_qqmlecmascript::undefinedResetsProperty()
{
QQmlComponent component(&engine, testFileUrl("undefinedResetsProperty.2.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("resettableProperty").toInt(), 19);
@@ -2214,7 +2214,7 @@ void tst_qqmlecmascript::qtbug_22464()
{
QQmlComponent component(&engine, testFileUrl("qtbug_22464.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), true);
@@ -2226,7 +2226,7 @@ void tst_qqmlecmascript::qtbug_21580()
QQmlComponent component(&engine, testFileUrl("qtbug_21580.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), true);
@@ -2239,7 +2239,7 @@ void tst_qqmlecmascript::singleV8BindingDestroyedDuringEvaluation()
QQmlComponent component(&engine, testFileUrl("singleV8BindingDestroyedDuringEvaluation.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -2248,7 +2248,7 @@ void tst_qqmlecmascript::bug1()
{
QQmlComponent component(&engine, testFileUrl("bug.1.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toInt(), 14);
@@ -2270,7 +2270,7 @@ void tst_qqmlecmascript::bug2()
component.setData("import Qt.test 1.0;\nQPlainTextEdit { width: 100 }", QUrl());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -2281,7 +2281,7 @@ void tst_qqmlecmascript::dynamicCreationCrash()
{
QQmlComponent component(&engine, testFileUrl("dynamicCreation.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QTest::ignoreMessage(QtWarningMsg, "QQmlComponent: Component is not ready");
QMetaObject::invokeMethod(object, "dontCrash");
@@ -2302,9 +2302,9 @@ void tst_qqmlecmascript::dynamicCreationOwnership()
QQmlEngine dcoEngine;
QQmlComponent component(&dcoEngine, testFileUrl("dynamicCreationOwnership.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
MyDynamicCreationDestructionObject *mdcdo = object->findChild<MyDynamicCreationDestructionObject*>("mdcdo");
- QVERIFY(mdcdo != 0);
+ QVERIFY(mdcdo != nullptr);
mdcdo->setDtorCount(&dtorCount);
for (int i = 1; i < 105; ++i, ++expectedDtorCount) {
@@ -2315,14 +2315,14 @@ void tst_qqmlecmascript::dynamicCreationOwnership()
QMetaObject::invokeMethod(object, "performGc");
}
if (i % 10 == 0) {
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
}
}
delete object;
}
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
QCOMPARE(dtorCount, expectedDtorCount);
}
@@ -2333,7 +2333,7 @@ void tst_qqmlecmascript::regExpBug()
{
QQmlComponent component(&engine, testFileUrl("regExp.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->regExp().pattern(), QLatin1String("[a-zA-z]"));
delete object;
}
@@ -2731,28 +2731,28 @@ void tst_qqmlecmascript::callQtInvokables()
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 13);
QCOMPARE(o->actuals().count(), 1);
- QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)0));
+ QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)nullptr));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QObject(\"Hello world\")", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 13);
QCOMPARE(o->actuals().count(), 1);
- QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)0));
+ QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)nullptr));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QObject(null)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 13);
QCOMPARE(o->actuals().count(), 1);
- QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)0));
+ QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)nullptr));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QObject(undefined)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
QCOMPARE(o->invoked(), 13);
QCOMPARE(o->actuals().count(), 1);
- QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)0));
+ QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)nullptr));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QObject(object)", QV4::Primitive::undefinedValue()));
@@ -3099,7 +3099,7 @@ void tst_qqmlecmascript::listToVariant()
context.setContextObject(&container);
QObject *object = component.create(&context);
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVariant v = object->property("test");
QCOMPARE(v.userType(), qMetaTypeId<QQmlListReference>());
@@ -3166,11 +3166,11 @@ void tst_qqmlecmascript::attachedPropertyScope()
QQmlComponent component(&engine, testFileUrl("attachedPropertyScope.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
MyQmlAttachedObject *attached =
qobject_cast<MyQmlAttachedObject *>(qmlAttachedPropertiesObject<MyQmlObject>(object));
- QVERIFY(attached != 0);
+ QVERIFY(attached != nullptr);
QCOMPARE(object->property("value2").toInt(), 0);
@@ -3187,7 +3187,7 @@ void tst_qqmlecmascript::scriptConnect()
QQmlComponent component(&engine, testFileUrl("scriptConnect.1.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), false);
emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
@@ -3200,7 +3200,7 @@ void tst_qqmlecmascript::scriptConnect()
QQmlComponent component(&engine, testFileUrl("scriptConnect.2.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), false);
emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
@@ -3213,7 +3213,7 @@ void tst_qqmlecmascript::scriptConnect()
QQmlComponent component(&engine, testFileUrl("scriptConnect.3.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), false);
emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
@@ -3226,7 +3226,7 @@ void tst_qqmlecmascript::scriptConnect()
QQmlComponent component(&engine, testFileUrl("scriptConnect.4.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->methodCalled(), false);
emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
@@ -3239,7 +3239,7 @@ void tst_qqmlecmascript::scriptConnect()
QQmlComponent component(&engine, testFileUrl("scriptConnect.5.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->methodCalled(), false);
emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
@@ -3252,7 +3252,7 @@ void tst_qqmlecmascript::scriptConnect()
QQmlComponent component(&engine, testFileUrl("scriptConnect.6.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toInt(), 0);
emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
@@ -3268,7 +3268,7 @@ void tst_qqmlecmascript::scriptDisconnect()
QQmlComponent component(&engine, testFileUrl("scriptDisconnect.1.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toInt(), 0);
emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
@@ -3287,7 +3287,7 @@ void tst_qqmlecmascript::scriptDisconnect()
QQmlComponent component(&engine, testFileUrl("scriptDisconnect.2.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toInt(), 0);
emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
@@ -3306,7 +3306,7 @@ void tst_qqmlecmascript::scriptDisconnect()
QQmlComponent component(&engine, testFileUrl("scriptDisconnect.3.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toInt(), 0);
emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
@@ -3324,7 +3324,7 @@ void tst_qqmlecmascript::scriptDisconnect()
QQmlComponent component(&engine, testFileUrl("scriptDisconnect.4.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toInt(), 0);
emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
@@ -3361,13 +3361,13 @@ void tst_qqmlecmascript::ownership()
{
QQmlComponent component(&engine, testFileUrl("ownership.qml"));
- QVERIFY(own.object != 0);
+ QVERIFY(own.object != nullptr);
QObject *object = component.create(context);
engine.collectGarbage();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
QVERIFY(own.object.isNull());
@@ -3380,16 +3380,16 @@ void tst_qqmlecmascript::ownership()
{
QQmlComponent component(&engine, testFileUrl("ownership.qml"));
- QVERIFY(own.object != 0);
+ QVERIFY(own.object != nullptr);
QObject *object = component.create(context);
engine.collectGarbage();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
- QVERIFY(own.object != 0);
+ QVERIFY(own.object != nullptr);
delete object;
}
@@ -3401,7 +3401,7 @@ class CppOwnershipReturnValue : public QObject
{
Q_OBJECT
public:
- CppOwnershipReturnValue() : value(0) {}
+ CppOwnershipReturnValue() : value(nullptr) {}
~CppOwnershipReturnValue() { delete value; }
Q_INVOKABLE QObject *create() {
@@ -3436,16 +3436,16 @@ void tst_qqmlecmascript::cppOwnershipReturnValue()
QObject *object = component.create();
- QVERIFY(object != 0);
- QVERIFY(source.value != 0);
+ QVERIFY(object != nullptr);
+ QVERIFY(source.value != nullptr);
delete object;
}
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
- QVERIFY(source.value != 0);
+ QVERIFY(source.value != nullptr);
}
// QTBUG-15697
@@ -3464,14 +3464,14 @@ void tst_qqmlecmascript::ownershipCustomReturnValue()
QObject *object = component.create();
- QVERIFY(object != 0);
- QVERIFY(source.value != 0);
+ QVERIFY(object != nullptr);
+ QVERIFY(source.value != nullptr);
delete object;
}
engine.collectGarbage();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
QVERIFY(source.value.isNull());
@@ -3483,7 +3483,7 @@ class OwnershipChangingObject : public QObject
{
Q_OBJECT
public:
- OwnershipChangingObject(): object(0) { }
+ OwnershipChangingObject(): object(nullptr) { }
QPointer<QObject> object;
@@ -3504,10 +3504,10 @@ void tst_qqmlecmascript::ownershipRootObject()
engine.collectGarbage();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
- QVERIFY(own.object != 0);
+ QVERIFY(own.object != nullptr);
delete context;
delete object;
@@ -3534,10 +3534,10 @@ void tst_qqmlecmascript::ownershipConsistency()
engine.collectGarbage();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
- QVERIFY(own.object != 0);
+ QVERIFY(own.object != nullptr);
delete context;
delete object;
@@ -3553,7 +3553,7 @@ void tst_qqmlecmascript::ownershipQmlIncubated()
QMetaObject::invokeMethod(object, "deleteIncubatedItem");
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
QVERIFY(!object->property("incubatedItem").value<QObject*>());
@@ -3605,7 +3605,7 @@ void tst_qqmlecmascript::strictlyEquals()
QQmlComponent component(&engine, testFileUrl("strictlyEquals.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1").toBool(), true);
QCOMPARE(object->property("test2").toBool(), true);
@@ -3624,7 +3624,7 @@ void tst_qqmlecmascript::compiled()
QQmlComponent component(&engine, testFileUrl("compiled.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1").toReal(), qreal(15.7));
QCOMPARE(object->property("test2").toReal(), qreal(-6.7));
@@ -3664,7 +3664,7 @@ void tst_qqmlecmascript::numberAssignment()
QQmlComponent component(&engine, testFileUrl("numberAssignment.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1"), QVariant((qreal)6.7));
QCOMPARE(object->property("test2"), QVariant((qreal)6.7));
@@ -3690,7 +3690,7 @@ void tst_qqmlecmascript::propertySplicing()
QQmlComponent component(&engine, testFileUrl("propertySplicing.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), true);
@@ -3703,7 +3703,7 @@ void tst_qqmlecmascript::signalWithUnknownTypes()
QQmlComponent component(&engine, testFileUrl("signalWithUnknownTypes.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
MyQmlObject::MyType type;
type.value = 0x8971123;
@@ -3755,7 +3755,7 @@ void tst_qqmlecmascript::signalWithJSValueInVariant()
QQmlComponent component(&engine, testFileUrl("signalWithJSValueInVariant.qml"));
QScopedPointer<MyQmlObject> object(qobject_cast<MyQmlObject *>(component.create()));
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QJSValue value = engine.evaluate(expression);
QVERIFY(!value.isError());
@@ -3779,7 +3779,7 @@ void tst_qqmlecmascript::signalWithJSValueInVariant_twoEngines()
QQmlComponent component(&engine, testFileUrl("signalWithJSValueInVariant.qml"));
QScopedPointer<MyQmlObject> object(qobject_cast<MyQmlObject *>(component.create()));
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QJSEngine engine2;
QJSValue value = engine2.evaluate(expression);
@@ -3809,7 +3809,7 @@ void tst_qqmlecmascript::signalWithQJSValue()
QQmlComponent component(&engine, testFileUrl("signalWithQJSValue.qml"));
QScopedPointer<MyQmlObject> object(qobject_cast<MyQmlObject *>(component.create()));
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QJSValue value = engine.evaluate(expression);
QVERIFY(!value.isError());
@@ -3975,7 +3975,7 @@ void tst_qqmlecmascript::singletonType()
if (!errorMessage.isEmpty()) {
QVERIFY(!object);
} else {
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
for (int i = 0; i < readProperties.size(); ++i)
QCOMPARE(object->property(readProperties.at(i).toLatin1().constData()), readExpectedValues.at(i));
for (int i = 0; i < writeProperties.size(); ++i)
@@ -4010,7 +4010,7 @@ void tst_qqmlecmascript::singletonTypeCaching()
QQmlEngine cleanEngine;
QQmlComponent component(&cleanEngine, testfile);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QList<QVariant> firstValues;
QMetaObject::invokeMethod(object, "modifyValues");
for (int i = 0; i < readProperties.size(); ++i)
@@ -4019,7 +4019,7 @@ void tst_qqmlecmascript::singletonTypeCaching()
QQmlComponent component2(&cleanEngine, testfile);
QObject *object2 = component2.create();
- QVERIFY(object2 != 0);
+ QVERIFY(object2 != nullptr);
for (int i = 0; i < readProperties.size(); ++i)
QCOMPARE(object2->property(readProperties.at(i).toLatin1().constData()), firstValues.at(i)); // cached, shouldn't have changed.
delete object2;
@@ -4055,18 +4055,18 @@ void tst_qqmlecmascript::verifyContextLifetime(QQmlContextData *ctxt) {
QQmlContextData *scriptContext, *newContext;
qml = scripts->getIndexed(i);
- scriptContext = qml ? qml->getContext() : 0;
+ scriptContext = qml ? qml->getContext() : nullptr;
qml = QV4::Encode::undefined();
{
QV4::Scope scope(v4);
- QV4::ScopedContext temporaryScope(scope, QV4::QmlContext::create(scope.engine->rootContext(), scriptContext, 0));
+ QV4::ScopedContext temporaryScope(scope, QV4::QmlContext::create(scope.engine->rootContext(), scriptContext, nullptr));
Q_UNUSED(temporaryScope)
}
ctxt->engine->collectGarbage();
qml = scripts->getIndexed(i);
- newContext = qml ? qml->getContext() : 0;
+ newContext = qml ? qml->getContext() : nullptr;
QCOMPARE(scriptContext, newContext);
}
}
@@ -4341,7 +4341,7 @@ void tst_qqmlecmascript::importScripts()
if (!errorMessage.isEmpty()) {
QVERIFY(!object);
} else {
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QQmlContextData *ctxt = QQmlContextData::get(engine.rootContext());
tst_qqmlecmascript::verifyContextLifetime(ctxt);
@@ -4377,9 +4377,9 @@ void tst_qqmlecmascript::scarceResources_other()
origPixmap.fill(Qt::blue);
QString srp_name, expectedWarning;
QV4::ExecutionEngine *v4 = engine.handle();
- ScarceResourceObject *eo = 0;
- QObject *srsc = 0;
- QObject *object = 0;
+ ScarceResourceObject *eo = nullptr;
+ QObject *srsc = nullptr;
+ QObject *object = nullptr;
/* property var semantics */
@@ -4408,7 +4408,7 @@ void tst_qqmlecmascript::scarceResources_other()
// test that scarce resources are handled properly from js functions in qml files
QQmlComponent varComponentEleven(&engine, testFileUrl("scarceResourceFunction.var.qml"));
object = varComponentEleven.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(!object->property("scarceResourceCopy").isValid()); // not yet assigned, so should not be valid
eo = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
QVERIFY(eo->scarceResourceIsDetached()); // should be no other copies of it at this stage.
@@ -4427,7 +4427,7 @@ void tst_qqmlecmascript::scarceResources_other()
// test that if an exception occurs while invoking js function from cpp, that the resources are released.
QQmlComponent varComponentTwelve(&engine, testFileUrl("scarceResourceFunctionFail.var.qml"));
object = varComponentTwelve.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(!object->property("scarceResourceCopy").isValid()); // not yet assigned, so should not be valid
eo = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
QVERIFY(eo->scarceResourceIsDetached()); // should be no other copies of it at this stage.
@@ -4445,7 +4445,7 @@ void tst_qqmlecmascript::scarceResources_other()
// that the scarce resource is removed from the engine's list of scarce resources to clean up.
QQmlComponent varComponentThirteen(&engine, testFileUrl("scarceResourceObjectGc.var.qml"));
object = varComponentThirteen.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(!object->property("varProperty").isValid()); // not assigned yet
QMetaObject::invokeMethod(object, "assignVarProperty");
QVERIFY(v4->scarceResources.isEmpty()); // the scarce resource is a VME property.
@@ -4459,7 +4459,7 @@ void tst_qqmlecmascript::scarceResources_other()
// test that scarce resources are handled properly in signal invocation
QQmlComponent variantComponentTen(&engine, testFileUrl("scarceResourceSignal.variant.qml"));
object = variantComponentTen.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
srsc = object->findChild<QObject*>("srsc");
QVERIFY(srsc);
QVERIFY(!srsc->property("scarceResourceCopy").isValid()); // hasn't been instantiated yet.
@@ -4482,7 +4482,7 @@ void tst_qqmlecmascript::scarceResources_other()
// test that scarce resources are handled properly from js functions in qml files
QQmlComponent variantComponentEleven(&engine, testFileUrl("scarceResourceFunction.variant.qml"));
object = variantComponentEleven.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(!object->property("scarceResourceCopy").isValid()); // not yet assigned, so should not be valid
eo = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
QVERIFY(eo->scarceResourceIsDetached()); // should be no other copies of it at this stage.
@@ -4501,7 +4501,7 @@ void tst_qqmlecmascript::scarceResources_other()
// test that if an exception occurs while invoking js function from cpp, that the resources are released.
QQmlComponent variantComponentTwelve(&engine, testFileUrl("scarceResourceFunctionFail.variant.qml"));
object = variantComponentTwelve.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(!object->property("scarceResourceCopy").isValid()); // not yet assigned, so should not be valid
eo = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
QVERIFY(eo->scarceResourceIsDetached()); // should be no other copies of it at this stage.
@@ -4748,12 +4748,12 @@ void tst_qqmlecmascript::scarceResources()
QFETCH(QStringList, expectedErrors);
QV4::ExecutionEngine *v4 = engine.handle();
- ScarceResourceObject *eo = 0;
- QObject *object = 0;
+ ScarceResourceObject *eo = nullptr;
+ QObject *object = nullptr;
QQmlComponent c(&engine, qmlFile);
object = c.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
for (int i = 0; i < propertyNames.size(); ++i) {
QString prop = propertyNames.at(i);
bool validity = expectedValidity.at(i).toBool();
@@ -4781,7 +4781,7 @@ void tst_qqmlecmascript::propertyChangeSlots()
// ensure that allowable property names are allowed and onPropertyNameChanged slots are generated correctly.
QQmlComponent component(&engine, testFileUrl("changeslots/propertyChangeSlots.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
// ensure that invalid property names fail properly.
@@ -4847,7 +4847,7 @@ void tst_qqmlecmascript::propertyVar()
QQmlComponent component(&engine, qmlFile);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), true);
@@ -4886,7 +4886,7 @@ void tst_qqmlecmascript::propertyQJSValue()
QQmlComponent component(&engine, qmlFile);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), true);
@@ -4896,14 +4896,14 @@ void tst_qqmlecmascript::propertyQJSValue()
// Tests that we can write QVariant values to var properties from C++
void tst_qqmlecmascript::propertyVarCpp()
{
- QObject *object = 0;
+ QObject *object = nullptr;
// ensure that writing to and reading from a var property from cpp works as required.
// Literal values stored in var properties can be read and written as QVariants
// of a specific type, whereas object values are read as QVariantMaps.
QQmlComponent component(&engine, testFileUrl("propertyVarCpp.qml"));
object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// assign int to property var that currently has int assigned
QVERIFY(object->setProperty("varProperty", QVariant::fromValue(10)));
QCOMPARE(object->property("varBound"), QVariant(15));
@@ -4926,7 +4926,7 @@ void tst_qqmlecmascript::propertyVarOwnership()
{
QQmlComponent component(&engine, testFileUrl("propertyVarOwnership.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), false);
QMetaObject::invokeMethod(object, "runTest");
QCOMPARE(object->property("test").toBool(), true);
@@ -4936,7 +4936,7 @@ void tst_qqmlecmascript::propertyVarOwnership()
{
QQmlComponent component(&engine, testFileUrl("propertyVarOwnership.2.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), false);
QMetaObject::invokeMethod(object, "runTest");
QCOMPARE(object->property("test").toBool(), true);
@@ -4946,7 +4946,7 @@ void tst_qqmlecmascript::propertyVarOwnership()
{
QQmlComponent component(&engine, testFileUrl("propertyVarOwnership.3.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test2").toBool(), false);
QCOMPARE(object->property("test2").toBool(), false);
@@ -4970,7 +4970,7 @@ void tst_qqmlecmascript::propertyVarOwnership()
{
QQmlComponent component(&engine, testFileUrl("propertyVarOwnership.4.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), true);
@@ -4989,7 +4989,7 @@ void tst_qqmlecmascript::propertyVarOwnership()
{
QQmlComponent component(&engine, testFileUrl("propertyVarOwnership.5.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "createComponent");
engine.collectGarbage();
QMetaObject::invokeMethod(object, "runTest");
@@ -5005,20 +5005,20 @@ void tst_qqmlecmascript::propertyVarImplicitOwnership()
// has implicit ownership of the constructed QObject.
QQmlComponent component(&engine, testFileUrl("propertyVarImplicitOwnership.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "assignCircular");
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
QCoreApplication::processEvents();
QObject *rootObject = object->property("vp").value<QObject*>();
- QVERIFY(rootObject != 0);
+ QVERIFY(rootObject != nullptr);
QObject *childObject = rootObject->findChild<QObject*>("text");
- QVERIFY(childObject != 0);
+ QVERIFY(childObject != nullptr);
QCOMPARE(rootObject->property("rectCanary").toInt(), 5);
QCOMPARE(childObject->property("textCanary").toInt(), 10);
QMetaObject::invokeMethod(childObject, "constructQObject"); // creates a reference to a constructed QObject.
QPointer<QObject> qobjectGuard(childObject->property("vp").value<QObject*>()); // get the pointer prior to processing deleteLater events.
QVERIFY(!qobjectGuard.isNull());
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
QCoreApplication::processEvents();
QVERIFY(!qobjectGuard.isNull());
QMetaObject::invokeMethod(object, "deassignCircular");
@@ -5032,9 +5032,9 @@ void tst_qqmlecmascript::propertyVarReparent()
// ensure that nothing breaks if we re-parent objects
QQmlComponent component(&engine, testFileUrl("propertyVar.reparent.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "assignVarProp");
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
QCoreApplication::processEvents();
QObject *rect = object->property("vp").value<QObject*>();
QObject *text = rect->findChild<QObject*>("textOne");
@@ -5074,9 +5074,9 @@ void tst_qqmlecmascript::propertyVarReparentNullContext()
// this test ensures that no crash occurs in that situation.
QQmlComponent component(&engine, testFileUrl("propertyVar.reparent.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "assignVarProp");
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
QCoreApplication::processEvents();
QObject *rect = object->property("vp").value<QObject*>();
QObject *text = rect->findChild<QObject*>("textOne");
@@ -5110,7 +5110,7 @@ void tst_qqmlecmascript::propertyVarCircular()
// enforce behaviour regarding circular references - ensure qdvmemo deletion.
QQmlComponent component(&engine, testFileUrl("propertyVar.circular.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "assignCircular"); // cause assignment and gc
{
QCOMPARE(object->property("canaryInt"), QVariant(5));
@@ -5118,7 +5118,7 @@ void tst_qqmlecmascript::propertyVarCircular()
QVERIFY(canaryResourceVariant.isValid());
}
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
QCoreApplication::processEvents();
QCOMPARE(object->property("canaryInt"), QVariant(5));
QVariant canaryResourceVariant = object->property("canaryResource");
@@ -5142,14 +5142,14 @@ void tst_qqmlecmascript::propertyVarCircular2()
// where the child has a var property referencing its parent.
QQmlComponent component(&engine, testFileUrl("propertyVar.circular.2.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "assignCircular");
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
QCoreApplication::processEvents();
QObject *rootObject = object->property("vp").value<QObject*>();
- QVERIFY(rootObject != 0);
+ QVERIFY(rootObject != nullptr);
QObject *childObject = rootObject->findChild<QObject*>("text");
- QVERIFY(childObject != 0);
+ QVERIFY(childObject != nullptr);
QPointer<QObject> rootObjectTracker(rootObject);
QVERIFY(!rootObjectTracker.isNull());
QPointer<QObject> childObjectTracker(childObject);
@@ -5170,9 +5170,9 @@ void tst_qqmlecmascript::propertyVarInheritance()
// The particular component under test here has a chain of references.
QQmlComponent component(&engine, testFileUrl("propertyVar.inherit.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "assignCircular"); // cause assignment and gc
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
QCoreApplication::processEvents();
// we want to be able to track when the varProperties array of the last metaobject is disposed
QObject *cco5 = object->property("varProperty").value<QObject*>()->property("vp").value<QObject*>()->property("vp").value<QObject*>()->property("vp").value<QObject*>()->property("vp").value<QObject*>();
@@ -5215,14 +5215,14 @@ void tst_qqmlecmascript::propertyVarInheritance2()
// only link between rootObject and childObject is that rootObject is the parent of childObject.
QQmlComponent component(&engine, testFileUrl("propertyVar.circular.2.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "assignCircular");
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
QCoreApplication::processEvents();
QObject *rootObject = object->property("vp").value<QObject*>();
- QVERIFY(rootObject != 0);
+ QVERIFY(rootObject != nullptr);
QObject *childObject = rootObject->findChild<QObject*>("text");
- QVERIFY(childObject != 0);
+ QVERIFY(childObject != nullptr);
QCOMPARE(rootObject->property("rectCanary").toInt(), 5);
QCOMPARE(childObject->property("textCanary").toInt(), 10);
QV4::WeakValue childObjectVarArrayValueHandle;
@@ -5249,7 +5249,7 @@ void tst_qqmlecmascript::elementAssign()
QQmlComponent component(&engine, testFileUrl("elementAssign.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), true);
@@ -5262,7 +5262,7 @@ void tst_qqmlecmascript::objectPassThroughSignals()
QQmlComponent component(&engine, testFileUrl("objectsPassThroughSignals.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), true);
@@ -5275,7 +5275,7 @@ void tst_qqmlecmascript::objectConversion()
QQmlComponent component(&engine, testFileUrl("objectConversion.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVariant retn;
QMetaObject::invokeMethod(object, "circularObject", Q_RETURN_ARG(QVariant, retn));
QCOMPARE(retn.value<QJSValue>().property("test").toInt(), int(100));
@@ -5290,7 +5290,7 @@ void tst_qqmlecmascript::booleanConversion()
QQmlComponent component(&engine, testFileUrl("booleanConversion.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test_true1").toBool(), true);
QCOMPARE(object->property("test_true2").toBool(), true);
@@ -5313,7 +5313,7 @@ void tst_qqmlecmascript::handleReferenceManagement()
QQmlEngine hrmEngine;
QQmlComponent component(&hrmEngine, testFileUrl("handleReferenceManagement.object.1.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
CircularReferenceObject *cro = object->findChild<CircularReferenceObject*>("cro");
cro->setDtorCount(&dtorCount);
QMetaObject::invokeMethod(object, "createReference");
@@ -5321,7 +5321,7 @@ void tst_qqmlecmascript::handleReferenceManagement()
QCOMPARE(dtorCount, 0); // second has JS ownership, kept alive by first's reference
delete object;
hrmEngine.collectGarbage();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
QCOMPARE(dtorCount, 3);
}
@@ -5332,7 +5332,7 @@ void tst_qqmlecmascript::handleReferenceManagement()
QQmlEngine hrmEngine;
QQmlComponent component(&hrmEngine, testFileUrl("handleReferenceManagement.object.2.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
CircularReferenceObject *cro = object->findChild<CircularReferenceObject*>("cro");
cro->setDtorCount(&dtorCount);
QMetaObject::invokeMethod(object, "circularReference");
@@ -5340,7 +5340,7 @@ void tst_qqmlecmascript::handleReferenceManagement()
QCOMPARE(dtorCount, 2); // both should be cleaned up, since circular references shouldn't keep alive.
delete object;
hrmEngine.collectGarbage();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
QCOMPARE(dtorCount, 3);
}
@@ -5350,7 +5350,7 @@ void tst_qqmlecmascript::handleReferenceManagement()
QQmlEngine hrmEngine;
QQmlComponent component(&hrmEngine, testFileUrl("handleReferenceManagement.dynprop.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "createReference");
gc(hrmEngine);
QMetaObject::invokeMethod(object, "ensureReference");
@@ -5367,7 +5367,7 @@ void tst_qqmlecmascript::handleReferenceManagement()
QQmlEngine hrmEngine;
QQmlComponent component(&hrmEngine, testFileUrl("handleReferenceManagement.dynprop.2.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "createReference");
gc(hrmEngine);
QMetaObject::invokeMethod(object, "ensureReference");
@@ -5384,7 +5384,7 @@ void tst_qqmlecmascript::handleReferenceManagement()
QQmlEngine hrmEngine;
QQmlComponent component(&hrmEngine, testFileUrl("handleReferenceManagement.dynprop.3.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "createReference");
gc(hrmEngine);
QMetaObject::invokeMethod(object, "ensureReference");
@@ -5401,7 +5401,7 @@ void tst_qqmlecmascript::stringArg()
{
QQmlComponent component(&engine, testFileUrl("stringArg.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "success");
QVERIFY(object->property("returnValue").toBool());
@@ -5418,7 +5418,7 @@ void tst_qqmlecmascript::readonlyDeclaration()
QQmlComponent component(&engine, testFileUrl("readonlyDeclaration.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(), true);
@@ -5436,9 +5436,9 @@ void tst_qqmlecmascript::sequenceConversionRead()
QUrl qmlFile = testFileUrl("sequenceConversion.read.qml");
QQmlComponent component(&engine, qmlFile);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
MySequenceConversionObject *seq = object->findChild<MySequenceConversionObject*>("msco");
- QVERIFY(seq != 0);
+ QVERIFY(seq != nullptr);
QMetaObject::invokeMethod(object, "readSequences");
QList<int> intList; intList << 1 << 2 << 3 << 4;
@@ -5487,9 +5487,9 @@ void tst_qqmlecmascript::sequenceConversionRead()
QUrl qmlFile = testFileUrl("sequenceConversion.read.error.qml");
QQmlComponent component(&engine, qmlFile);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
MySequenceConversionObject *seq = object->findChild<MySequenceConversionObject*>("msco");
- QVERIFY(seq != 0);
+ QVERIFY(seq != nullptr);
// we haven't registered QList<NonRegisteredType> as a sequence type.
QString warningOne = QLatin1String("QMetaProperty::read: Unable to handle unregistered datatype 'QList<NonRegisteredType>' for property 'MySequenceConversionObject::typeListProperty'");
@@ -5516,9 +5516,9 @@ void tst_qqmlecmascript::sequenceConversionWrite()
QUrl qmlFile = testFileUrl("sequenceConversion.write.qml");
QQmlComponent component(&engine, qmlFile);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
MySequenceConversionObject *seq = object->findChild<MySequenceConversionObject*>("msco");
- QVERIFY(seq != 0);
+ QVERIFY(seq != nullptr);
QMetaObject::invokeMethod(object, "writeSequences");
QCOMPARE(object->property("success").toBool(), true);
@@ -5539,9 +5539,9 @@ void tst_qqmlecmascript::sequenceConversionWrite()
QUrl qmlFile = testFileUrl("sequenceConversion.write.error.qml");
QQmlComponent component(&engine, qmlFile);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
MySequenceConversionObject *seq = object->findChild<MySequenceConversionObject*>("msco");
- QVERIFY(seq != 0);
+ QVERIFY(seq != nullptr);
// we haven't registered QList<QPoint> as a sequence type, so writing shouldn't work.
QString warningOne = qmlFile.toString() + QLatin1String(":16: Error: Cannot assign QJSValue to QList<QPoint>");
@@ -5562,7 +5562,7 @@ void tst_qqmlecmascript::sequenceConversionArray()
QUrl qmlFile = testFileUrl("sequenceConversion.array.qml");
QQmlComponent component(&engine, qmlFile);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "indexedAccess");
QVERIFY(object->property("success").toBool());
QMetaObject::invokeMethod(object, "arrayOperations");
@@ -5582,7 +5582,7 @@ void tst_qqmlecmascript::sequenceConversionIndexes()
QUrl qmlFile = testFileUrl("sequenceConversion.indexes.qml");
QQmlComponent component(&engine, qmlFile);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QString w1 = qmlFile.toString() + QLatin1String(":34: Index out of range during length set");
QString w2 = qmlFile.toString() + QLatin1String(":41: Index out of range during indexed set");
QString w3 = qmlFile.toString() + QLatin1String(":48: Index out of range during indexed get");
@@ -5603,7 +5603,7 @@ void tst_qqmlecmascript::sequenceConversionThreads()
QUrl qmlFile = testFileUrl("sequenceConversion.threads.qml");
QQmlComponent component(&engine, qmlFile);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "testIntSequence");
QTRY_VERIFY(object->property("finished").toBool());
@@ -5642,7 +5642,7 @@ void tst_qqmlecmascript::sequenceConversionBindings()
QUrl qmlFile = testFileUrl("sequenceConversion.bindings.qml");
QQmlComponent component(&engine, qmlFile);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QList<int> intList; intList << 1 << 2 << 3 << 12 << 7;
QCOMPARE(object->property("boundSequence").value<QList<int> >(), intList);
QCOMPARE(object->property("boundElement").toInt(), intList.at(3));
@@ -5657,7 +5657,7 @@ void tst_qqmlecmascript::sequenceConversionBindings()
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
QQmlComponent component(&engine, qmlFile);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
}
@@ -5667,7 +5667,7 @@ void tst_qqmlecmascript::sequenceConversionCopy()
QUrl qmlFile = testFileUrl("sequenceConversion.copy.qml");
QQmlComponent component(&engine, qmlFile);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "testCopySequences");
QCOMPARE(object->property("success").toBool(), true);
QMetaObject::invokeMethod(object, "readSequenceCopyElements");
@@ -5687,7 +5687,7 @@ void tst_qqmlecmascript::assignSequenceTypes()
{
QQmlComponent component(&engine, testFileUrl("assignSequenceTypes.1.qml"));
MySequenceConversionObject *object = qobject_cast<MySequenceConversionObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->intListProperty(), (QList<int>() << 1 << 2));
QCOMPARE(object->qrealListProperty(), (QList<qreal>() << 1.1 << 2.2 << 3));
QCOMPARE(object->boolListProperty(), (QList<bool>() << false << true));
@@ -5701,7 +5701,7 @@ void tst_qqmlecmascript::assignSequenceTypes()
{
QQmlComponent component(&engine, testFileUrl("assignSequenceTypes.2.qml"));
MySequenceConversionObject *object = qobject_cast<MySequenceConversionObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->intListProperty(), (QList<int>() << 1));
QCOMPARE(object->qrealListProperty(), (QList<qreal>() << 1.1));
QCOMPARE(object->boolListProperty(), (QList<bool>() << false));
@@ -5715,7 +5715,7 @@ void tst_qqmlecmascript::assignSequenceTypes()
{
QQmlComponent component(&engine, testFileUrl("assignSequenceTypes.3.qml"));
MySequenceConversionObject *object = qobject_cast<MySequenceConversionObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->intListProperty(), (QList<int>() << 1));
QCOMPARE(object->qrealListProperty(), (QList<qreal>() << 1));
QCOMPARE(object->boolListProperty(), (QList<bool>() << false));
@@ -5727,7 +5727,7 @@ void tst_qqmlecmascript::assignSequenceTypes()
{
QQmlComponent component(&engine, testFileUrl("assignSequenceTypes.4.qml"));
MySequenceConversionObject *object = qobject_cast<MySequenceConversionObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->intListProperty(), (QList<int>() << 1 << 2));
QCOMPARE(object->qrealListProperty(), (QList<qreal>() << 1.1 << 2.2 << 3));
QCOMPARE(object->boolListProperty(), (QList<bool>() << false << true));
@@ -5741,7 +5741,7 @@ void tst_qqmlecmascript::assignSequenceTypes()
{
QQmlComponent component(&engine, testFileUrl("assignSequenceTypes.5.qml"));
MySequenceConversionObject *object = qobject_cast<MySequenceConversionObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->intListProperty(), (QList<int>() << 1));
QCOMPARE(object->qrealListProperty(), (QList<qreal>() << 1.1));
QCOMPARE(object->boolListProperty(), (QList<bool>() << false));
@@ -5755,7 +5755,7 @@ void tst_qqmlecmascript::assignSequenceTypes()
{
QQmlComponent component(&engine, testFileUrl("assignSequenceTypes.6.qml"));
MySequenceConversionObject *object = qobject_cast<MySequenceConversionObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->intListProperty(), (QList<int>() << 1));
QCOMPARE(object->qrealListProperty(), (QList<qreal>() << 1));
QCOMPARE(object->boolListProperty(), (QList<bool>() << false));
@@ -5767,13 +5767,13 @@ void tst_qqmlecmascript::assignSequenceTypes()
{
QQmlComponent component(&engine, testFileUrl("assignSequenceTypes.7.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
MySequenceConversionObject *msco1 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco1"));
MySequenceConversionObject *msco2 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco2"));
MySequenceConversionObject *msco3 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco3"));
MySequenceConversionObject *msco4 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco4"));
MySequenceConversionObject *msco5 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco5"));
- QVERIFY(msco1 != 0 && msco2 != 0 && msco3 != 0 && msco4 != 0 && msco5 != 0);
+ QVERIFY(msco1 != nullptr && msco2 != nullptr && msco3 != nullptr && msco4 != nullptr && msco5 != nullptr);
QCOMPARE(msco1->urlListProperty(), (QList<QUrl>() << QUrl(testFileUrl("example.html"))));
QCOMPARE(msco2->urlListProperty(), (QList<QUrl>() << QUrl(testFileUrl("example.html"))));
QCOMPARE(msco3->urlListProperty(), (QList<QUrl>() << QUrl(testFileUrl("example.html")) << QUrl(testFileUrl("example2.html"))));
@@ -5790,9 +5790,9 @@ void tst_qqmlecmascript::nullObjectBinding()
QQmlComponent component(&engine, testFileUrl("nullObjectBinding.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
- QVERIFY(object->property("test") == QVariant::fromValue((QObject *)0));
+ QVERIFY(object->property("test") == QVariant::fromValue((QObject *)nullptr));
delete object;
}
@@ -5847,7 +5847,7 @@ void tst_qqmlecmascript::deletedEngine()
QQmlComponent component(engine, testFileUrl("deletedEngine.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("a").toInt(), 39);
object->setProperty("b", QVariant(9));
@@ -5869,7 +5869,7 @@ void tst_qqmlecmascript::libraryScriptAssert()
QQmlComponent component(&engine, testFileUrl("libraryScriptAssert.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -5879,7 +5879,7 @@ void tst_qqmlecmascript::variantsAssignedUndefined()
QQmlComponent component(&engine, testFileUrl("variantsAssignedUndefined.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1").toInt(), 10);
QCOMPARE(object->property("test2").toInt(), 11);
@@ -5898,7 +5898,7 @@ void tst_qqmlecmascript::variants()
QQmlComponent component(&engine, testFileUrl("variants.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("undefinedVariant").type(), QVariant::Invalid);
QCOMPARE(int(object->property("nullVariant").type()), int(QMetaType::Nullptr));
@@ -5923,7 +5923,7 @@ void tst_qqmlecmascript::qtbug_9792()
QQmlContext *context = new QQmlContext(engine.rootContext());
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create(context));
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QTest::ignoreMessage(QtDebugMsg, "Hello world!");
object->basicSignal();
@@ -5945,10 +5945,10 @@ void tst_qqmlecmascript::qtcreatorbug_1289()
QQmlComponent component(&engine, testFileUrl("qtcreatorbug_1289.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QObject *nested = qvariant_cast<QObject *>(o->property("object"));
- QVERIFY(nested != 0);
+ QVERIFY(nested != nullptr);
QVERIFY(qvariant_cast<QObject *>(nested->property("nestedObject")) == o);
@@ -5995,9 +5995,9 @@ void tst_qqmlecmascript::canAssignNullToQObject()
QQmlComponent component(&engine, testFileUrl("canAssignNullToQObject.1.qml"));
MyQmlObject *o = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
- QVERIFY(o->objectProperty() != 0);
+ QVERIFY(o->objectProperty() != nullptr);
o->setProperty("runTest", true);
@@ -6010,7 +6010,7 @@ void tst_qqmlecmascript::canAssignNullToQObject()
QQmlComponent component(&engine, testFileUrl("canAssignNullToQObject.2.qml"));
MyQmlObject *o = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QVERIFY(!o->objectProperty());
@@ -6033,7 +6033,7 @@ void tst_qqmlecmascript::functionAssignment_fromBinding()
QTest::ignoreMessage(QtWarningMsg, w4.toLatin1().constData());
MyQmlObject *o = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QVERIFY(!o->property("a").isValid());
@@ -6048,7 +6048,7 @@ void tst_qqmlecmascript::functionAssignment_fromJS()
QVERIFY2(component.errorString().isEmpty(), qPrintable(component.errorString()));
MyQmlObject *o = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QVERIFY(!o->property("a").isValid());
o->setProperty("aNumber", QVariant(5));
@@ -6080,7 +6080,7 @@ void tst_qqmlecmascript::functionAssignmentfromJS_invalid()
QVERIFY2(component.errorString().isEmpty(), qPrintable(component.errorString()));
MyQmlObject *o = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QVERIFY(!o->property("a").isValid());
o->setProperty("assignFuncWithoutReturn", true);
@@ -6107,7 +6107,7 @@ void tst_qqmlecmascript::functionAssignment_afterBinding()
QTest::ignoreMessage(QtWarningMsg, w1.toLatin1().constData());
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("t1"), QVariant::fromValue<int>(4)); // should have bound
QCOMPARE(o->property("t2"), QVariant::fromValue<int>(2)); // should not have changed
@@ -6119,7 +6119,7 @@ void tst_qqmlecmascript::eval()
QQmlComponent component(&engine, testFileUrl("eval.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test1").toBool(), true);
QCOMPARE(o->property("test2").toBool(), true);
@@ -6135,7 +6135,7 @@ void tst_qqmlecmascript::function()
QQmlComponent component(&engine, testFileUrl("function.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test1").toBool(), true);
QCOMPARE(o->property("test2").toBool(), true);
@@ -6151,7 +6151,7 @@ void tst_qqmlecmascript::include()
{
QQmlComponent component(&engine, testFileUrl("include.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test0").toInt(), 99);
QCOMPARE(o->property("test1").toBool(), true);
@@ -6167,7 +6167,7 @@ void tst_qqmlecmascript::include()
{
QQmlComponent component(&engine, testFileUrl("include_shared.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test0").toInt(), 99);
QCOMPARE(o->property("test1").toBool(), true);
@@ -6183,7 +6183,7 @@ void tst_qqmlecmascript::include()
{
QQmlComponent component(&engine, testFileUrl("include_callback.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test1").toBool(), true);
QCOMPARE(o->property("test2").toBool(), true);
@@ -6199,7 +6199,7 @@ void tst_qqmlecmascript::include()
{
QQmlComponent component(&engine, testFileUrl("include_pragma.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test1").toInt(), 100);
delete o;
@@ -6213,7 +6213,7 @@ void tst_qqmlecmascript::include()
QQmlComponent component(&engine, testFileUrl("include_remote_missing.qml"));
QObject *o = component.beginCreate(engine.rootContext());
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
o->setProperty("serverBaseUrl", server.baseUrl().toString());
component.completeCreate();
@@ -6230,7 +6230,7 @@ void tst_qqmlecmascript::include()
{
QQmlComponent component(&engine, QUrl("qrc:///data/include.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test0").toInt(), 99);
QCOMPARE(o->property("test1").toBool(), true);
@@ -6253,7 +6253,7 @@ void tst_qqmlecmascript::includeRemoteSuccess()
QQmlComponent component(&engine, testFileUrl("include_remote.qml"));
QObject *o = component.beginCreate(engine.rootContext());
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
o->setProperty("serverBaseUrl", server.baseUrl().toString());
component.completeCreate();
@@ -6279,7 +6279,7 @@ void tst_qqmlecmascript::signalHandlers()
{
QQmlComponent component(&engine, testFileUrl("signalHandlers.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("count").toInt(), 0);
QMetaObject::invokeMethod(o, "testSignalCall");
@@ -6340,7 +6340,7 @@ void tst_qqmlecmascript::qtbug_10696()
{
QQmlComponent component(&engine, testFileUrl("qtbug_10696.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
delete o;
}
@@ -6348,7 +6348,7 @@ void tst_qqmlecmascript::qtbug_11606()
{
QQmlComponent component(&engine, testFileUrl("qtbug_11606.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
delete o;
}
@@ -6357,7 +6357,7 @@ void tst_qqmlecmascript::qtbug_11600()
{
QQmlComponent component(&engine, testFileUrl("qtbug_11600.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
delete o;
}
@@ -6366,7 +6366,7 @@ void tst_qqmlecmascript::qtbug_21864()
{
QQmlComponent component(&engine, testFileUrl("qtbug_21864.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
delete o;
}
@@ -6377,7 +6377,7 @@ void tst_qqmlecmascript::rewriteMultiLineStrings()
// QTBUG-23387
QQmlComponent component(&engine, testFileUrl("rewriteMultiLineStrings.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QTRY_COMPARE(o->property("test").toBool(), true);
delete o;
}
@@ -6385,7 +6385,7 @@ void tst_qqmlecmascript::rewriteMultiLineStrings()
{
QQmlComponent component(&engine, testFileUrl("rewriteMultiLineStrings_crlf.1.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
delete o;
}
}
@@ -6399,7 +6399,7 @@ void tst_qqmlecmascript::qobjectConnectionListExceptionHandling()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
delete o;
}
@@ -6409,7 +6409,7 @@ void tst_qqmlecmascript::nonscriptable()
{
QQmlComponent component(&engine, testFileUrl("nonscriptable.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("readOk").toBool(), true);
QCOMPARE(o->property("writeOk").toBool(), true);
delete o;
@@ -6420,7 +6420,7 @@ void tst_qqmlecmascript::deleteLater()
{
QQmlComponent component(&engine, testFileUrl("deleteLater.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
delete o;
}
@@ -6430,7 +6430,7 @@ void tst_qqmlecmascript::objectNameChangedSignal()
{
QQmlComponent component(&engine, testFileUrl("objectNameChangedSignal.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), false);
o->setObjectName("obj");
QCOMPARE(o->property("test").toBool(), true);
@@ -6451,7 +6451,7 @@ void tst_qqmlecmascript::in()
{
QQmlComponent component(&engine, testFileUrl("in.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test1").toBool(), true);
QCOMPARE(o->property("test2").toBool(), true);
delete o;
@@ -6462,7 +6462,7 @@ void tst_qqmlecmascript::typeOf()
QQmlComponent component(&engine, testFileUrl("typeOf.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test1").toString(), QLatin1String("undefined"));
QCOMPARE(o->property("test2").toString(), QLatin1String("object"));
@@ -6481,7 +6481,7 @@ void tst_qqmlecmascript::qtbug_24448()
{
QQmlComponent component(&engine, testFileUrl("qtbug_24448.qml"));
QScopedPointer<QObject> o(component.create());
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QVERIFY(o->property("test").toBool());
}
@@ -6489,7 +6489,7 @@ void tst_qqmlecmascript::sharedAttachedObject()
{
QQmlComponent component(&engine, testFileUrl("sharedAttachedObject.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test1").toBool(), true);
QCOMPARE(o->property("test2").toBool(), true);
delete o;
@@ -6500,7 +6500,7 @@ void tst_qqmlecmascript::objectName()
{
QQmlComponent component(&engine, testFileUrl("objectName.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test1").toString(), QString("hello"));
QCOMPARE(o->property("test2").toString(), QString("ell"));
@@ -6517,7 +6517,7 @@ void tst_qqmlecmascript::writeRemovesBinding()
{
QQmlComponent component(&engine, testFileUrl("writeRemovesBinding.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
@@ -6529,7 +6529,7 @@ void tst_qqmlecmascript::aliasBindingsAssignCorrectly()
{
QQmlComponent component(&engine, testFileUrl("aliasBindingsAssignCorrectly.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
@@ -6542,7 +6542,7 @@ void tst_qqmlecmascript::aliasBindingsOverrideTarget()
{
QQmlComponent component(&engine, testFileUrl("aliasBindingsOverrideTarget.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
@@ -6552,7 +6552,7 @@ void tst_qqmlecmascript::aliasBindingsOverrideTarget()
{
QQmlComponent component(&engine, testFileUrl("aliasBindingsOverrideTarget.2.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
@@ -6562,7 +6562,7 @@ void tst_qqmlecmascript::aliasBindingsOverrideTarget()
{
QQmlComponent component(&engine, testFileUrl("aliasBindingsOverrideTarget.3.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
@@ -6576,7 +6576,7 @@ void tst_qqmlecmascript::aliasWritesOverrideBindings()
{
QQmlComponent component(&engine, testFileUrl("aliasWritesOverrideBindings.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
@@ -6586,7 +6586,7 @@ void tst_qqmlecmascript::aliasWritesOverrideBindings()
{
QQmlComponent component(&engine, testFileUrl("aliasWritesOverrideBindings.2.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
@@ -6596,7 +6596,7 @@ void tst_qqmlecmascript::aliasWritesOverrideBindings()
{
QQmlComponent component(&engine, testFileUrl("aliasWritesOverrideBindings.3.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
@@ -6611,7 +6611,7 @@ void tst_qqmlecmascript::aliasToCompositeElement()
QQmlComponent component(&engine, testFileUrl("aliasToCompositeElement.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -6624,7 +6624,7 @@ void tst_qqmlecmascript::qtbug_20344()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -6643,7 +6643,7 @@ void tst_qqmlecmascript::revisionErrors()
QTest::ignoreMessage(QtWarningMsg, warning2.toLatin1().constData());
QTest::ignoreMessage(QtWarningMsg, warning3.toLatin1().constData());
MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
{
@@ -6665,7 +6665,7 @@ void tst_qqmlecmascript::revisionErrors()
QTest::ignoreMessage(QtWarningMsg, warning4.toLatin1().constData());
QTest::ignoreMessage(QtWarningMsg, warning5.toLatin1().constData());
MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
{
@@ -6681,7 +6681,7 @@ void tst_qqmlecmascript::revisionErrors()
QTest::ignoreMessage(QtWarningMsg, warning2.toLatin1().constData());
QTest::ignoreMessage(QtWarningMsg, warning3.toLatin1().constData());
MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
}
@@ -6693,7 +6693,7 @@ void tst_qqmlecmascript::revision()
QString url = component.url().toString();
MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
{
@@ -6701,7 +6701,7 @@ void tst_qqmlecmascript::revision()
QString url = component.url().toString();
MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
{
@@ -6709,7 +6709,7 @@ void tst_qqmlecmascript::revision()
QString url = component.url().toString();
MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
// Test that non-root classes can resolve revisioned methods
@@ -6717,7 +6717,7 @@ void tst_qqmlecmascript::revision()
QQmlComponent component(&engine, testFileUrl("metaobjectRevision4.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toReal(), 11.);
delete object;
}
@@ -6726,7 +6726,7 @@ void tst_qqmlecmascript::revision()
QQmlComponent component(&engine, testFileUrl("metaobjectRevision5.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toReal(), 11.);
delete object;
}
@@ -6736,7 +6736,7 @@ void tst_qqmlecmascript::realToInt()
{
QQmlComponent component(&engine, testFileUrl("realToInt.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "test1");
QCOMPARE(object->value(), int(4));
@@ -6749,7 +6749,7 @@ void tst_qqmlecmascript::urlProperty()
{
QQmlComponent component(&engine, testFileUrl("urlProperty.1.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
object->setStringProperty("http://qt-project.org");
QCOMPARE(object->urlProperty(), QUrl("http://qt-project.org/index.html"));
QCOMPARE(object->intProperty(), 123);
@@ -6763,7 +6763,7 @@ void tst_qqmlecmascript::urlPropertyWithEncoding()
{
QQmlComponent component(&engine, testFileUrl("urlProperty.2.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
object->setStringProperty("http://qt-project.org");
const QUrl encoded = QUrl::fromEncoded("http://qt-project.org/?get%3cDATA%3e", QUrl::TolerantMode);
QCOMPARE(object->urlProperty(), encoded);
@@ -6777,12 +6777,12 @@ void tst_qqmlecmascript::urlListPropertyWithEncoding()
{
QQmlComponent component(&engine, testFileUrl("urlListProperty.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
MySequenceConversionObject *msco1 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco1"));
MySequenceConversionObject *msco2 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco2"));
MySequenceConversionObject *msco3 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco3"));
MySequenceConversionObject *msco4 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco4"));
- QVERIFY(msco1 != 0 && msco2 != 0 && msco3 != 0 && msco4 != 0);
+ QVERIFY(msco1 != nullptr && msco2 != nullptr && msco3 != nullptr && msco4 != nullptr);
const QUrl encoded = QUrl::fromEncoded("http://qt-project.org/?get%3cDATA%3e", QUrl::TolerantMode);
QCOMPARE(msco1->urlListProperty(), (QList<QUrl>() << encoded));
QCOMPARE(msco2->urlListProperty(), (QList<QUrl>() << encoded));
@@ -6796,7 +6796,7 @@ void tst_qqmlecmascript::dynamicString()
{
QQmlComponent component(&engine, testFileUrl("dynamicString.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("stringProperty").toString(),
QString::fromLatin1("string:Hello World false:0 true:1 uint32:100 int32:-100 double:3.14159 date:2011-02-11 05::30:50!"));
}
@@ -6805,35 +6805,35 @@ void tst_qqmlecmascript::deleteLaterObjectMethodCall()
{
QQmlComponent component(&engine, testFileUrl("deleteLaterObjectMethodCall.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
void tst_qqmlecmascript::automaticSemicolon()
{
QQmlComponent component(&engine, testFileUrl("automaticSemicolon.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
void tst_qqmlecmascript::compatibilitySemicolon()
{
QQmlComponent component(&engine, testFileUrl("compatibilitySemicolon.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
void tst_qqmlecmascript::incrDecrSemicolon1()
{
QQmlComponent component(&engine, testFileUrl("incrDecrSemicolon1.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
void tst_qqmlecmascript::incrDecrSemicolon2()
{
QQmlComponent component(&engine, testFileUrl("incrDecrSemicolon2.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
void tst_qqmlecmascript::incrDecrSemicolon_error1()
@@ -6847,7 +6847,7 @@ void tst_qqmlecmascript::unaryExpression()
{
QQmlComponent component(&engine, testFileUrl("unaryExpression.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
// Makes sure that a binding isn't double re-evaluated when it depends on the same variable twice
@@ -6855,9 +6855,9 @@ void tst_qqmlecmascript::doubleEvaluate()
{
QQmlComponent component(&engine, testFileUrl("doubleEvaluate.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
WriteCounter *wc = qobject_cast<WriteCounter *>(object);
- QVERIFY(wc != 0);
+ QVERIFY(wc != nullptr);
QCOMPARE(wc->count(), 1);
wc->setProperty("x", 9);
@@ -6875,7 +6875,7 @@ void tst_qqmlecmascript::nonNotifyable()
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QString expected1 = QLatin1String("QQmlExpression: Expression ") +
component.url().toString() +
@@ -6907,7 +6907,7 @@ void tst_qqmlecmascript::forInLoop()
{
QQmlComponent component(&engine, testFileUrl("forInLoop.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaObject::invokeMethod(object, "listProperty");
@@ -6927,7 +6927,7 @@ void tst_qqmlecmascript::deleteWhileBindingRunning()
{
QQmlComponent component(&engine, testFileUrl("deleteWhileBindingRunning.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -6942,7 +6942,7 @@ void tst_qqmlecmascript::qtbug_22679()
QSignalSpy warningsSpy(&engine, SIGNAL(warnings(QList<QQmlError>)));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(warningsSpy.count(), 0);
delete o;
}
@@ -6979,7 +6979,7 @@ void tst_qqmlecmascript::switchStatement()
{
QQmlComponent component(&engine, testFileUrl("switchStatement.1.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// `object->value()' is the number of executed statements
@@ -7002,7 +7002,7 @@ void tst_qqmlecmascript::switchStatement()
{
QQmlComponent component(&engine, testFileUrl("switchStatement.2.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// `object->value()' is the number of executed statements
@@ -7025,7 +7025,7 @@ void tst_qqmlecmascript::switchStatement()
{
QQmlComponent component(&engine, testFileUrl("switchStatement.3.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// `object->value()' is the number of executed statements
@@ -7052,7 +7052,7 @@ void tst_qqmlecmascript::switchStatement()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// `object->value()' is the number of executed statements
@@ -7076,7 +7076,7 @@ void tst_qqmlecmascript::switchStatement()
{
QQmlComponent component(&engine, testFileUrl("switchStatement.5.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// `object->value()' is the number of executed statements
@@ -7099,7 +7099,7 @@ void tst_qqmlecmascript::switchStatement()
{
QQmlComponent component(&engine, testFileUrl("switchStatement.6.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// `object->value()' is the number of executed statements
@@ -7126,7 +7126,7 @@ void tst_qqmlecmascript::withStatement()
QUrl url = testFileUrl("withStatement.1.qml");
QQmlComponent component(&engine, url);
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->value(), 123);
}
@@ -7137,7 +7137,7 @@ void tst_qqmlecmascript::tryStatement()
{
QQmlComponent component(&engine, testFileUrl("tryStatement.1.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->value(), 123);
}
@@ -7145,7 +7145,7 @@ void tst_qqmlecmascript::tryStatement()
{
QQmlComponent component(&engine, testFileUrl("tryStatement.2.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->value(), 321);
}
@@ -7153,7 +7153,7 @@ void tst_qqmlecmascript::tryStatement()
{
QQmlComponent component(&engine, testFileUrl("tryStatement.3.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->value(), 1);
}
@@ -7161,7 +7161,7 @@ void tst_qqmlecmascript::tryStatement()
{
QQmlComponent component(&engine, testFileUrl("tryStatement.4.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->value(), 1);
}
@@ -7199,7 +7199,7 @@ void tst_qqmlecmascript::invokableWithQObjectDerived()
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("result").value<bool>());
delete object;
@@ -7211,7 +7211,7 @@ void tst_qqmlecmascript::realTypePrecision()
// Properties and signal parameters of type real should have double precision.
QQmlComponent component(&engine, testFileUrl("realTypePrecision.qml"));
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toDouble(), 1234567890.);
QCOMPARE(object->property("test2").toDouble(), 1234567890.);
QCOMPARE(object->property("test3").toDouble(), 1234567890.);
@@ -7225,7 +7225,7 @@ void tst_qqmlecmascript::registeredFlagMethod()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("registeredFlagMethod.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->buttons(), 0);
emit object->basicSignal();
@@ -7240,7 +7240,7 @@ void tst_qqmlecmascript::replaceBinding()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("replaceBinding.qml"));
QObject *obj = c.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QVERIFY(obj->property("success").toBool());
delete obj;
@@ -7252,7 +7252,7 @@ void tst_qqmlecmascript::deleteRootObjectInCreation()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("deleteRootObjectInCreation.qml"));
QObject *obj = c.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QVERIFY(obj->property("rootIndestructible").toBool());
QVERIFY(!obj->property("childDestructible").toBool());
QTest::qWait(1);
@@ -7263,7 +7263,7 @@ void tst_qqmlecmascript::deleteRootObjectInCreation()
{
QQmlComponent c(&engine, testFileUrl("deleteRootObjectInCreation.2.qml"));
QObject *object = c.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("testConditionsMet").toBool());
delete object;
}
@@ -7277,9 +7277,9 @@ void tst_qqmlecmascript::onDestruction()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("onDestruction.qml"));
QObject *obj = c.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
delete obj;
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
}
{
@@ -7290,8 +7290,8 @@ void tst_qqmlecmascript::onDestruction()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("onDestruction.qml"));
QObject *obj = c.create();
- QVERIFY(obj != 0);
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QVERIFY(obj != nullptr);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
}
}
@@ -7402,7 +7402,7 @@ struct EventProcessor : public QObject
public:
Q_INVOKABLE void process()
{
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
}
};
@@ -7417,7 +7417,7 @@ void tst_qqmlecmascript::bindingSuppression()
QQmlComponent c(&engine, testFileUrl("bindingSuppression.qml"));
QObject *obj = c.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
delete obj;
QVERIFY2(messageHandler.messages().isEmpty(), qPrintable(messageHandler.messageString()));
@@ -7430,7 +7430,7 @@ void tst_qqmlecmascript::signalEmitted()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("signalEmitted.2.qml"));
QObject *obj = c.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QTRY_VERIFY(obj->property("success").toBool());
delete obj;
}
@@ -7440,7 +7440,7 @@ void tst_qqmlecmascript::signalEmitted()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("signalEmitted.3.qml"));
QObject *obj = c.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
gc(engine); // should collect c1.
QTRY_VERIFY(obj->property("success").toBool());
delete obj;
@@ -7451,7 +7451,7 @@ void tst_qqmlecmascript::signalEmitted()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("signalEmitted.4.qml"));
QObject *obj = c.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
gc(engine); // should collect c1.
QMetaObject::invokeMethod(obj, "destroyC2");
QTRY_VERIFY(obj->property("success").toBool()); // handles events (incl. delete later).
@@ -7484,12 +7484,12 @@ void tst_qqmlecmascript::qqmldataDestroyed()
{
QQmlComponent c(&engine, testFileUrl("qqmldataDestroyed.qml"));
QObject *object = c.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// now gc causing the collection of the dynamically constructed object.
engine.collectGarbage();
engine.collectGarbage();
// now process events to allow deletion (calling qqmldata::destroyed())
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
// shouldn't crash.
delete object;
@@ -7500,7 +7500,7 @@ void tst_qqmlecmascript::qqmldataDestroyed()
{
QQmlComponent c(&engine, testFileUrl("qqmldataDestroyed.2.qml"));
QObject *object = c.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("testConditionsMet").toBool());
// the gc() within the handler will have triggered the weak
// qobject reference callback. If that incorrectly disposes
@@ -7515,7 +7515,7 @@ void tst_qqmlecmascript::secondAlias()
{
QQmlComponent c(&engine, testFileUrl("secondAlias.qml"));
QObject *object = c.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toInt(), 200);
delete object;
}
@@ -7525,7 +7525,7 @@ void tst_qqmlecmascript::varAlias()
{
QQmlComponent c(&engine, testFileUrl("varAlias.qml"));
QObject *object = c.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toInt(), 192);
delete object;
}
@@ -7535,7 +7535,7 @@ void tst_qqmlecmascript::overrideDataAssert()
{
QQmlComponent c(&engine, testFileUrl("overrideDataAssert.qml"));
QObject *object = c.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
object->metaObject();
delete object;
}
@@ -7560,7 +7560,7 @@ void tst_qqmlecmascript::fallbackBindings()
QQmlComponent component(&engine, testFileUrl(source));
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("success").toBool(), true);
}
@@ -7569,7 +7569,7 @@ void tst_qqmlecmascript::propertyOverride()
{
QQmlComponent component(&engine, testFileUrl("propertyOverride.qml"));
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("success").toBool(), true);
}
@@ -7605,9 +7605,9 @@ void tst_qqmlecmascript::sequenceSort()
QQmlComponent component(&engine, testFileUrl("sequenceSort.qml"));
QObject *object = component.create();
- if (object == 0)
+ if (object == nullptr)
qDebug() << component.errorString();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVariant q;
QMetaObject::invokeMethod(object, function.toLatin1().constData(), Q_RETURN_ARG(QVariant, q), Q_ARG(QVariant, useComparer));
@@ -7621,9 +7621,9 @@ void tst_qqmlecmascript::dateParse()
QQmlComponent component(&engine, testFileUrl("date.qml"));
QObject *object = component.create();
- if (object == 0)
+ if (object == nullptr)
qDebug() << component.errorString();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVariant q;
QMetaObject::invokeMethod(object, "test_is_invalid_jsDateTime", Q_RETURN_ARG(QVariant, q));
@@ -7641,9 +7641,9 @@ void tst_qqmlecmascript::utcDate()
QQmlComponent component(&engine, testFileUrl("utcdate.qml"));
QObject *object = component.create();
- if (object == 0)
+ if (object == nullptr)
qDebug() << component.errorString();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVariant q;
QVariant val = QString::fromLatin1("2014-07-16T23:30:31");
@@ -7656,9 +7656,9 @@ void tst_qqmlecmascript::negativeYear()
QQmlComponent component(&engine, testFileUrl("negativeyear.qml"));
QObject *object = component.create();
- if (object == 0)
+ if (object == nullptr)
qDebug() << component.errorString();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVariant q;
QMetaObject::invokeMethod(object, "check_negative_tostring", Q_RETURN_ARG(QVariant, q));
@@ -7721,7 +7721,7 @@ void tst_qqmlecmascript::updateCall()
QString file("updateCall.qml");
QQmlComponent component(&engine, testFileUrl(file));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
void tst_qqmlecmascript::numberParsing()
@@ -7731,7 +7731,7 @@ void tst_qqmlecmascript::numberParsing()
file = file.arg(i);
QQmlComponent component(&engine, testFileUrl(file));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
for (int i = 1; i < 3; ++i) {
QString file("numberParsing_error.%1.qml");
@@ -7769,7 +7769,7 @@ void tst_qqmlecmascript::qtbug_32801()
QQmlComponent component(&engine, testFileUrl("qtbug_32801.qml"));
QScopedPointer<QObject> obj(component.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
// do not crash when a QML signal is connected to a non-void slot
connect(obj.data(), SIGNAL(testSignal(QString)), obj.data(), SLOT(slotWithReturnValue(QString)));
@@ -7790,7 +7790,7 @@ void tst_qqmlecmascript::qtbug_33754()
QQmlComponent component(&engine, testFileUrl("qtbug_33754.qml"));
QScopedPointer<QObject> obj(component.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
}
void tst_qqmlecmascript::qtbug_34493()
@@ -7801,7 +7801,7 @@ void tst_qqmlecmascript::qtbug_34493()
if (component.errors().size())
qDebug() << component.errors();
QVERIFY(component.errors().isEmpty());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QVERIFY(QMetaObject::invokeMethod(obj.data(), "doIt"));
QTRY_VERIFY(obj->property("prop").toString() == QLatin1String("Hello World!"));
}
@@ -7815,7 +7815,7 @@ void tst_qqmlecmascript::singletonFromQMLToCpp()
if (component.errors().size())
qDebug() << component.errors();
QVERIFY(component.errors().isEmpty());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QCOMPARE(obj->property("qobjectTest"), QVariant(true));
QCOMPARE(obj->property("myQmlObjectTest"), QVariant(true));
@@ -7832,7 +7832,7 @@ void tst_qqmlecmascript::singletonFromQMLAndBackAndCompare()
if (component.errors().size())
qDebug() << component.errors();
QVERIFY(component.errors().isEmpty());
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("myInheritedQmlObjectTest1"), QVariant(true));
QCOMPARE(o->property("myInheritedQmlObjectTest2"), QVariant(true));
@@ -7875,9 +7875,9 @@ void tst_qqmlecmascript::miscTypeTest()
QQmlComponent component(&engine, testFileUrl("misctypetest.qml"));
QObject *object = component.create();
- if (object == 0)
+ if (object == nullptr)
qDebug() << component.errorString();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVariant q;
QMetaObject::invokeMethod(object, "test_invalid_url_equal", Q_RETURN_ARG(QVariant, q));
@@ -7913,9 +7913,9 @@ void tst_qqmlecmascript::qtbug_34792()
QQmlComponent component(&engine, testFileUrl("qtbug34792.qml"));
QObject *object = component.create();
- if (object == 0)
+ if (object == nullptr)
qDebug() << component.errorString();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -8069,7 +8069,7 @@ class ObjectContainer : public QObject
Q_PROPERTY(ContainedObject1 *object1 READ object1 WRITE setObject1)
Q_PROPERTY(ContainedObject2 *object2 READ object2 WRITE setObject2)
public:
- explicit ObjectContainer(QObject *parent = 0) :
+ explicit ObjectContainer(QObject *parent = nullptr) :
QObject(parent),
mGetterCalled(false),
mSetterCalled(false)
@@ -8079,7 +8079,7 @@ public:
ContainedObject1 *object1()
{
mGetterCalled = true;
- return 0;
+ return nullptr;
}
void setObject1(ContainedObject1 *)
@@ -8090,7 +8090,7 @@ public:
ContainedObject2 *object2()
{
mGetterCalled = true;
- return 0;
+ return nullptr;
}
void setObject2(ContainedObject2 *)
@@ -8155,7 +8155,7 @@ void tst_qqmlecmascript::qtbug_46022()
QQmlComponent component(&engine, testFileUrl("qtbug_46022.qml"));
QScopedPointer<QObject> obj(component.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QCOMPARE(obj->property("test1").toBool(), true);
QCOMPARE(obj->property("test2").toBool(), true);
}
@@ -8176,7 +8176,7 @@ void tst_qqmlecmascript::qtbug_54589()
QQmlComponent component(&engine, testFileUrl("qtbug_54589.qml"));
QScopedPointer<QObject> obj(component.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QCOMPARE(obj->property("result").toBool(), true);
}
@@ -8192,7 +8192,7 @@ void tst_qqmlecmascript::stringify_qtbug_50592()
QQmlComponent component(&engine, testFileUrl("stringify_qtbug_50592.qml"));
QScopedPointer<QObject> obj(component.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QCOMPARE(obj->property("source").toString(), QString::fromLatin1("http://example.org/some_nonexistant_image.png"));
}
@@ -8379,7 +8379,7 @@ void tst_qqmlecmascript::singleBlockLoops()
QQmlComponent component(&engine, testFileUrl("qtbug_59012.qml"));
QScopedPointer<QObject> obj(component.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QVERIFY(!component.isError());
}
diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
index d6d7506c48..bf964a5744 100644
--- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
+++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
@@ -107,7 +107,7 @@ void tst_qqmlengine::rootContext()
class NetworkAccessManagerFactory : public QQmlNetworkAccessManagerFactory
{
public:
- NetworkAccessManagerFactory() : manager(0) {}
+ NetworkAccessManagerFactory() : manager(nullptr) {}
QNetworkAccessManager *create(QObject *parent) {
manager = new QNetworkAccessManager(parent);
@@ -123,7 +123,7 @@ void tst_qqmlengine::networkAccessManager()
// Test QQmlEngine created manager
QPointer<QNetworkAccessManager> manager = engine->networkAccessManager();
- QVERIFY(manager != 0);
+ QVERIFY(manager != nullptr);
delete engine;
// Test factory created manager
@@ -155,10 +155,10 @@ class ImmediateManager : public QNetworkAccessManager {
Q_OBJECT
public:
- ImmediateManager(QObject *parent = 0) : QNetworkAccessManager(parent) {
+ ImmediateManager(QObject *parent = nullptr) : QNetworkAccessManager(parent) {
}
- QNetworkReply *createRequest(Operation, const QNetworkRequest & , QIODevice * outgoingData = 0) {
+ QNetworkReply *createRequest(Operation, const QNetworkRequest & , QIODevice * outgoingData = nullptr) {
Q_UNUSED(outgoingData);
return new ImmediateReply;
}
@@ -212,17 +212,17 @@ void tst_qqmlengine::contextForObject()
QQmlEngine *engine = new QQmlEngine;
// Test null-object
- QVERIFY(!QQmlEngine::contextForObject(0));
+ QVERIFY(!QQmlEngine::contextForObject(nullptr));
// Test an object with no context
QObject object;
QVERIFY(!QQmlEngine::contextForObject(&object));
// Test setting null-object
- QQmlEngine::setContextForObject(0, engine->rootContext());
+ QQmlEngine::setContextForObject(nullptr, engine->rootContext());
// Test setting null-context
- QQmlEngine::setContextForObject(&object, 0);
+ QQmlEngine::setContextForObject(&object, nullptr);
// Test setting context
QQmlEngine::setContextForObject(&object, engine->rootContext());
@@ -236,7 +236,7 @@ void tst_qqmlengine::contextForObject()
QCOMPARE(QQmlEngine::contextForObject(&object), engine->rootContext());
// Delete context
- delete engine; engine = 0;
+ delete engine; engine = nullptr;
QVERIFY(!QQmlEngine::contextForObject(&object));
}
@@ -313,7 +313,7 @@ void tst_qqmlengine::clearComponentCache()
{
QQmlComponent component(&engine, fileUrl);
QObject *obj = component.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QCOMPARE(obj->property("test").toInt(), 10);
delete obj;
}
@@ -336,7 +336,7 @@ void tst_qqmlengine::clearComponentCache()
{
QQmlComponent component(&engine, fileUrl);
QObject *obj = component.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QCOMPARE(obj->property("test").toInt(), 10);
delete obj;
}
@@ -348,7 +348,7 @@ void tst_qqmlengine::clearComponentCache()
{
QQmlComponent component(&engine, fileUrl);
QObject *obj = component.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QCOMPARE(obj->property("test").toInt(), 11);
delete obj;
}
@@ -371,7 +371,7 @@ public:
Q_INVOKABLE void trim()
{
// Wait for any pending deletions to occur
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
// There might be JS function objects around that hold a last ref to the compilation unit that's
@@ -423,7 +423,7 @@ void tst_qqmlengine::trimComponentCache()
QQmlComponent component(&engine, testFileUrl(file));
QVERIFY(component.isReady());
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("success").toBool(), true);
}
@@ -492,7 +492,7 @@ void tst_qqmlengine::repeatedCompilation()
QQmlComponent component(&engine, testFileUrl("repeatedCompilation.qml"));
QVERIFY(component.isReady());
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("success").toBool(), true);
}
}
@@ -536,7 +536,7 @@ void tst_qqmlengine::outputWarningsToStandardError()
QObject *o = c.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
delete o;
QCOMPARE(messageHandler.messages().count(), 1);
@@ -548,7 +548,7 @@ void tst_qqmlengine::outputWarningsToStandardError()
o = c.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
delete o;
QVERIFY2(messageHandler.messages().isEmpty(), qPrintable(messageHandler.messageString()));
@@ -557,9 +557,9 @@ void tst_qqmlengine::outputWarningsToStandardError()
void tst_qqmlengine::objectOwnership()
{
{
- QCOMPARE(QQmlEngine::objectOwnership(0), QQmlEngine::CppOwnership);
- QQmlEngine::setObjectOwnership(0, QQmlEngine::JavaScriptOwnership);
- QCOMPARE(QQmlEngine::objectOwnership(0), QQmlEngine::CppOwnership);
+ QCOMPARE(QQmlEngine::objectOwnership(nullptr), QQmlEngine::CppOwnership);
+ QQmlEngine::setObjectOwnership(nullptr, QQmlEngine::JavaScriptOwnership);
+ QCOMPARE(QQmlEngine::objectOwnership(nullptr), QQmlEngine::CppOwnership);
}
{
@@ -579,7 +579,7 @@ void tst_qqmlengine::objectOwnership()
c.setData("import QtQuick 2.0; QtObject { property QtObject object: QtObject {} }", QUrl());
QObject *o = c.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(QQmlEngine::objectOwnership(o), QQmlEngine::CppOwnership);
@@ -599,7 +599,7 @@ void tst_qqmlengine::objectOwnership()
c.setData("import QtQuick 2.0; Item { property int data: test.createAQObjectForOwnershipTest() ? 0 : 1 }", QUrl());
QVERIFY(c.isReady());
QObject *o = c.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
}
QTRY_VERIFY(spy.count());
}
@@ -614,8 +614,8 @@ void tst_qqmlengine::objectOwnership()
c.setData("import QtQuick 2.0; QtObject { property var object: { var i = test; test ? 0 : 1 } }", QUrl());
QVERIFY(c.isReady());
QObject *o = c.create();
- QVERIFY(o != 0);
- engine.rootContext()->setContextProperty("test", 0);
+ QVERIFY(o != nullptr);
+ engine.rootContext()->setContextProperty("test", nullptr);
}
QTRY_VERIFY(spy.count());
}
@@ -634,8 +634,8 @@ void tst_qqmlengine::multipleEngines()
engine1.rootContext()->setContextProperty("object", &o);
engine2.rootContext()->setContextProperty("object", &o);
- QQmlExpression expr1(engine1.rootContext(), 0, QString("object.objectName"));
- QQmlExpression expr2(engine2.rootContext(), 0, QString("object.objectName"));
+ QQmlExpression expr1(engine1.rootContext(), nullptr, QString("object.objectName"));
+ QQmlExpression expr2(engine2.rootContext(), nullptr, QString("object.objectName"));
QCOMPARE(expr1.evaluate().toString(), QString("TestName"));
QCOMPARE(expr2.evaluate().toString(), QString("TestName"));
@@ -645,13 +645,13 @@ void tst_qqmlengine::multipleEngines()
{
QQmlEngine engine1;
engine1.rootContext()->setContextProperty("object", &o);
- QQmlExpression expr1(engine1.rootContext(), 0, QString("object.objectName"));
+ QQmlExpression expr1(engine1.rootContext(), nullptr, QString("object.objectName"));
QCOMPARE(expr1.evaluate().toString(), QString("TestName"));
}
{
QQmlEngine engine1;
engine1.rootContext()->setContextProperty("object", &o);
- QQmlExpression expr1(engine1.rootContext(), 0, QString("object.objectName"));
+ QQmlExpression expr1(engine1.rootContext(), nullptr, QString("object.objectName"));
QCOMPARE(expr1.evaluate().toString(), QString("TestName"));
}
}
diff --git a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
index 7e9a1524b0..b9cede6d13 100644
--- a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
+++ b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
@@ -129,7 +129,7 @@ static void cleanState(QQmlEngine **e)
delete *e;
qmlClearTypeRegistrations();
*e = new QQmlEngine;
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
}
@@ -139,7 +139,7 @@ void tst_qqmlenginecleanup::test_valueTypeProviderModule()
// provider can be reinitialized after multiple calls to
// qmlClearTypeRegistrations() without causing cycles in the
// value type provider list.
- QQmlEngine *e = 0;
+ QQmlEngine *e = nullptr;
QUrl testFile1 = testFileUrl("testFile1.qml");
QUrl testFile2 = testFileUrl("testFile2.qml");
bool noCycles = false;
@@ -149,7 +149,7 @@ void tst_qqmlenginecleanup::test_valueTypeProviderModule()
c.loadUrl(i % 2 == 0 ? testFile1 : testFile2); // this will hang if cycles exist.
}
delete e;
- e = 0;
+ e = nullptr;
noCycles = true;
QVERIFY(noCycles);
diff --git a/tests/auto/qml/qqmlexpression/tst_qqmlexpression.cpp b/tests/auto/qml/qqmlexpression/tst_qqmlexpression.cpp
index aa201f2644..e1ad1e8c5f 100644
--- a/tests/auto/qml/qqmlexpression/tst_qqmlexpression.cpp
+++ b/tests/auto/qml/qqmlexpression/tst_qqmlexpression.cpp
@@ -52,7 +52,7 @@ class TestObject : public QObject
Q_PROPERTY(QQmlScriptString scriptString READ scriptString WRITE setScriptString)
Q_PROPERTY(QQmlScriptString scriptStringError READ scriptStringError WRITE setScriptStringError)
public:
- TestObject(QObject *parent = 0) : QObject(parent) {}
+ TestObject(QObject *parent = nullptr) : QObject(parent) {}
QQmlScriptString scriptString() const { return m_scriptString; }
void setScriptString(QQmlScriptString scriptString) { m_scriptString = scriptString; }
@@ -74,7 +74,7 @@ void tst_qqmlexpression::scriptString()
QQmlEngine engine;
QQmlComponent c(&engine, testFileUrl("scriptString.qml"));
TestObject *testObj = qobject_cast<TestObject*>(c.create());
- QVERIFY(testObj != 0);
+ QVERIFY(testObj != nullptr);
QQmlScriptString script = testObj->scriptString();
QVERIFY(!script.isEmpty());
@@ -100,7 +100,7 @@ void tst_qqmlexpression::scriptString()
void tst_qqmlexpression::syntaxError()
{
QQmlEngine engine;
- QQmlExpression expression(engine.rootContext(), 0, "asd asd");
+ QQmlExpression expression(engine.rootContext(), nullptr, "asd asd");
QVariant v = expression.evaluate();
QCOMPARE(v, QVariant());
}
@@ -108,7 +108,7 @@ void tst_qqmlexpression::syntaxError()
void tst_qqmlexpression::exception()
{
QQmlEngine engine;
- QQmlExpression expression(engine.rootContext(), 0, "abc=123");
+ QQmlExpression expression(engine.rootContext(), nullptr, "abc=123");
QVariant v = expression.evaluate();
QCOMPARE(v, QVariant());
QVERIFY(expression.hasError());
diff --git a/tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp b/tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp
index 2c62353630..2d618170d4 100644
--- a/tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp
+++ b/tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp
@@ -58,7 +58,7 @@ void tst_qqmlfileselector::basicTest()
QQmlComponent component(&engine, testFileUrl("basicTest.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("value").toString(), QString("selected"));
delete object;
@@ -87,12 +87,12 @@ void tst_qqmlfileselector::applicationEngineTest()
{
QQmlApplicationEngine engine;
QQmlFileSelector* selector = QQmlFileSelector::get(&engine);
- QVERIFY(selector != 0);
+ QVERIFY(selector != nullptr);
selector->setExtraSelectors(QStringList() << "basic");
QQmlComponent component(&engine, testFileUrl("basicTest.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("value").toString(), QString("selected"));
delete object;
diff --git a/tests/auto/qml/qqmlincubator/testtypes.cpp b/tests/auto/qml/qqmlincubator/testtypes.cpp
index 3fcd3ba299..06d5904bbd 100644
--- a/tests/auto/qml/qqmlincubator/testtypes.cpp
+++ b/tests/auto/qml/qqmlincubator/testtypes.cpp
@@ -28,7 +28,7 @@
#include "testtypes.h"
#include <QtQml/qqml.h>
-SelfRegisteringType *SelfRegisteringType::m_me = 0;
+SelfRegisteringType *SelfRegisteringType::m_me = nullptr;
SelfRegisteringType::SelfRegisteringType()
: m_v(0)
{
@@ -42,13 +42,13 @@ SelfRegisteringType *SelfRegisteringType::me()
void SelfRegisteringType::clearMe()
{
- m_me = 0;
+ m_me = nullptr;
}
-SelfRegisteringOuterType *SelfRegisteringOuterType::m_me = 0;
+SelfRegisteringOuterType *SelfRegisteringOuterType::m_me = nullptr;
bool SelfRegisteringOuterType::beenDeleted = false;
SelfRegisteringOuterType::SelfRegisteringOuterType()
-: m_v(0)
+: m_v(nullptr)
{
m_me = this;
beenDeleted = false;
@@ -64,7 +64,7 @@ SelfRegisteringOuterType *SelfRegisteringOuterType::me()
return m_me;
}
-CompletionRegisteringType *CompletionRegisteringType::m_me = 0;
+CompletionRegisteringType *CompletionRegisteringType::m_me = nullptr;
CompletionRegisteringType::CompletionRegisteringType()
{
}
@@ -85,11 +85,11 @@ CompletionRegisteringType *CompletionRegisteringType::me()
void CompletionRegisteringType::clearMe()
{
- m_me = 0;
+ m_me = nullptr;
}
-CallbackRegisteringType::callback CallbackRegisteringType::m_callback = 0;
-void *CallbackRegisteringType::m_data = 0;
+CallbackRegisteringType::callback CallbackRegisteringType::m_callback = nullptr;
+void *CallbackRegisteringType::m_data = nullptr;
CallbackRegisteringType::CallbackRegisteringType()
: m_v(0)
{
@@ -97,8 +97,8 @@ CallbackRegisteringType::CallbackRegisteringType()
void CallbackRegisteringType::clearCallback()
{
- m_callback = 0;
- m_data = 0;
+ m_callback = nullptr;
+ m_data = nullptr;
}
void CallbackRegisteringType::registerCallback(callback c, void *d)
@@ -107,8 +107,8 @@ void CallbackRegisteringType::registerCallback(callback c, void *d)
m_data = d;
}
-CompletionCallbackType::callback CompletionCallbackType::m_callback = 0;
-void *CompletionCallbackType::m_data = 0;
+CompletionCallbackType::callback CompletionCallbackType::m_callback = nullptr;
+void *CompletionCallbackType::m_data = nullptr;
CompletionCallbackType::CompletionCallbackType()
{
}
@@ -124,8 +124,8 @@ void CompletionCallbackType::componentComplete()
void CompletionCallbackType::clearCallback()
{
- m_callback = 0;
- m_data = 0;
+ m_callback = nullptr;
+ m_data = nullptr;
}
void CompletionCallbackType::registerCallback(callback c, void *d)
diff --git a/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp b/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp
index 863b6aaa29..8f0e04e12e 100644
--- a/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp
+++ b/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp
@@ -145,15 +145,15 @@ void tst_qqmlincubator::objectDeleted()
QCOMPARE(incubator.status(), QQmlIncubator::Loading);
QVERIFY(!SelfRegisteringType::me());
- while (SelfRegisteringOuterType::me() == 0 && incubator.isLoading()) {
+ while (SelfRegisteringOuterType::me() == nullptr && incubator.isLoading()) {
bool b = false;
controller.incubateWhile(&b);
}
- QVERIFY(SelfRegisteringOuterType::me() != 0);
+ QVERIFY(SelfRegisteringOuterType::me() != nullptr);
QVERIFY(incubator.isLoading());
- while (SelfRegisteringType::me() == 0 && incubator.isLoading()) {
+ while (SelfRegisteringType::me() == nullptr && incubator.isLoading()) {
bool b = false;
controller.incubateWhile(&b);
}
@@ -201,13 +201,13 @@ void tst_qqmlincubator::clear()
QQmlIncubator incubator;
component.create(incubator);
- while (SelfRegisteringType::me() == 0 && incubator.isLoading()) {
+ while (SelfRegisteringType::me() == nullptr && incubator.isLoading()) {
bool b = false;
controller.incubateWhile(&b);
}
QVERIFY(incubator.isLoading());
- QVERIFY(SelfRegisteringType::me() != 0);
+ QVERIFY(SelfRegisteringType::me() != nullptr);
QPointer<SelfRegisteringType> srt = SelfRegisteringType::me();
incubator.clear();
@@ -226,7 +226,7 @@ void tst_qqmlincubator::clear()
}
QVERIFY(incubator.isReady());
- QVERIFY(incubator.object() != 0);
+ QVERIFY(incubator.object() != nullptr);
QPointer<QObject> obj = incubator.object();
incubator.clear();
@@ -299,7 +299,7 @@ void tst_qqmlincubator::forceCompletion()
incubator.forceCompletion();
QVERIFY(incubator.isReady());
- QVERIFY(incubator.object() != 0);
+ QVERIFY(incubator.object() != nullptr);
QCOMPARE(incubator.object()->property("testValue").toInt(), 3499);
delete incubator.object();
@@ -314,18 +314,18 @@ void tst_qqmlincubator::forceCompletion()
component.create(incubator);
QVERIFY(incubator.isLoading());
- while (SelfRegisteringType::me() == 0 && incubator.isLoading()) {
+ while (SelfRegisteringType::me() == nullptr && incubator.isLoading()) {
bool b = false;
controller.incubateWhile(&b);
}
- QVERIFY(SelfRegisteringType::me() != 0);
+ QVERIFY(SelfRegisteringType::me() != nullptr);
QVERIFY(incubator.isLoading());
incubator.forceCompletion();
QVERIFY(incubator.isReady());
- QVERIFY(incubator.object() != 0);
+ QVERIFY(incubator.object() != nullptr);
QCOMPARE(incubator.object()->property("testValue").toInt(), 3499);
delete incubator.object();
@@ -341,13 +341,13 @@ void tst_qqmlincubator::forceCompletion()
incubator.forceCompletion();
QVERIFY(incubator.isReady());
- QVERIFY(incubator.object() != 0);
+ QVERIFY(incubator.object() != nullptr);
QCOMPARE(incubator.object()->property("testValue").toInt(), 3499);
incubator.forceCompletion();
QVERIFY(incubator.isReady());
- QVERIFY(incubator.object() != 0);
+ QVERIFY(incubator.object() != nullptr);
QCOMPARE(incubator.object()->property("testValue").toInt(), 3499);
delete incubator.object();
@@ -410,19 +410,19 @@ void tst_qqmlincubator::clearDuringCompletion()
QCOMPARE(incubator.status(), QQmlIncubator::Loading);
QVERIFY(!CompletionRegisteringType::me());
- while (CompletionRegisteringType::me() == 0 && incubator.isLoading()) {
+ while (CompletionRegisteringType::me() == nullptr && incubator.isLoading()) {
bool b = false;
controller.incubateWhile(&b);
}
- QVERIFY(CompletionRegisteringType::me() != 0);
- QVERIFY(SelfRegisteringType::me() != 0);
+ QVERIFY(CompletionRegisteringType::me() != nullptr);
+ QVERIFY(SelfRegisteringType::me() != nullptr);
QVERIFY(incubator.isLoading());
QPointer<QObject> srt = SelfRegisteringType::me();
incubator.clear();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
QVERIFY(incubator.isNull());
QVERIFY(srt.isNull());
@@ -436,7 +436,7 @@ void tst_qqmlincubator::objectDeletionAfterInit()
struct MyIncubator : public QQmlIncubator
{
MyIncubator(QQmlIncubator::IncubationMode mode)
- : QQmlIncubator(mode), obj(0) {}
+ : QQmlIncubator(mode), obj(nullptr) {}
virtual void setInitialState(QObject *o) {
obj = o;
@@ -455,12 +455,12 @@ void tst_qqmlincubator::objectDeletionAfterInit()
}
QVERIFY(incubator.isLoading());
- QVERIFY(SelfRegisteringType::me() != 0);
+ QVERIFY(SelfRegisteringType::me() != nullptr);
delete incubator.obj;
incubator.clear();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
QVERIFY(incubator.isNull());
}
@@ -592,11 +592,11 @@ void tst_qqmlincubator::asynchronousIfNested()
QVERIFY(component.isReady());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("a").toInt(), 10);
QQmlIncubator incubator(QQmlIncubator::AsynchronousIfNested);
- component.create(incubator, 0, qmlContext(object));
+ component.create(incubator, nullptr, qmlContext(object));
QVERIFY(incubator.isReady());
QVERIFY(incubator.object());
@@ -618,16 +618,16 @@ void tst_qqmlincubator::asynchronousIfNested()
QVERIFY(incubator.isLoading());
QVERIFY(!SelfRegisteringType::me());
- while (SelfRegisteringType::me() == 0 && incubator.isLoading()) {
+ while (SelfRegisteringType::me() == nullptr && incubator.isLoading()) {
bool b = false;
controller.incubateWhile(&b);
}
- QVERIFY(SelfRegisteringType::me() != 0);
+ QVERIFY(SelfRegisteringType::me() != nullptr);
QVERIFY(incubator.isLoading());
QQmlIncubator nested(QQmlIncubator::AsynchronousIfNested);
- component.create(nested, 0, qmlContext(SelfRegisteringType::me()));
+ component.create(nested, nullptr, qmlContext(SelfRegisteringType::me()));
QVERIFY(nested.isLoading());
while (nested.isLoading()) {
@@ -669,7 +669,7 @@ void tst_qqmlincubator::asynchronousIfNested()
if (!c.isReady()) return;
QQmlIncubator incubator(QQmlIncubator::AsynchronousIfNested);
- c.create(incubator, 0, qmlContext(o));
+ c.create(incubator, nullptr, qmlContext(o));
if (!incubator.isReady()) return;
@@ -738,12 +738,12 @@ void tst_qqmlincubator::chainedAsynchronousIfNested()
QVERIFY(incubator.isLoading());
QVERIFY(!SelfRegisteringType::me());
- while (SelfRegisteringType::me() == 0 && incubator.isLoading()) {
+ while (SelfRegisteringType::me() == nullptr && incubator.isLoading()) {
bool b = false;
controller.incubateWhile(&b);
}
- QVERIFY(SelfRegisteringType::me() != 0);
+ QVERIFY(SelfRegisteringType::me() != nullptr);
QVERIFY(incubator.isLoading());
struct MyIncubator : public QQmlIncubator {
@@ -753,7 +753,7 @@ void tst_qqmlincubator::chainedAsynchronousIfNested()
protected:
virtual void statusChanged(Status s) {
if (s == Ready && next)
- component->create(*next, 0, ctxt);
+ component->create(*next, nullptr, ctxt);
}
private:
@@ -762,10 +762,10 @@ void tst_qqmlincubator::chainedAsynchronousIfNested()
QQmlContext *ctxt;
};
- MyIncubator incubator2(0, &component, 0);
+ MyIncubator incubator2(nullptr, &component, nullptr);
MyIncubator incubator1(&incubator2, &component, qmlContext(SelfRegisteringType::me()));
- component.create(incubator1, 0, qmlContext(SelfRegisteringType::me()));
+ component.create(incubator1, nullptr, qmlContext(SelfRegisteringType::me()));
QVERIFY(incubator.isLoading());
QVERIFY(incubator1.isLoading());
@@ -824,7 +824,7 @@ void tst_qqmlincubator::chainedAsynchronousIfNestedOnCompleted()
protected:
virtual void statusChanged(Status s) {
if (s == Ready && next) {
- component->create(*next, 0, ctxt);
+ component->create(*next, nullptr, ctxt);
}
}
@@ -842,7 +842,7 @@ void tst_qqmlincubator::chainedAsynchronousIfNestedOnCompleted()
QQmlContext *ctxt;
static void callback(CompletionCallbackType *, void *data) {
CallbackData *d = (CallbackData *)data;
- d->component->create(*d->incubator, 0, d->ctxt);
+ d->component->create(*d->incubator, nullptr, d->ctxt);
}
};
@@ -852,15 +852,15 @@ void tst_qqmlincubator::chainedAsynchronousIfNestedOnCompleted()
QVERIFY(incubator.isLoading());
QVERIFY(!SelfRegisteringType::me());
- while (SelfRegisteringType::me() == 0 && incubator.isLoading()) {
+ while (SelfRegisteringType::me() == nullptr && incubator.isLoading()) {
bool b = false;
controller.incubateWhile(&b);
}
- QVERIFY(SelfRegisteringType::me() != 0);
+ QVERIFY(SelfRegisteringType::me() != nullptr);
QVERIFY(incubator.isLoading());
- MyIncubator incubator3(0, &c1, qmlContext(SelfRegisteringType::me()));
+ MyIncubator incubator3(nullptr, &c1, qmlContext(SelfRegisteringType::me()));
MyIncubator incubator2(&incubator3, &c1, qmlContext(SelfRegisteringType::me()));
MyIncubator incubator1(&incubator2, &c1, qmlContext(SelfRegisteringType::me()));
@@ -952,7 +952,7 @@ void tst_qqmlincubator::chainedAsynchronousClear()
protected:
virtual void statusChanged(Status s) {
if (s == Ready && next) {
- component->create(*next, 0, ctxt);
+ component->create(*next, nullptr, ctxt);
}
}
@@ -970,7 +970,7 @@ void tst_qqmlincubator::chainedAsynchronousClear()
QQmlContext *ctxt;
static void callback(CompletionCallbackType *, void *data) {
CallbackData *d = (CallbackData *)data;
- d->component->create(*d->incubator, 0, d->ctxt);
+ d->component->create(*d->incubator, nullptr, d->ctxt);
}
};
@@ -980,15 +980,15 @@ void tst_qqmlincubator::chainedAsynchronousClear()
QVERIFY(incubator.isLoading());
QVERIFY(!SelfRegisteringType::me());
- while (SelfRegisteringType::me() == 0 && incubator.isLoading()) {
+ while (SelfRegisteringType::me() == nullptr && incubator.isLoading()) {
bool b = false;
controller.incubateWhile(&b);
}
- QVERIFY(SelfRegisteringType::me() != 0);
+ QVERIFY(SelfRegisteringType::me() != nullptr);
QVERIFY(incubator.isLoading());
- MyIncubator incubator3(0, &c1, qmlContext(SelfRegisteringType::me()));
+ MyIncubator incubator3(nullptr, &c1, qmlContext(SelfRegisteringType::me()));
MyIncubator incubator2(&incubator3, &c1, qmlContext(SelfRegisteringType::me()));
MyIncubator incubator1(&incubator2, &c1, qmlContext(SelfRegisteringType::me()));
@@ -1103,12 +1103,12 @@ void tst_qqmlincubator::selfDelete()
QCOMPARE(incubator->QQmlIncubator::status(), QQmlIncubator::Loading);
QVERIFY(!SelfRegisteringType::me());
- while (SelfRegisteringType::me() == 0 && incubator->isLoading()) {
+ while (SelfRegisteringType::me() == nullptr && incubator->isLoading()) {
bool b = false;
controller.incubateWhile(&b);
}
- QVERIFY(SelfRegisteringType::me() != 0);
+ QVERIFY(SelfRegisteringType::me() != nullptr);
QVERIFY(incubator->isLoading());
// We have to cheat and manually remove it from the creator->allCreatedObjects
diff --git a/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp b/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp
index 3f6c200027..ada3f9e37b 100644
--- a/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp
+++ b/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp
@@ -60,14 +60,14 @@ void tst_qqmlinfo::qmlObject()
QQmlComponent component(&engine, testFileUrl("qmlObject.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QString message = component.url().toString() + ":3:1: QML QtObject: Test Message";
QTest::ignoreMessage(QtInfoMsg, qPrintable(message));
qmlInfo(object) << "Test Message";
QObject *nested = qvariant_cast<QObject *>(object->property("nested"));
- QVERIFY(nested != 0);
+ QVERIFY(nested != nullptr);
message = component.url().toString() + ":6:13: QML QtObject: Second Test Message";
QTest::ignoreMessage(QtInfoMsg, qPrintable(message));
@@ -79,12 +79,12 @@ void tst_qqmlinfo::nestedQmlObject()
QQmlComponent component(&engine, testFileUrl("nestedQmlObject.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QObject *nested = qvariant_cast<QObject *>(object->property("nested"));
- QVERIFY(nested != 0);
+ QVERIFY(nested != nullptr);
QObject *nested2 = qvariant_cast<QObject *>(object->property("nested2"));
- QVERIFY(nested2 != 0);
+ QVERIFY(nested2 != nullptr);
QString message = component.url().toString() + ":5:13: QML NestedObject: Outer Object";
QTest::ignoreMessage(QtInfoMsg, qPrintable(message));
@@ -100,12 +100,12 @@ void tst_qqmlinfo::nestedComponent()
QQmlComponent component(&engine, testFileUrl("NestedComponent.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QObject *nested = qvariant_cast<QObject *>(object->property("nested"));
- QVERIFY(nested != 0);
+ QVERIFY(nested != nullptr);
QObject *nested2 = qvariant_cast<QObject *>(object->property("nested2"));
- QVERIFY(nested2 != 0);
+ QVERIFY(nested2 != nullptr);
QString message = component.url().toString() + ":10:9: QML NestedObject: Complex Object";
QTest::ignoreMessage(QtInfoMsg, qPrintable(message));
@@ -130,7 +130,7 @@ void tst_qqmlinfo::nonQmlObject()
void tst_qqmlinfo::nullObject()
{
QTest::ignoreMessage(QtInfoMsg, "<Unknown File>: Null Object Test Message");
- qmlInfo(0) << "Null Object Test Message";
+ qmlInfo(nullptr) << "Null Object Test Message";
}
void tst_qqmlinfo::nonQmlContextedObject()
@@ -145,44 +145,44 @@ void tst_qqmlinfo::nonQmlContextedObject()
void tst_qqmlinfo::types()
{
QTest::ignoreMessage(QtInfoMsg, "<Unknown File>: false");
- qmlInfo(0) << false;
+ qmlInfo(nullptr) << false;
QTest::ignoreMessage(QtInfoMsg, "<Unknown File>: 1.1");
- qmlInfo(0) << 1.1;
+ qmlInfo(nullptr) << 1.1;
QTest::ignoreMessage(QtInfoMsg, "<Unknown File>: 1.2");
- qmlInfo(0) << 1.2f;
+ qmlInfo(nullptr) << 1.2f;
QTest::ignoreMessage(QtInfoMsg, "<Unknown File>: 15");
- qmlInfo(0) << 15;
+ qmlInfo(nullptr) << 15;
QTest::ignoreMessage(QtInfoMsg, "<Unknown File>: 'b'");
- qmlInfo(0) << QChar('b');
+ qmlInfo(nullptr) << QChar('b');
QTest::ignoreMessage(QtInfoMsg, "<Unknown File>: \"Qt\"");
- qmlInfo(0) << QByteArray("Qt");
+ qmlInfo(nullptr) << QByteArray("Qt");
QTest::ignoreMessage(QtInfoMsg, "<Unknown File>: true");
- qmlInfo(0) << bool(true);
+ qmlInfo(nullptr) << bool(true);
//### do we actually want QUrl to show up in the output?
//### why the extra space at the end?
QTest::ignoreMessage(QtInfoMsg, "<Unknown File>: QUrl(\"http://www.qt-project.org\") ");
- qmlInfo(0) << QUrl("http://www.qt-project.org");
+ qmlInfo(nullptr) << QUrl("http://www.qt-project.org");
//### should this be quoted?
QTest::ignoreMessage(QtInfoMsg, "<Unknown File>: hello");
- qmlInfo(0) << QLatin1String("hello");
+ qmlInfo(nullptr) << QLatin1String("hello");
//### should this be quoted?
QTest::ignoreMessage(QtInfoMsg, "<Unknown File>: World");
QString str("Hello World");
QStringRef ref(&str, 6, 5);
- qmlInfo(0) << ref;
+ qmlInfo(nullptr) << ref;
//### should this be quoted?
QTest::ignoreMessage(QtInfoMsg, "<Unknown File>: Quick");
- qmlInfo(0) << QString ("Quick");
+ qmlInfo(nullptr) << QString ("Quick");
}
void tst_qqmlinfo::chaining()
@@ -190,7 +190,7 @@ void tst_qqmlinfo::chaining()
QString str("Hello World");
QStringRef ref(&str, 6, 5);
QTest::ignoreMessage(QtInfoMsg, "<Unknown File>: false 1.1 1.2 15 hello 'b' World \"Qt\" true Quick QUrl(\"http://www.qt-project.org\") ");
- qmlInfo(0) << false << ' '
+ qmlInfo(nullptr) << false << ' '
<< 1.1 << ' '
<< 1.2f << ' '
<< 15 << ' '
@@ -207,13 +207,13 @@ void tst_qqmlinfo::chaining()
void tst_qqmlinfo::messageTypes()
{
QTest::ignoreMessage(QtDebugMsg, "<Unknown File>: debug");
- qmlDebug(0) << QLatin1String("debug");
+ qmlDebug(nullptr) << QLatin1String("debug");
QTest::ignoreMessage(QtInfoMsg, "<Unknown File>: info");
- qmlInfo(0) << QLatin1String("info");
+ qmlInfo(nullptr) << QLatin1String("info");
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: warning");
- qmlWarning(0) << QLatin1String("warning");
+ qmlWarning(nullptr) << QLatin1String("warning");
}
QTEST_MAIN(tst_qqmlinfo)
diff --git a/tests/auto/qml/qqmlinstantiator/tst_qqmlinstantiator.cpp b/tests/auto/qml/qqmlinstantiator/tst_qqmlinstantiator.cpp
index 90b719d000..a66f13e6bb 100644
--- a/tests/auto/qml/qqmlinstantiator/tst_qqmlinstantiator.cpp
+++ b/tests/auto/qml/qqmlinstantiator/tst_qqmlinstantiator.cpp
@@ -59,7 +59,7 @@ void tst_qqmlinstantiator::createNone()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("createNone.qml"));
QQmlInstantiator *instantiator = qobject_cast<QQmlInstantiator*>(component.create());
- QVERIFY(instantiator != 0);
+ QVERIFY(instantiator != nullptr);
QCOMPARE(instantiator->isActive(), true);
QCOMPARE(instantiator->count(), 0);
QCOMPARE(instantiator->property("success").toBool(), true);
@@ -71,7 +71,7 @@ void tst_qqmlinstantiator::createSingle()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("createSingle.qml"));
QQmlInstantiator *instantiator = qobject_cast<QQmlInstantiator*>(component.create());
- QVERIFY(instantiator != 0);
+ QVERIFY(instantiator != nullptr);
QCOMPARE(instantiator->isActive(), true);
QCOMPARE(instantiator->count(), 1);
QVERIFY(instantiator->delegate()->isReady());
@@ -88,7 +88,7 @@ void tst_qqmlinstantiator::createMultiple()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("createMultiple.qml"));
QQmlInstantiator *instantiator = qobject_cast<QQmlInstantiator*>(component.create());
- QVERIFY(instantiator != 0);
+ QVERIFY(instantiator != nullptr);
QCOMPARE(instantiator->isActive(), true);
QCOMPARE(instantiator->count(), 10);
@@ -106,7 +106,7 @@ void tst_qqmlinstantiator::stringModel()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("stringModel.qml"));
QQmlInstantiator *instantiator = qobject_cast<QQmlInstantiator*>(component.create());
- QVERIFY(instantiator != 0);
+ QVERIFY(instantiator != nullptr);
QCOMPARE(instantiator->isActive(), true);
QCOMPARE(instantiator->count(), 4);
@@ -123,7 +123,7 @@ void tst_qqmlinstantiator::activeProperty()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("inactive.qml"));
QQmlInstantiator *instantiator = qobject_cast<QQmlInstantiator*>(component.create());
- QVERIFY(instantiator != 0);
+ QVERIFY(instantiator != nullptr);
QSignalSpy activeSpy(instantiator, SIGNAL(activeChanged()));
QSignalSpy countSpy(instantiator, SIGNAL(countChanged()));
QSignalSpy objectSpy(instantiator, SIGNAL(objectChanged()));
@@ -158,7 +158,7 @@ void tst_qqmlinstantiator::intModelChange()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("createMultiple.qml"));
QQmlInstantiator *instantiator = qobject_cast<QQmlInstantiator*>(component.create());
- QVERIFY(instantiator != 0);
+ QVERIFY(instantiator != nullptr);
QSignalSpy activeSpy(instantiator, SIGNAL(activeChanged()));
QSignalSpy countSpy(instantiator, SIGNAL(countChanged()));
QSignalSpy objectSpy(instantiator, SIGNAL(objectChanged()));
@@ -194,11 +194,11 @@ void tst_qqmlinstantiator::createAndRemove()
StringModel *model = new StringModel("model1");
engine.rootContext()->setContextProperty("model1", model);
QObject *rootObject = component.create();
- QVERIFY(rootObject != 0);
+ QVERIFY(rootObject != nullptr);
QQmlInstantiator *instantiator =
qobject_cast<QQmlInstantiator*>(rootObject->findChild<QObject*>("instantiator1"));
- QVERIFY(instantiator != 0);
+ QVERIFY(instantiator != nullptr);
model->drop(1);
QVector<QString> names;
names << "Beta" << "Gamma" << "Delta";
@@ -234,7 +234,7 @@ void tst_qqmlinstantiator::asynchronous()
QQmlInstantiator *instantiator = qobject_cast<QQmlInstantiator *>(incubator.object());
while (incubationController.incubatingObjectCount() > 0)
incubationController.incubateFor(10);
- QVERIFY(instantiator != 0);
+ QVERIFY(instantiator != nullptr);
QCOMPARE(instantiator->isActive(), true);
QCOMPARE(instantiator->count(), 10);
diff --git a/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp b/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp
index fca72ab021..cbb7ebb0ff 100644
--- a/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp
+++ b/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp
@@ -182,7 +182,7 @@ void tst_qqmlitemmodels::itemSelection()
QCOMPARE(object->property("count").toInt(), 5);
QCOMPARE(object->property("contains").toBool(), true);
- const char *propNames[] = { "itemSelectionRead", "itemSelectionBinding", 0 };
+ const char *propNames[] = { "itemSelectionRead", "itemSelectionBinding", nullptr };
for (const char **name = propNames; *name; name++) {
QVariant isVariant = object->property(*name);
QCOMPARE(isVariant.userType(), qMetaTypeId<QItemSelection>());
@@ -217,7 +217,7 @@ void tst_qqmlitemmodels::modelIndexList()
QModelIndexList someMIL = object->someModelIndexList();
QCOMPARE(cppMILVariant.value<QModelIndexList>(), someMIL);
- const char *propNames[] = { "modelIndexListRead", "modelIndexListBinding", 0 };
+ const char *propNames[] = { "modelIndexListRead", "modelIndexListBinding", nullptr };
for (const char **name = propNames; *name; name++) {
QVariant milVariant = object->property(*name);
QCOMPARE(milVariant.userType(), qMetaTypeId<QModelIndexList>());
diff --git a/tests/auto/qml/qqmllanguage/testtypes.cpp b/tests/auto/qml/qqmllanguage/testtypes.cpp
index 1a81528bc4..0eb4f26878 100644
--- a/tests/auto/qml/qqmllanguage/testtypes.cpp
+++ b/tests/auto/qml/qqmllanguage/testtypes.cpp
@@ -185,8 +185,8 @@ void SimpleObjectCustomParser::applyBindings(QObject *object, QV4::CompiledData:
MyQmlObject::MyQmlObject()
: m_value(-1)
- , m_interface(0)
- , m_qmlobject(0)
+ , m_interface(nullptr)
+ , m_qmlobject(nullptr)
, m_childAddedEventCount(0)
{
qRegisterMetaType<MyCustomVariantType>("MyCustomVariantType");
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index d08ad47310..952e4a22a1 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -619,7 +619,7 @@ void tst_qqmllanguage::simpleObject()
QQmlComponent component(&engine, testFileUrl("simpleObject.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
void tst_qqmllanguage::simpleContainer()
@@ -627,7 +627,7 @@ void tst_qqmllanguage::simpleContainer()
QQmlComponent component(&engine, testFileUrl("simpleContainer.qml"));
VERIFY_ERRORS(0);
MyContainer *container= qobject_cast<MyContainer*>(component.create());
- QVERIFY(container != 0);
+ QVERIFY(container != nullptr);
QCOMPARE(container->getChildren()->count(),2);
}
@@ -636,7 +636,7 @@ void tst_qqmllanguage::interfaceProperty()
QQmlComponent component(&engine, testFileUrl("interfaceProperty.qml"));
VERIFY_ERRORS(0);
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->interface());
QCOMPARE(object->interface()->id, 913);
}
@@ -646,7 +646,7 @@ void tst_qqmllanguage::interfaceQList()
QQmlComponent component(&engine, testFileUrl("interfaceQList.qml"));
VERIFY_ERRORS(0);
MyContainer *container= qobject_cast<MyContainer*>(component.create());
- QVERIFY(container != 0);
+ QVERIFY(container != nullptr);
QCOMPARE(container->getQListInterfaces()->count(), 2);
for(int ii = 0; ii < 2; ++ii)
QCOMPARE(container->getQListInterfaces()->at(ii)->id, 913);
@@ -657,7 +657,7 @@ void tst_qqmllanguage::assignObjectToSignal()
QQmlComponent component(&engine, testFileUrl("assignObjectToSignal.qml"));
VERIFY_ERRORS(0);
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlot");
emit object->basicSignal();
}
@@ -667,7 +667,7 @@ void tst_qqmllanguage::assignObjectToVariant()
QQmlComponent component(&engine, testFileUrl("assignObjectToVariant.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVariant v = object->property("a");
QVERIFY(v.userType() == qMetaTypeId<QObject *>());
}
@@ -677,7 +677,7 @@ void tst_qqmllanguage::assignLiteralSignalProperty()
QQmlComponent component(&engine, testFileUrl("assignLiteralSignalProperty.qml"));
VERIFY_ERRORS(0);
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->onLiteralSignal(), 10);
}
@@ -687,7 +687,7 @@ void tst_qqmllanguage::assignQmlComponent()
QQmlComponent component(&engine, testFileUrl("assignQmlComponent.qml"));
VERIFY_ERRORS(0);
MyContainer *object = qobject_cast<MyContainer *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->getChildren()->count(), 1);
QObject *child = object->getChildren()->at(0);
QCOMPARE(child->property("x"), QVariant(10));
@@ -700,7 +700,7 @@ void tst_qqmllanguage::assignBasicTypes()
QQmlComponent component(&engine, testFileUrl("assignBasicTypes.qml"));
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->flagProperty(), MyTypeObject::FlagVal1 | MyTypeObject::FlagVal3);
QCOMPARE(object->enumProperty(), MyTypeObject::EnumVal2);
QCOMPARE(object->qtEnumProperty(), Qt::RichText);
@@ -729,9 +729,9 @@ void tst_qqmllanguage::assignBasicTypes()
QCOMPARE(object->vector4Property(), QVector4D(10, 1, 2.2f, 2.3f));
const QUrl encoded = QUrl::fromEncoded("main.qml?with%3cencoded%3edata", QUrl::TolerantMode);
QCOMPARE(object->urlProperty(), component.url().resolved(encoded));
- QVERIFY(object->objectProperty() != 0);
+ QVERIFY(object->objectProperty() != nullptr);
MyTypeObject *child = qobject_cast<MyTypeObject *>(object->objectProperty());
- QVERIFY(child != 0);
+ QVERIFY(child != nullptr);
QCOMPARE(child->intProperty(), 8);
//these used to go via script. Ensure they no longer do
@@ -745,7 +745,7 @@ void tst_qqmllanguage::assignTypeExtremes()
QQmlComponent component(&engine, testFileUrl("assignTypeExtremes.qml"));
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->uintProperty(), 0xEE6B2800);
QCOMPARE(object->intProperty(), -0x77359400);
}
@@ -756,7 +756,7 @@ void tst_qqmllanguage::assignCompositeToType()
QQmlComponent component(&engine, testFileUrl("assignCompositeToType.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
// Test that literals are stored correctly in variant properties
@@ -765,7 +765,7 @@ void tst_qqmllanguage::assignLiteralToVariant()
QQmlComponent component(&engine, testFileUrl("assignLiteralToVariant.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(isJSNumberType(object->property("test1").userType()));
QVERIFY(isJSNumberType(object->property("test2").userType()));
@@ -804,7 +804,7 @@ void tst_qqmllanguage::assignLiteralToVar()
QQmlComponent component(&engine, testFileUrl("assignLiteralToVar.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(isJSNumberType(object->property("test1").userType()));
QCOMPARE(object->property("test2").userType(), (int)QMetaType::Double);
@@ -852,7 +852,7 @@ void tst_qqmllanguage::assignLiteralToJSValue()
QQmlComponent component(&engine, testFileUrl("assignLiteralToJSValue.qml"));
VERIFY_ERRORS(0);
QObject *root = component.create();
- QVERIFY(root != 0);
+ QVERIFY(root != nullptr);
{
MyQmlObject *object = root->findChild<MyQmlObject *>("test1");
@@ -940,7 +940,7 @@ void tst_qqmllanguage::assignNullStrings()
QQmlComponent component(&engine, testFileUrl("assignNullStrings.qml"));
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->stringProperty().isNull());
QVERIFY(object->byteArrayProperty().isNull());
QMetaObject::invokeMethod(object, "assignNullStringsFromJs", Qt::DirectConnection);
@@ -954,7 +954,7 @@ void tst_qqmllanguage::bindJSValueToVar()
VERIFY_ERRORS(0);
QObject *root = component.create();
- QVERIFY(root != 0);
+ QVERIFY(root != nullptr);
QObject *object = root->findChild<QObject *>("varProperties");
@@ -1003,7 +1003,7 @@ void tst_qqmllanguage::bindJSValueToVariant()
VERIFY_ERRORS(0);
QObject *root = component.create();
- QVERIFY(root != 0);
+ QVERIFY(root != nullptr);
QObject *object = root->findChild<QObject *>("variantProperties");
@@ -1052,7 +1052,7 @@ void tst_qqmllanguage::bindJSValueToType()
VERIFY_ERRORS(0);
QObject *root = component.create();
- QVERIFY(root != 0);
+ QVERIFY(root != nullptr);
{
MyTypeObject *object = root->findChild<MyTypeObject *>("typedProperties");
@@ -1087,7 +1087,7 @@ void tst_qqmllanguage::bindTypeToJSValue()
VERIFY_ERRORS(0);
QObject *root = component.create();
- QVERIFY(root != 0);
+ QVERIFY(root != nullptr);
{
MyQmlObject *object = root->findChild<MyQmlObject *>("flagProperty");
@@ -1226,7 +1226,7 @@ void tst_qqmllanguage::customParserTypes()
QQmlComponent component(&engine, testFileUrl("customParserTypes.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("count"), QVariant(2));
}
@@ -1236,7 +1236,7 @@ void tst_qqmllanguage::rootAsQmlComponent()
QQmlComponent component(&engine, testFileUrl("rootAsQmlComponent.qml"));
VERIFY_ERRORS(0);
MyContainer *object = qobject_cast<MyContainer *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("x"), QVariant(11));
QCOMPARE(object->getChildren()->count(), 2);
}
@@ -1260,12 +1260,12 @@ void tst_qqmllanguage::inlineQmlComponents()
QQmlComponent component(&engine, testFileUrl("inlineQmlComponents.qml"));
VERIFY_ERRORS(0);
MyContainer *object = qobject_cast<MyContainer *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->getChildren()->count(), 1);
QQmlComponent *comp = qobject_cast<QQmlComponent *>(object->getChildren()->at(0));
- QVERIFY(comp != 0);
+ QVERIFY(comp != nullptr);
MyQmlObject *compObject = qobject_cast<MyQmlObject *>(comp->create());
- QVERIFY(compObject != 0);
+ QVERIFY(compObject != nullptr);
QCOMPARE(compObject->value(), 11);
}
@@ -1276,17 +1276,17 @@ void tst_qqmllanguage::idProperty()
QQmlComponent component(&engine, testFileUrl("idProperty.qml"));
VERIFY_ERRORS(0);
MyContainer *object = qobject_cast<MyContainer *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->getChildren()->count(), 2);
MyTypeObject *child =
qobject_cast<MyTypeObject *>(object->getChildren()->at(0));
- QVERIFY(child != 0);
+ QVERIFY(child != nullptr);
QCOMPARE(child->id(), QString("myObjectId"));
QCOMPARE(object->property("object"), QVariant::fromValue((QObject *)child));
child =
qobject_cast<MyTypeObject *>(object->getChildren()->at(1));
- QVERIFY(child != 0);
+ QVERIFY(child != nullptr);
QCOMPARE(child->id(), QString("name.with.dots"));
}
{
@@ -1307,7 +1307,7 @@ void tst_qqmllanguage::autoNotifyConnection()
QQmlComponent component(&engine, testFileUrl("autoNotifyConnection.qml"));
VERIFY_ERRORS(0);
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QMetaProperty prop = object->metaObject()->property(object->metaObject()->indexOfProperty("receivedNotify"));
QVERIFY(prop.isValid());
@@ -1322,7 +1322,7 @@ void tst_qqmllanguage::assignSignal()
QQmlComponent component(&engine, testFileUrl("assignSignal.qml"));
VERIFY_ERRORS(0);
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlot");
emit object->basicSignal();
QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlotWithArgs(9)");
@@ -1334,7 +1334,7 @@ void tst_qqmllanguage::assignSignalFunctionExpression()
QQmlComponent component(&engine, testFileUrl("assignSignalFunctionExpression.qml"));
VERIFY_ERRORS(0);
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlot");
emit object->basicSignal();
QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlotWithArgs(9)");
@@ -1363,7 +1363,7 @@ void tst_qqmllanguage::overrideSignal()
if (errorFile.isEmpty()) {
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("success").toBool());
delete object;
} else {
@@ -1377,7 +1377,7 @@ void tst_qqmllanguage::dynamicProperties()
QQmlComponent component(&engine, testFileUrl("dynamicProperties.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("intProperty"), QVariant(10));
QCOMPARE(object->property("boolProperty"), QVariant(false));
QCOMPARE(object->property("doubleProperty"), QVariant(-10.1));
@@ -1395,7 +1395,7 @@ void tst_qqmllanguage::dynamicPropertiesNested()
QQmlComponent component(&engine, testFileUrl("dynamicPropertiesNested.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("super_a").toInt(), 11); // Overridden
QCOMPARE(object->property("super_c").toInt(), 14); // Inherited
@@ -1411,7 +1411,7 @@ void tst_qqmllanguage::listProperties()
QQmlComponent component(&engine, testFileUrl("listProperties.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toInt(), 2);
}
@@ -1431,18 +1431,18 @@ void tst_qqmllanguage::dynamicObjectProperties()
QQmlComponent component(&engine, testFileUrl("dynamicObjectProperties.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
- QCOMPARE(object->property("objectProperty"), qVariantFromValue((QObject*)0));
- QVERIFY(object->property("objectProperty2") != qVariantFromValue((QObject*)0));
+ QCOMPARE(object->property("objectProperty"), qVariantFromValue((QObject*)nullptr));
+ QVERIFY(object->property("objectProperty2") != qVariantFromValue((QObject*)nullptr));
}
{
QQmlComponent component(&engine, testFileUrl("dynamicObjectProperties.2.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
- QVERIFY(object->property("objectProperty") != qVariantFromValue((QObject*)0));
+ QVERIFY(object->property("objectProperty") != qVariantFromValue((QObject*)nullptr));
}
}
@@ -1454,7 +1454,7 @@ void tst_qqmllanguage::dynamicSignalsAndSlots()
QQmlComponent component(&engine, testFileUrl("dynamicSignalsAndSlots.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->metaObject()->indexOfMethod("signal1()") != -1);
QVERIFY(object->metaObject()->indexOfMethod("signal2()") != -1);
QVERIFY(object->metaObject()->indexOfMethod("slot1()") != -1);
@@ -1470,7 +1470,7 @@ void tst_qqmllanguage::simpleBindings()
QQmlComponent component(&engine, testFileUrl("simpleBindings.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("value1"), QVariant(10));
QCOMPARE(object->property("value2"), QVariant(10));
QCOMPARE(object->property("value3"), QVariant(21));
@@ -1484,20 +1484,20 @@ void tst_qqmllanguage::autoComponentCreation()
QQmlComponent component(&engine, testFileUrl("autoComponentCreation.qml"));
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
- QVERIFY(object != 0);
- QVERIFY(object->componentProperty() != 0);
+ QVERIFY(object != nullptr);
+ QVERIFY(object->componentProperty() != nullptr);
MyTypeObject *child = qobject_cast<MyTypeObject *>(object->componentProperty()->create());
- QVERIFY(child != 0);
+ QVERIFY(child != nullptr);
QCOMPARE(child->realProperty(), qreal(9));
}
{
QQmlComponent component(&engine, testFileUrl("autoComponentCreation.2.qml"));
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
- QVERIFY(object != 0);
- QVERIFY(object->componentProperty() != 0);
+ QVERIFY(object != nullptr);
+ QVERIFY(object->componentProperty() != nullptr);
MyTypeObject *child = qobject_cast<MyTypeObject *>(object->componentProperty()->create());
- QVERIFY(child != 0);
+ QVERIFY(child != nullptr);
QCOMPARE(child->realProperty(), qreal(9));
}
}
@@ -1507,10 +1507,10 @@ void tst_qqmllanguage::autoComponentCreationInGroupProperty()
QQmlComponent component(&engine, testFileUrl("autoComponentCreationInGroupProperties.qml"));
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
- QVERIFY(object != 0);
- QVERIFY(object->componentProperty() != 0);
+ QVERIFY(object != nullptr);
+ QVERIFY(object->componentProperty() != nullptr);
MyTypeObject *child = qobject_cast<MyTypeObject *>(object->componentProperty()->create());
- QVERIFY(child != 0);
+ QVERIFY(child != nullptr);
QCOMPARE(child->realProperty(), qreal(9));
}
@@ -1520,7 +1520,7 @@ void tst_qqmllanguage::propertyValueSource()
QQmlComponent component(&engine, testFileUrl("propertyValueSource.qml"));
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QList<QObject *> valueSources;
QObjectList allChildren = object->findChildren<QObject*>();
@@ -1532,7 +1532,7 @@ void tst_qqmllanguage::propertyValueSource()
QCOMPARE(valueSources.count(), 1);
MyPropertyValueSource *valueSource =
qobject_cast<MyPropertyValueSource *>(valueSources.at(0));
- QVERIFY(valueSource != 0);
+ QVERIFY(valueSource != nullptr);
QCOMPARE(valueSource->prop.object(), qobject_cast<QObject*>(object));
QCOMPARE(valueSource->prop.name(), QString(QLatin1String("intProperty")));
}
@@ -1541,7 +1541,7 @@ void tst_qqmllanguage::propertyValueSource()
QQmlComponent component(&engine, testFileUrl("propertyValueSource.2.qml"));
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QList<QObject *> valueSources;
QObjectList allChildren = object->findChildren<QObject*>();
@@ -1553,7 +1553,7 @@ void tst_qqmllanguage::propertyValueSource()
QCOMPARE(valueSources.count(), 1);
MyPropertyValueSource *valueSource =
qobject_cast<MyPropertyValueSource *>(valueSources.at(0));
- QVERIFY(valueSource != 0);
+ QVERIFY(valueSource != nullptr);
QCOMPARE(valueSource->prop.object(), qobject_cast<QObject*>(object));
QCOMPARE(valueSource->prop.name(), QString(QLatin1String("intProperty")));
}
@@ -1564,9 +1564,9 @@ void tst_qqmllanguage::attachedProperties()
QQmlComponent component(&engine, testFileUrl("attachedProperties.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QObject *attached = qmlAttachedPropertiesObject<MyQmlObject>(object);
- QVERIFY(attached != 0);
+ QVERIFY(attached != nullptr);
QCOMPARE(attached->property("value"), QVariant(10));
QCOMPARE(attached->property("value2"), QVariant(13));
}
@@ -1577,7 +1577,7 @@ void tst_qqmllanguage::dynamicObjects()
QQmlComponent component(&engine, testFileUrl("dynamicObject.1.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
// Tests the registration of custom variant string converters
@@ -1586,7 +1586,7 @@ void tst_qqmllanguage::customVariantTypes()
QQmlComponent component(&engine, testFileUrl("customVariantTypes.qml"));
VERIFY_ERRORS(0);
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->customType().a, 10);
}
@@ -1600,7 +1600,7 @@ void tst_qqmllanguage::valueTypes()
QTest::ignoreMessage(QtWarningMsg, qPrintable(message));
MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->rectProperty(), QRect(10, 11, 12, 13));
@@ -1631,7 +1631,7 @@ void tst_qqmllanguage::cppnamespace()
QQmlComponent component(&engine, testFileUrl("cppnamespace.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("intProperty").toInt(), (int)MyNamespace::MyOtherNSEnum::OtherKey2);
@@ -1642,7 +1642,7 @@ void tst_qqmllanguage::cppnamespace()
QQmlComponent component(&engine, testFileUrl("cppnamespace.2.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
}
@@ -1654,7 +1654,7 @@ void tst_qqmllanguage::aliasProperties()
QQmlComponent component(&engine, testFileUrl("alias.1.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// Read through alias
QCOMPARE(object->property("valueAlias").toInt(), 10);
@@ -1674,12 +1674,12 @@ void tst_qqmllanguage::aliasProperties()
QQmlComponent component(&engine, testFileUrl("alias.2.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// Read through alias
MyQmlObject *v =
qvariant_cast<MyQmlObject *>(object->property("aliasObject"));
- QVERIFY(v != 0);
+ QVERIFY(v != nullptr);
QCOMPARE(v->value(), 10);
// Write through alias
@@ -1688,7 +1688,7 @@ void tst_qqmllanguage::aliasProperties()
object->setProperty("aliasObject", qVariantFromValue(v2));
MyQmlObject *v3 =
qvariant_cast<MyQmlObject *>(object->property("aliasObject"));
- QVERIFY(v3 != 0);
+ QVERIFY(v3 != nullptr);
QCOMPARE(v3, v2);
delete object;
@@ -1699,7 +1699,7 @@ void tst_qqmllanguage::aliasProperties()
QQmlComponent component(&engine, testFileUrl("alias.3.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("value").toInt(), 1892);
QCOMPARE(object->property("value2").toInt(), 1892);
@@ -1720,7 +1720,7 @@ void tst_qqmllanguage::aliasProperties()
QQmlComponent component(&engine, testFileUrl("alias.4.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("enumAlias").toInt(), 1);
@@ -1732,7 +1732,7 @@ void tst_qqmllanguage::aliasProperties()
QQmlComponent component(&engine, testFileUrl("alias.5.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVariant v = object->property("otherAlias");
QCOMPARE(v.userType(), qMetaTypeId<MyQmlObject*>());
@@ -1754,7 +1754,7 @@ void tst_qqmllanguage::aliasProperties()
QQmlComponent component(&engine, testFileUrl("alias.6.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("a").toInt(), 1923);
}
@@ -1766,12 +1766,12 @@ void tst_qqmllanguage::aliasProperties()
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QObject *object1 = qvariant_cast<QObject *>(object->property("object"));
- QVERIFY(object1 != 0);
+ QVERIFY(object1 != nullptr);
QObject *object2 = qvariant_cast<QObject *>(object1->property("object"));
- QVERIFY(object2 != 0);
+ QVERIFY(object2 != nullptr);
QObject *alias = qvariant_cast<QObject *>(object->property("aliasedObject"));
QCOMPARE(alias, object2);
@@ -1780,7 +1780,7 @@ void tst_qqmllanguage::aliasProperties()
QObject *alias2 = object; // "Random" start value
int status = -1;
- void *a[] = { &alias2, 0, &status };
+ void *a[] = { &alias2, nullptr, &status };
QMetaObject::metacall(object, QMetaObject::ReadProperty,
object->metaObject()->indexOfProperty("aliasedObject"), a);
QVERIFY(!alias2);
@@ -1791,7 +1791,7 @@ void tst_qqmllanguage::aliasProperties()
QQmlComponent component(&engine, testFileUrl("alias.8.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("value").toInt(), 10);
@@ -1803,7 +1803,7 @@ void tst_qqmllanguage::aliasProperties()
QQmlComponent component(&engine, testFileUrl("alias.9.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("value").toInt(), 10);
@@ -1816,7 +1816,7 @@ void tst_qqmllanguage::aliasProperties()
QQmlComponent component(&engine, testFileUrl("alias.10.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// Read through alias
QCOMPARE(object->property("valueAlias").toRect(), QRect(10, 11, 9, 8));
@@ -1836,7 +1836,7 @@ void tst_qqmllanguage::aliasProperties()
QQmlComponent component(&engine, testFileUrl("alias.11.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// Read through alias
QCOMPARE(object->property("aliasProperty").toInt(), 19);
@@ -1911,19 +1911,19 @@ void tst_qqmllanguage::componentCompositeType()
QQmlComponent component(&engine, testFileUrl("componentCompositeType.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
class TestType : public QObject {
Q_OBJECT
public:
- TestType(QObject *p=0) : QObject(p) {}
+ TestType(QObject *p=nullptr) : QObject(p) {}
};
class TestType2 : public QObject {
Q_OBJECT
public:
- TestType2(QObject *p=0) : QObject(p) {}
+ TestType2(QObject *p=nullptr) : QObject(p) {}
};
void tst_qqmllanguage::i18n_data()
@@ -1945,7 +1945,7 @@ void tst_qqmllanguage::i18n()
QQmlComponent component(&engine, testFileUrl(file));
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->stringProperty(), stringProperty);
delete object;
@@ -1960,7 +1960,7 @@ void tst_qqmllanguage::onCompleted()
QTest::ignoreMessage(QtDebugMsg, "Completed 6 10");
QTest::ignoreMessage(QtDebugMsg, "Completed 10 11");
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
// Check that the Component::onDestruction attached property works
@@ -1969,7 +1969,7 @@ void tst_qqmllanguage::onDestruction()
QQmlComponent component(&engine, testFileUrl("onDestruction.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QTest::ignoreMessage(QtDebugMsg, "Destruction 6 10");
QTest::ignoreMessage(QtDebugMsg, "Destruction 6 10");
QTest::ignoreMessage(QtDebugMsg, "Destruction 10 11");
@@ -1984,7 +1984,7 @@ void tst_qqmllanguage::scriptString()
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(!object->scriptProperty().isEmpty());
QCOMPARE(object->scriptProperty().stringLiteral(), QString());
bool ok;
@@ -1992,12 +1992,12 @@ void tst_qqmllanguage::scriptString()
QCOMPARE(ok, false);
const QQmlScriptStringPrivate *scriptPrivate = QQmlScriptStringPrivate::get(object->scriptProperty());
- QVERIFY(scriptPrivate != 0);
+ QVERIFY(scriptPrivate != nullptr);
QCOMPARE(scriptPrivate->script, QString("foo + bar"));
QCOMPARE(scriptPrivate->scope, qobject_cast<QObject*>(object));
QCOMPARE(scriptPrivate->context, qmlContext(object));
- QVERIFY(object->grouped() != 0);
+ QVERIFY(object->grouped() != nullptr);
const QQmlScriptStringPrivate *groupedPrivate = QQmlScriptStringPrivate::get(object->grouped()->script());
QCOMPARE(groupedPrivate->script, QString("console.log(1921)"));
QCOMPARE(groupedPrivate->scope, qobject_cast<QObject*>(object));
@@ -2009,7 +2009,7 @@ void tst_qqmllanguage::scriptString()
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->scriptProperty().stringLiteral(), QString("hello\\n\\\"world\\\""));
}
@@ -2018,7 +2018,7 @@ void tst_qqmllanguage::scriptString()
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
bool ok;
QCOMPARE(object->scriptProperty().numberLiteral(&ok), qreal(12.345));
QCOMPARE(ok, true);
@@ -2030,7 +2030,7 @@ void tst_qqmllanguage::scriptString()
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
bool ok;
QCOMPARE(object->scriptProperty().booleanLiteral(&ok), true);
QCOMPARE(ok, true);
@@ -2041,7 +2041,7 @@ void tst_qqmllanguage::scriptString()
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->scriptProperty().isNullLiteral(), true);
}
@@ -2050,7 +2050,7 @@ void tst_qqmllanguage::scriptString()
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->scriptProperty().isUndefinedLiteral(), true);
}
{
@@ -2058,11 +2058,11 @@ void tst_qqmllanguage::scriptString()
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QQmlScriptString ss = object->scriptProperty();
{
- QQmlExpression expr(ss, /*context*/0, object);
+ QQmlExpression expr(ss, /*context*/nullptr, object);
QCOMPARE(expr.evaluate().toInt(), int(100));
}
@@ -2071,7 +2071,7 @@ void tst_qqmllanguage::scriptString()
QVERIFY(testScope.metaObject()->indexOfProperty("intProperty") != object->metaObject()->indexOfProperty("intProperty"));
testScope.setIntProperty(42);
- QQmlExpression expr(ss, /*context*/0, &testScope);
+ QQmlExpression expr(ss, /*context*/nullptr, &testScope);
QCOMPARE(expr.evaluate().toInt(), int(42));
}
}
@@ -2084,9 +2084,9 @@ void tst_qqmllanguage::scriptStringJs()
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QQmlContext *context = QQmlEngine::contextForObject(object);
- QVERIFY(context != 0);
+ QVERIFY(context != nullptr);
bool ok;
QCOMPARE(QQmlScriptStringPrivate::get(object->scriptProperty())->script, QString("\" hello \\\" world \""));
@@ -2188,7 +2188,7 @@ void tst_qqmllanguage::scriptStringWithoutSourceCode()
VERIFY_ERRORS(0);
MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QQmlScriptString ss = object->scriptProperty();
QVERIFY(!ss.isEmpty());
QCOMPARE(ss.stringLiteral(), QString());
@@ -2197,13 +2197,13 @@ void tst_qqmllanguage::scriptStringWithoutSourceCode()
QCOMPARE(ok, false);
const QQmlScriptStringPrivate *scriptPrivate = QQmlScriptStringPrivate::get(ss);
- QVERIFY(scriptPrivate != 0);
+ QVERIFY(scriptPrivate != nullptr);
QVERIFY(scriptPrivate->script.isEmpty());
QCOMPARE(scriptPrivate->scope, qobject_cast<QObject*>(object));
QCOMPARE(scriptPrivate->context, qmlContext(object));
{
- QQmlExpression expr(ss, /*context*/0, object);
+ QQmlExpression expr(ss, /*context*/nullptr, object);
QCOMPARE(expr.evaluate().toInt(), int(100));
}
}
@@ -2215,17 +2215,17 @@ void tst_qqmllanguage::scriptStringComparison()
QQmlComponent component1(&engine, testFileUrl("scriptString.qml"));
QVERIFY(!component1.isError() && component1.errors().isEmpty());
MyTypeObject *object1 = qobject_cast<MyTypeObject*>(component1.create());
- QVERIFY(object1 != 0);
+ QVERIFY(object1 != nullptr);
QQmlComponent component2(&engine, testFileUrl("scriptString2.qml"));
QVERIFY(!component2.isError() && component2.errors().isEmpty());
MyTypeObject *object2 = qobject_cast<MyTypeObject*>(component2.create());
- QVERIFY(object2 != 0);
+ QVERIFY(object2 != nullptr);
QQmlComponent component3(&engine, testFileUrl("scriptString3.qml"));
QVERIFY(!component3.isError() && component3.errors().isEmpty());
MyTypeObject *object3 = qobject_cast<MyTypeObject*>(component3.create());
- QVERIFY(object3 != 0);
+ QVERIFY(object3 != nullptr);
//QJSValue inst1 = engine.newQObject(object1);
QJSValue inst2 = engine.newQObject(object2);
@@ -2285,7 +2285,7 @@ void tst_qqmllanguage::scriptStringComparison()
// because the (none literal) script string may access variables which have different
// values in both instances and hence evaluated to different results.
MyTypeObject *object1_2 = qobject_cast<MyTypeObject*>(component1.create());
- QVERIFY(object1_2 != 0);
+ QVERIFY(object1_2 != nullptr);
QVERIFY(object1->scriptProperty() != object1_2->scriptProperty());
}
@@ -2297,7 +2297,7 @@ void tst_qqmllanguage::defaultPropertyListOrder()
VERIFY_ERRORS(0);
MyContainer *container = qobject_cast<MyContainer *>(component.create());
- QVERIFY(container != 0);
+ QVERIFY(container != nullptr);
QCOMPARE(container->getChildren()->count(), 6);
QCOMPARE(container->getChildren()->at(0)->property("index"), QVariant(0));
@@ -2426,7 +2426,7 @@ void tst_qqmllanguage::testType(const QString& qml, const QString& type, const Q
} else {
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(QString(object->metaObject()->className()), type);
delete object;
}
@@ -2440,7 +2440,7 @@ void tst_qqmllanguage::inlineAssignmentsOverrideBindings()
QQmlComponent component(&engine, testFileUrl("inlineAssignmentsOverrideBindings.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toInt(), 11);
delete o;
}
@@ -2874,7 +2874,7 @@ void tst_qqmllanguage::importsPath()
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toString(), value);
delete object;
@@ -3085,7 +3085,7 @@ void tst_qqmllanguage::importJs()
if (performTest) {
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test").toBool(),true);
delete object;
}
@@ -3130,27 +3130,27 @@ void tst_qqmllanguage::qmlAttachedPropertiesObjectMethod()
{
QObject object;
- QCOMPARE(qmlAttachedPropertiesObject<MyQmlObject>(&object, false), (QObject *)0);
+ QCOMPARE(qmlAttachedPropertiesObject<MyQmlObject>(&object, false), (QObject *)nullptr);
QVERIFY(qmlAttachedPropertiesObject<MyQmlObject>(&object, true));
{
QQmlComponent component(&engine, testFileUrl("qmlAttachedPropertiesObjectMethod.1.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
- QCOMPARE(qmlAttachedPropertiesObject<MyQmlObject>(object, false), (QObject *)0);
- QVERIFY(qmlAttachedPropertiesObject<MyQmlObject>(object, true) != 0);
+ QCOMPARE(qmlAttachedPropertiesObject<MyQmlObject>(object, false), (QObject *)nullptr);
+ QVERIFY(qmlAttachedPropertiesObject<MyQmlObject>(object, true) != nullptr);
}
{
QQmlComponent component(&engine, testFileUrl("qmlAttachedPropertiesObjectMethod.2.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
- QVERIFY(qmlAttachedPropertiesObject<MyQmlObject>(object, false) != 0);
- QVERIFY(qmlAttachedPropertiesObject<MyQmlObject>(object, true) != 0);
+ QVERIFY(qmlAttachedPropertiesObject<MyQmlObject>(object, false) != nullptr);
+ QVERIFY(qmlAttachedPropertiesObject<MyQmlObject>(object, true) != nullptr);
}
}
@@ -3172,7 +3172,7 @@ void tst_qqmllanguage::customOnProperty()
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("on").toInt(), 10);
@@ -3186,7 +3186,7 @@ void tst_qqmllanguage::variantNotify()
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("notifyCount").toInt(), 1);
@@ -3200,7 +3200,7 @@ void tst_qqmllanguage::revisions()
VERIFY_ERRORS(0);
MyRevisionedClass *object = qobject_cast<MyRevisionedClass*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->prop2(), 10.0);
@@ -3212,7 +3212,7 @@ void tst_qqmllanguage::revisions()
VERIFY_ERRORS(0);
MyRevisionedSubclass *object = qobject_cast<MyRevisionedSubclass*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->prop1(), 10.0);
QCOMPARE(object->prop2(), 10.0);
@@ -3225,7 +3225,7 @@ void tst_qqmllanguage::revisions()
QQmlComponent component(&engine, testFileUrl("versionedbase.qml"));
VERIFY_ERRORS(0);
MySubclass *object = qobject_cast<MySubclass*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->prop1(), 10.0);
QCOMPARE(object->prop2(), 10.0);
@@ -3277,7 +3277,7 @@ void tst_qqmllanguage::subclassedUncreateableRevision()
QTest::ignoreMessage(QtWarningMsg, "QQmlComponent: Component is not ready");
c.setData(qml.toUtf8(), QUrl::fromLocalFile(QDir::currentPath()));
QObject *obj = c.create();
- QCOMPARE(obj, static_cast<QObject*>(0));
+ QCOMPARE(obj, static_cast<QObject*>(nullptr));
QCOMPARE(c.errors().count(), 1);
QCOMPARE(c.errors().first().description(), QString("Cannot create MyUncreateableBaseClass"));
}
@@ -3290,7 +3290,7 @@ void tst_qqmllanguage::subclassedUncreateableRevision()
c.setData(qml.toUtf8(), QUrl::fromLocalFile(QDir::currentPath()));
QObject *obj = c.create();
if (!shouldWork) {
- QCOMPARE(obj, static_cast<QObject*>(0));
+ QCOMPARE(obj, static_cast<QObject*>(nullptr));
return;
}
@@ -3333,7 +3333,7 @@ void tst_qqmllanguage::subclassedExtendedUncreateableRevision()
QTest::ignoreMessage(QtWarningMsg, "QQmlComponent: Component is not ready");
c.setData(qml.toUtf8(), QUrl::fromLocalFile(QDir::currentPath()));
QObject *obj = c.create();
- QCOMPARE(obj, static_cast<QObject*>(0));
+ QCOMPARE(obj, static_cast<QObject*>(nullptr));
QCOMPARE(c.errors().count(), 1);
QCOMPARE(c.errors().first().description(), QString("Cannot create MyExtendedUncreateableBaseClass"));
}
@@ -3346,7 +3346,7 @@ void tst_qqmllanguage::subclassedExtendedUncreateableRevision()
c.setData(qml.toUtf8(), QUrl::fromLocalFile(QDir::currentPath()));
QObject *obj = c.create();
if (!shouldWork) {
- QCOMPARE(obj, static_cast<QObject*>(0));
+ QCOMPARE(obj, static_cast<QObject*>(nullptr));
return;
}
@@ -3416,7 +3416,7 @@ void tst_qqmllanguage::aliasPropertyChangeSignals()
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
@@ -3429,7 +3429,7 @@ void tst_qqmllanguage::aliasPropertyChangeSignals()
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toBool(), true);
@@ -3445,7 +3445,7 @@ void tst_qqmllanguage::propertyInit()
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toInt(), 1);
@@ -3457,7 +3457,7 @@ void tst_qqmllanguage::propertyInit()
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test").toInt(), 123);
@@ -3472,7 +3472,7 @@ void tst_qqmllanguage::registrationOrder()
QQmlComponent component(&engine, testFileUrl("registrationOrder.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->metaObject(), &MyVersion2Class::staticMetaObject);
delete o;
}
@@ -3482,7 +3482,7 @@ void tst_qqmllanguage::readonly()
QQmlComponent component(&engine, testFileUrl("readonly.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("test1").toInt(), 10);
QCOMPARE(o->property("test2").toInt(), 18);
@@ -3534,7 +3534,7 @@ void tst_qqmllanguage::receivers()
QQmlComponent component(&engine, testFileUrl("receivers.qml"));
MyReceiversTestObject *o = qobject_cast<MyReceiversTestObject*>(component.create());
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->mySignalCount(), 1);
QCOMPARE(o->propChangedCount(), 2);
QCOMPARE(o->myUnconnectedSignalCount(), 0);
@@ -3552,7 +3552,7 @@ void tst_qqmllanguage::registeredCompositeType()
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
delete o;
}
@@ -3564,7 +3564,7 @@ void tst_qqmllanguage::registeredCompositeTypeWithEnum()
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("enumValue0").toInt(), static_cast<int>(MyCompositeBaseType::EnumValue0));
QCOMPARE(o->property("enumValue42").toInt(), static_cast<int>(MyCompositeBaseType::EnumValue42));
@@ -3580,7 +3580,7 @@ void tst_qqmllanguage::registeredCompositeTypeWithAttachedProperty()
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->property("attachedProperty").toString(), QStringLiteral("test"));
@@ -3606,7 +3606,7 @@ void tst_qqmllanguage::signalWithDefaultArg()
QQmlComponent component(&engine, testFileUrl("signalWithDefaultArg.qml"));
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("signalCount").toInt(), 0);
QCOMPARE(object->property("signalArg").toInt(), 0);
@@ -3637,7 +3637,7 @@ void tst_qqmllanguage::signalParameterTypes()
{
QQmlComponent component(&engine, testFileUrl("signalParameterTypes.1.qml"));
QObject *obj = component.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QVERIFY(obj->property("success").toBool());
delete obj;
}
@@ -3646,7 +3646,7 @@ void tst_qqmllanguage::signalParameterTypes()
{
QQmlComponent component(&engine, testFileUrl("signalParameterTypes.2.qml"));
QObject *obj = component.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QVERIFY(obj->property("success").toBool());
delete obj;
}
@@ -3662,14 +3662,14 @@ void tst_qqmllanguage::globalEnums()
QQmlComponent component(&engine, testFileUrl("globalEnums.qml"));
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
MyEnum1Class *enum1Class = o->findChild<MyEnum1Class *>(QString::fromLatin1("enum1Class"));
- QVERIFY(enum1Class != 0);
+ QVERIFY(enum1Class != nullptr);
QVERIFY(enum1Class->getValue() == -1);
MyEnumDerivedClass *enum2Class = o->findChild<MyEnumDerivedClass *>(QString::fromLatin1("enumDerivedClass"));
- QVERIFY(enum2Class != 0);
+ QVERIFY(enum2Class != nullptr);
QVERIFY(enum2Class->getValueA() == -1);
QVERIFY(enum2Class->getValueB() == -1);
QVERIFY(enum2Class->getValueC() == 0);
@@ -3754,7 +3754,7 @@ void tst_qqmllanguage::scopedEnum()
QQmlComponent component(&engine, testFileUrl("scopedEnum.qml"));
MyTypeObject *o = qobject_cast<MyTypeObject *>(component.create());
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QCOMPARE(o->scopedEnum(), MyTypeObject::MyScopedEnum::ScopedVal1);
QCOMPARE(o->intProperty(), (int)MyTypeObject::MyScopedEnum::ScopedVal2);
@@ -3831,7 +3831,7 @@ void tst_qqmllanguage::literals()
QQmlComponent component(&engine, testFile("literals.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property(property.toLatin1()), value);
delete object;
}
@@ -3853,13 +3853,13 @@ void tst_qqmllanguage::objectDeletionNotify()
QQmlComponent component(&engine, testFile(file));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("success").toBool(), true);
QMetaObject::invokeMethod(object, "destroyObject");
// Process the deletion event
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
QCOMPARE(object->property("success").toBool(), true);
@@ -3872,7 +3872,7 @@ void tst_qqmllanguage::scopedProperties()
QQmlComponent component(&engine, testFile("scopedProperties.qml"));
QScopedPointer<QObject> o(component.create());
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QVERIFY(o->property("success").toBool());
}
@@ -3880,7 +3880,7 @@ void tst_qqmllanguage::deepProperty()
{
QQmlComponent component(&engine, testFile("deepProperty.qml"));
QScopedPointer<QObject> o(component.create());
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
QFont font = qvariant_cast<QFont>(qvariant_cast<QObject*>(o->property("someObject"))->property("font"));
QCOMPARE(font.family(), QStringLiteral("test"));
}
@@ -3899,10 +3899,10 @@ void tst_qqmllanguage::implicitImportsLast()
QQmlComponent component(&engine, testFile("localOrderTest.qml"));
VERIFY_ERRORS(0);
QObject *object = qobject_cast<QObject *>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(QString(object->metaObject()->className()).startsWith(QLatin1String("QQuickMouseArea")));
QObject* object2 = object->property("item").value<QObject*>();
- QVERIFY(object2 != 0);
+ QVERIFY(object2 != nullptr);
QCOMPARE(QString(object2->metaObject()->className()), QLatin1String("QQuickRectangle"));
engine.setImportPathList(defaultImportPathList);
@@ -3910,8 +3910,8 @@ void tst_qqmllanguage::implicitImportsLast()
void tst_qqmllanguage::getSingletonInstance(QQmlEngine& engine, const char* fileName, const char* propertyName, QObject** result /* out */)
{
- QVERIFY(fileName != 0);
- QVERIFY(propertyName != 0);
+ QVERIFY(fileName != nullptr);
+ QVERIFY(propertyName != nullptr);
if (!fileName || !propertyName)
return;
@@ -3919,15 +3919,15 @@ void tst_qqmllanguage::getSingletonInstance(QQmlEngine& engine, const char* file
QQmlComponent component(&engine, testFile(fileName));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
getSingletonInstance(object, propertyName, result);
}
void tst_qqmllanguage::getSingletonInstance(QObject* o, const char* propertyName, QObject** result /* out */)
{
- QVERIFY(o != 0);
- QVERIFY(propertyName != 0);
+ QVERIFY(o != nullptr);
+ QVERIFY(propertyName != nullptr);
if (!o || !propertyName)
return;
@@ -3935,11 +3935,11 @@ void tst_qqmllanguage::getSingletonInstance(QObject* o, const char* propertyName
QVariant variant = o->property(propertyName);
QVERIFY(variant.userType() == qMetaTypeId<QObject *>());
- QObject *singleton = NULL;
+ QObject *singleton = nullptr;
if (variant.canConvert<QObject*>())
singleton = variant.value<QObject*>();
- QVERIFY(singleton != 0);
+ QVERIFY(singleton != nullptr);
*result = singleton;
}
@@ -3959,7 +3959,7 @@ void tst_qqmllanguage::compositeSingletonProperties()
QQmlComponent component(&engine, testFile("singletonTest1.qml"));
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
verifyCompositeSingletonPropertyValues(o, "value1", 125, "value2", -55);
}
@@ -3968,14 +3968,14 @@ void tst_qqmllanguage::compositeSingletonProperties()
// engine are the same.
void tst_qqmllanguage::compositeSingletonSameEngine()
{
- QObject* s1 = NULL;
+ QObject* s1 = nullptr;
getSingletonInstance(engine, "singletonTest2.qml", "singleton1", &s1);
- QVERIFY(s1 != 0);
+ QVERIFY(s1 != nullptr);
s1->setProperty("testProp2", QVariant(13));
- QObject* s2 = NULL;
+ QObject* s2 = nullptr;
getSingletonInstance(engine, "singletonTest3.qml", "singleton2", &s2);
- QVERIFY(s2 != 0);
+ QVERIFY(s2 != nullptr);
QCOMPARE(s2->property("testProp2"), QVariant(13));
QCOMPARE(s1, s2);
@@ -3987,14 +3987,14 @@ void tst_qqmllanguage::compositeSingletonDifferentEngine()
{
QQmlEngine e2;
- QObject* s1 = NULL;
+ QObject* s1 = nullptr;
getSingletonInstance(engine, "singletonTest2.qml", "singleton1", &s1);
- QVERIFY(s1 != 0);
+ QVERIFY(s1 != nullptr);
s1->setProperty("testProp2", QVariant(13));
- QObject* s2 = NULL;
+ QObject* s2 = nullptr;
getSingletonInstance(e2, "singletonTest3.qml", "singleton2", &s2);
- QVERIFY(s2 != 0);
+ QVERIFY(s2 != nullptr);
QCOMPARE(s2->property("testProp2"), QVariant(25));
QVERIFY(s1 != s2);
@@ -4013,19 +4013,19 @@ void tst_qqmllanguage::compositeSingletonQualifiedNamespace()
QQmlComponent component(&engine, testFile("singletonTest5.qml"));
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
verifyCompositeSingletonPropertyValues(o, "value1", 125, "value2", -55);
// lets verify that the singleton instance we are using is the same
// when loaded through another file (without namespace!)
- QObject *s1 = NULL;
+ QObject *s1 = nullptr;
getSingletonInstance(o, "singletonInstance", &s1);
- QVERIFY(s1 != 0);
+ QVERIFY(s1 != nullptr);
- QObject* s2 = NULL;
+ QObject* s2 = nullptr;
getSingletonInstance(engine, "singletonTest5a.qml", "singletonInstance", &s2);
- QVERIFY(s2 != 0);
+ QVERIFY(s2 != nullptr);
QCOMPARE(s1, s2);
}
@@ -4038,20 +4038,20 @@ void tst_qqmllanguage::compositeSingletonModule()
QQmlComponent component(&engine, testFile("singletonTest6.qml"));
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
verifyCompositeSingletonPropertyValues(o, "value1", 125, "value2", -55);
verifyCompositeSingletonPropertyValues(o, "value3", 125, "value4", -55);
// lets verify that the singleton instance we are using is the same
// when loaded through another file
- QObject *s1 = NULL;
+ QObject *s1 = nullptr;
getSingletonInstance(o, "singletonInstance", &s1);
- QVERIFY(s1 != 0);
+ QVERIFY(s1 != nullptr);
- QObject* s2 = NULL;
+ QObject* s2 = nullptr;
getSingletonInstance(engine, "singletonTest6a.qml", "singletonInstance", &s2);
- QVERIFY(s2 != 0);
+ QVERIFY(s2 != nullptr);
QCOMPARE(s1, s2);
}
@@ -4064,20 +4064,20 @@ void tst_qqmllanguage::compositeSingletonModuleVersioned()
QQmlComponent component(&engine, testFile("singletonTest7.qml"));
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
verifyCompositeSingletonPropertyValues(o, "value1", 225, "value2", 55);
verifyCompositeSingletonPropertyValues(o, "value3", 225, "value4", 55);
// lets verify that the singleton instance we are using is the same
// when loaded through another file
- QObject *s1 = NULL;
+ QObject *s1 = nullptr;
getSingletonInstance(o, "singletonInstance", &s1);
- QVERIFY(s1 != 0);
+ QVERIFY(s1 != nullptr);
- QObject* s2 = NULL;
+ QObject* s2 = nullptr;
getSingletonInstance(engine, "singletonTest7a.qml", "singletonInstance", &s2);
- QVERIFY(s2 != 0);
+ QVERIFY(s2 != nullptr);
QCOMPARE(s1, s2);
}
@@ -4090,20 +4090,20 @@ void tst_qqmllanguage::compositeSingletonModuleQualified()
QQmlComponent component(&engine, testFile("singletonTest8.qml"));
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
verifyCompositeSingletonPropertyValues(o, "value1", 225, "value2", 55);
verifyCompositeSingletonPropertyValues(o, "value3", 225, "value4", 55);
// lets verify that the singleton instance we are using is the same
// when loaded through another file
- QObject *s1 = NULL;
+ QObject *s1 = nullptr;
getSingletonInstance(o, "singletonInstance", &s1);
- QVERIFY(s1 != 0);
+ QVERIFY(s1 != nullptr);
- QObject* s2 = NULL;
+ QObject* s2 = nullptr;
getSingletonInstance(engine, "singletonTest8a.qml", "singletonInstance", &s2);
- QVERIFY(s2 != 0);
+ QVERIFY(s2 != nullptr);
QCOMPARE(s1, s2);
}
@@ -4129,7 +4129,7 @@ void tst_qqmllanguage::compositeSingletonDynamicSignal()
QQmlComponent component(&engine, testFile("singletonTest11.qml"));
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
verifyCompositeSingletonPropertyValues(o, "value1", 99, "value2", -55);
}
@@ -4178,7 +4178,7 @@ void tst_qqmllanguage::compositeSingletonRemote()
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
verifyCompositeSingletonPropertyValues(o, "value1", 525, "value2", 355);
}
@@ -4191,7 +4191,7 @@ void tst_qqmllanguage::compositeSingletonJavaScriptPragma()
QQmlComponent component(&engine, testFile("singletonTest16.qml"));
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
// The value1 that is read from the SingletonType was changed from 125 to 99
// in compositeSingletonDynamicSignal() above. As the type is a singleton and
@@ -4209,7 +4209,7 @@ void tst_qqmllanguage::compositeSingletonSelectors()
QQmlComponent component(&e2, testFile("singletonTest1.qml"));
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
verifyCompositeSingletonPropertyValues(o, "value1", 625, "value2", 455);
}
@@ -4221,7 +4221,7 @@ void tst_qqmllanguage::compositeSingletonRegistered()
QQmlComponent component(&engine, testFile("singletonTest17.qml"));
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
verifyCompositeSingletonPropertyValues(o, "value1", 925, "value2", 755);
}
@@ -4234,7 +4234,7 @@ void tst_qqmllanguage::compositeSingletonCircular()
QQmlTestMessageHandler messageHandler;
QObject *o = component.create();
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
// ensure we aren't hitting the recursion warning
QVERIFY2(messageHandler.messages().isEmpty(), qPrintable(messageHandler.messageString()));
@@ -4321,7 +4321,7 @@ void tst_qqmllanguage::preservePropertyCacheOnGroupObjects()
QVERIFY(ddata);
QQmlPropertyCache *subCache = ddata->propertyCache;
QVERIFY(subCache);
- QQmlPropertyData *pd = subCache->property(QStringLiteral("newProperty"), /*object*/0, /*context*/0);
+ QQmlPropertyData *pd = subCache->property(QStringLiteral("newProperty"), /*object*/nullptr, /*context*/nullptr);
QVERIFY(pd);
QCOMPARE(pd->propType(), qMetaTypeId<int>());
}
@@ -4589,7 +4589,7 @@ void tst_qqmllanguage::noChildEvents()
component.setData("import QtQml 2.0; import Test 1.0; MyQmlObject { property QtObject child: QtObject {} }", QUrl());
VERIFY_ERRORS(0);
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->childAddedEventCount(), 0);
}
@@ -4609,14 +4609,14 @@ void tst_qqmllanguage::deleteSingletons()
QQmlComponent component(&tmpEngine, testFile("singletonTest5.qml"));
VERIFY_ERRORS(0);
QObject *o = component.create();
- QVERIFY(o != 0);
- QObject *s1 = NULL;
+ QVERIFY(o != nullptr);
+ QObject *s1 = nullptr;
getSingletonInstance(o, "singletonInstance", &s1);
- QVERIFY(s1 != 0);
+ QVERIFY(s1 != nullptr);
singleton = s1;
- QVERIFY(singleton.data() != 0);
+ QVERIFY(singleton.data() != nullptr);
}
- QVERIFY(singleton.data() == 0);
+ QVERIFY(singleton.data() == nullptr);
}
void tst_qqmllanguage::arrayBuffer_data()
@@ -4636,7 +4636,7 @@ void tst_qqmllanguage::arrayBuffer()
QQmlComponent component(&engine, testFile(file));
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("ok").toBool(), true);
}
@@ -4855,9 +4855,9 @@ void tst_qqmllanguage::instanceof()
VERIFY_ERRORS(0);
QScopedPointer<QObject> o(component.create());
- QVERIFY(o != 0);
+ QVERIFY(o != nullptr);
- QQmlExpression expr(engine.contextForObject(o.data()), 0, QString::fromLatin1(QTest::currentDataTag()));
+ QQmlExpression expr(engine.contextForObject(o.data()), nullptr, QString::fromLatin1(QTest::currentDataTag()));
QVariant ret = expr.evaluate();
if (expectedValue.type() == QVariant::Bool) {
diff --git a/tests/auto/qml/qqmllistcompositor/tst_qqmllistcompositor.cpp b/tests/auto/qml/qqmllistcompositor/tst_qqmllistcompositor.cpp
index 513bea2e16..e6e47bda28 100644
--- a/tests/auto/qml/qqmllistcompositor/tst_qqmllistcompositor.cpp
+++ b/tests/auto/qml/qqmllistcompositor/tst_qqmllistcompositor.cpp
@@ -45,7 +45,7 @@ struct Range
template <typename T> struct Array
{
- Array() : array(0), count(0) {}
+ Array() : array(nullptr), count(0) {}
template<int N> Array(const T (&array)[N]) : array(array), count(N) {}
T operator [](int index) const { return array[index]; }
@@ -181,7 +181,7 @@ void tst_qqmllistcompositor::find_data()
<< (RangeList()
<< Range(a, 0, 1, int(C::PrependFlag | SelectionFlag | C::DefaultFlag | C::CacheFlag))
<< Range(a, 1, 1, int(C::AppendFlag | C::PrependFlag | C::CacheFlag))
- << Range(0, 0, 1, int(VisibleFlag| C::CacheFlag)))
+ << Range(nullptr, 0, 1, int(VisibleFlag| C::CacheFlag)))
<< C::Cache << 2
<< Selection << 0
<< 0 << 0 << 0 << 0
@@ -238,7 +238,7 @@ void tst_qqmllistcompositor::findInsertPosition_data()
<< (RangeList()
<< Range(a, 0, 1, int(C::PrependFlag | SelectionFlag | C::DefaultFlag | C::CacheFlag))
<< Range(a, 1, 1, int(C::AppendFlag | C::PrependFlag | C::CacheFlag))
- << Range(0, 0, 1, int(VisibleFlag| C::CacheFlag)))
+ << Range(nullptr, 0, 1, int(VisibleFlag| C::CacheFlag)))
<< Selection << 0
<< 0 << 0 << 0 << 0
<< uint(C::PrependFlag | SelectionFlag | C::DefaultFlag | C::CacheFlag) << 0;
@@ -246,7 +246,7 @@ void tst_qqmllistcompositor::findInsertPosition_data()
<< (RangeList()
<< Range(a, 0, 1, int(C::PrependFlag | SelectionFlag | C::DefaultFlag | C::CacheFlag))
<< Range(a, 1, 1, int(C::AppendFlag | C::PrependFlag | C::CacheFlag))
- << Range(0, 0, 1, int(VisibleFlag| C::CacheFlag)))
+ << Range(nullptr, 0, 1, int(VisibleFlag| C::CacheFlag)))
<< Selection << 1
<< 1 << 1 << 1 << 3
<< uint(0) << 0;
@@ -390,17 +390,17 @@ void tst_qqmllistcompositor::clearFlags_data()
int listA; void *a = &listA;
{ static const int cacheIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,11,0,0,0,0};
- static const void *cacheLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,0,0,0,0};
+ static const void *cacheLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr,nullptr};
static const int defaultIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,11,0,0,0,0};
- static const void *defaultLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,0,0,0,0};
+ static const void *defaultLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr,nullptr};
static const int visibleIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,11,0,0,0,0};
- static const void *visibleLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,0,0,0,0};
+ static const void *visibleLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr,nullptr};
static const int selectionIndexes[] = {0,1,4,5,6,7,8,9,10,11,0,0,0,0};
- static const void *selectionLists[] = {a,a,a,a,a,a,a,a, a, a,0,0,0,0};
+ static const void *selectionLists[] = {a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr,nullptr};
QTest::newRow("Default, 2, 2, Selection")
<< (RangeList()
<< Range(a, 0, 12, int(C::AppendFlag | C::PrependFlag | SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag))
- << Range(0, 0, 4, int(SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag)))
+ << Range(nullptr, 0, 4, int(SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag)))
<< C::Default << 2 << 2 << int(SelectionFlag)
<< (RemoveList()
<< Remove(2, 2, 2, 2, 2, SelectionFlag | C::CacheFlag))
@@ -409,19 +409,19 @@ void tst_qqmllistcompositor::clearFlags_data()
<< IndexArray(visibleIndexes) << ListArray(visibleLists)
<< IndexArray(selectionIndexes) << ListArray(selectionLists);
} { static const int cacheIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,11,0,0,0,0};
- static const void *cacheLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,0,0,0,0};
+ static const void *cacheLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr,nullptr};
static const int defaultIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,11,0,0,0,0};
- static const void *defaultLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,0,0,0,0};
+ static const void *defaultLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr,nullptr};
static const int visibleIndexes[] = {0,2,3,5,6,7,8,9,10,11,0,0,0,0};
- static const void *visibleLists[] = {a,a,a,a,a,a,a,a, a, a,0,0,0,0};
+ static const void *visibleLists[] = {a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr,nullptr};
static const int selectionIndexes[] = {0,1,4,5,6,7,8,9,10,11,0,0,0,0};
- static const void *selectionLists[] = {a,a,a,a,a,a,a,a, a, a,0,0,0,0};
+ static const void *selectionLists[] = {a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr,nullptr};
QTest::newRow("Selection, 1, 2, Visible")
<< (RangeList()
<< Range(a, 0, 2, int(C::PrependFlag | SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag))
<< Range(a, 2, 2, int(C::PrependFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag))
<< Range(a, 4, 8, int(C::AppendFlag | C::PrependFlag | SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag))
- << Range(0, 0, 4, int(SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag)))
+ << Range(nullptr, 0, 4, int(SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag)))
<< Selection << 1 << 2 << int(VisibleFlag)
<< (RemoveList()
<< Remove(1, 1, 1, 1, 1, VisibleFlag | C::CacheFlag)
@@ -431,13 +431,13 @@ void tst_qqmllistcompositor::clearFlags_data()
<< IndexArray(visibleIndexes) << ListArray(visibleLists)
<< IndexArray(selectionIndexes) << ListArray(selectionLists);
} { static const int cacheIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,11,0,0,0,0};
- static const void *cacheLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,0,0,0,0};
+ static const void *cacheLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr,nullptr};
static const int defaultIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,11,0,0,0};
- static const void *defaultLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,0,0,0};
+ static const void *defaultLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr};
static const int visibleIndexes[] = {0,2,3,5,6,7,8,9,10,11,0,0,0};
- static const void *visibleLists[] = {a,a,a,a,a,a,a,a, a, a,0,0,0};
+ static const void *visibleLists[] = {a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr};
static const int selectionIndexes[] = {0,1,4,5,6,7,8,9,10,11,0,0,0};
- static const void *selectionLists[] = {a,a,a,a,a,a,a,a, a, a,0,0,0};
+ static const void *selectionLists[] = {a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr};
QTest::newRow("Default, 13, 1, Prepend | Selection | Visible | Default")
<< (RangeList()
<< Range(a, 0, 1, int(C::PrependFlag | SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag))
@@ -445,7 +445,7 @@ void tst_qqmllistcompositor::clearFlags_data()
<< Range(a, 2, 2, int(C::PrependFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag))
<< Range(a, 4, 1, int(C::PrependFlag | SelectionFlag | C::DefaultFlag | C::CacheFlag))
<< Range(a, 5, 7, int(C::AppendFlag | C::PrependFlag | SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag))
- << Range(0, 0, 4, int(SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag)))
+ << Range(nullptr, 0, 4, int(SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag)))
<< C::Default << 13 << 1 << int(C::PrependFlag | SelectionFlag | VisibleFlag | C::DefaultFlag)
<< (RemoveList()
<< Remove(11, 11, 13, 13, 1, SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag))
@@ -454,13 +454,13 @@ void tst_qqmllistcompositor::clearFlags_data()
<< IndexArray(visibleIndexes) << ListArray(visibleLists)
<< IndexArray(selectionIndexes) << ListArray(selectionLists);
} { static const int cacheIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,0};
- static const void *cacheLists[] = {a,a,a,a,a,a,a,a,a,a, a,0};
+ static const void *cacheLists[] = {a,a,a,a,a,a,a,a,a,a, a,nullptr};
static const int defaultIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,11,0,0,0};
- static const void *defaultLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,0,0,0};
+ static const void *defaultLists[] = {a,a,a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr};
static const int visibleIndexes[] = {0,2,3,5,6,7,8,9,10,11,0,0,0};
- static const void *visibleLists[] = {a,a,a,a,a,a,a,a, a, a,0,0,0};
+ static const void *visibleLists[] = {a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr};
static const int selectionIndexes[] = {0,1,4,5,6,7,8,9,10,11,0,0,0};
- static const void *selectionLists[] = {a,a,a,a,a,a,a,a, a, a,0,0,0};
+ static const void *selectionLists[] = {a,a,a,a,a,a,a,a, a, a,nullptr,nullptr,nullptr};
QTest::newRow("Cache, 11, 4, Cache")
<< (RangeList()
<< Range(a, 0, 1, int(C::PrependFlag | SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag))
@@ -468,8 +468,8 @@ void tst_qqmllistcompositor::clearFlags_data()
<< Range(a, 2, 2, int(C::PrependFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag))
<< Range(a, 4, 1, int(C::PrependFlag | SelectionFlag | C::DefaultFlag | C::CacheFlag))
<< Range(a, 5, 7, int(C::AppendFlag | C::PrependFlag | SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag))
- << Range(0, 0, 1, int(C::CacheFlag))
- << Range(0, 0, 3, int(SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag)))
+ << Range(nullptr, 0, 1, int(C::CacheFlag))
+ << Range(nullptr, 0, 3, int(SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag)))
<< C::Cache << 11 << 4 << int(C::CacheFlag)
<< (RemoveList())
<< IndexArray(cacheIndexes) << ListArray(cacheLists)
@@ -477,13 +477,13 @@ void tst_qqmllistcompositor::clearFlags_data()
<< IndexArray(visibleIndexes) << ListArray(visibleLists)
<< IndexArray(selectionIndexes) << ListArray(selectionLists);
} { static const int cacheIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,0};
- static const void *cacheLists[] = {a,a,a,a,a,a,a,a,a,a, a,0};
+ static const void *cacheLists[] = {a,a,a,a,a,a,a,a,a,a, a,nullptr};
static const int defaultIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,0};
- static const void *defaultLists[] = {a,a,a,a,a,a,a,a,a,a, a,0};
+ static const void *defaultLists[] = {a,a,a,a,a,a,a,a,a,a, a,nullptr};
static const int visibleIndexes[] = {0,2,3,5,6,7,8,9,10,0};
- static const void *visibleLists[] = {a,a,a,a,a,a,a,a, a,0};
+ static const void *visibleLists[] = {a,a,a,a,a,a,a,a, a,nullptr};
static const int selectionIndexes[] = {0,1,4,5,6,7,8,9,10,0};
- static const void *selectionLists[] = {a,a,a,a,a,a,a,a, a,0};
+ static const void *selectionLists[] = {a,a,a,a,a,a,a,a, a,nullptr};
QTest::newRow("Default, 11, 3, Default | Visible | Selection")
<< (RangeList()
<< Range(a, 0, 1, int(C::PrependFlag | SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag))
@@ -492,8 +492,8 @@ void tst_qqmllistcompositor::clearFlags_data()
<< Range(a, 4, 1, int(C::PrependFlag | SelectionFlag | C::DefaultFlag | C::CacheFlag))
<< Range(a, 5, 6, int(C::PrependFlag | SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag))
<< Range(a, 11, 1, int(C::AppendFlag | C::PrependFlag | SelectionFlag | VisibleFlag | C::DefaultFlag))
- << Range(0, 0, 2, int(SelectionFlag | VisibleFlag | C::DefaultFlag))
- << Range(0, 0, 1, int(SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag)))
+ << Range(nullptr, 0, 2, int(SelectionFlag | VisibleFlag | C::DefaultFlag))
+ << Range(nullptr, 0, 1, int(SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag)))
<< C::Default << 11 << 3 << int(C::DefaultFlag | VisibleFlag| SelectionFlag)
<< (RemoveList()
<< Remove(9, 9, 11, 11, 1, SelectionFlag | VisibleFlag | C::DefaultFlag)
@@ -584,13 +584,13 @@ void tst_qqmllistcompositor::setFlags_data()
int listA; void *a = &listA;
{ static const int cacheIndexes[] = {0,0,0,0};
- static const void *cacheLists[] = {0,0,0,0};
+ static const void *cacheLists[] = {nullptr,nullptr,nullptr,nullptr};
static const int defaultIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,11};
static const void *defaultLists[] = {a,a,a,a,a,a,a,a,a,a, a, a};
QTest::newRow("Default, 2, 2, Default")
<< (RangeList()
<< Range(a, 0, 12, C::DefaultFlag)
- << Range(0, 0, 4, C::CacheFlag))
+ << Range(nullptr, 0, 4, C::CacheFlag))
<< C::Default << 2 << 2 << int(C::DefaultFlag)
<< (InsertList())
<< IndexArray(cacheIndexes) << ListArray(cacheLists)
@@ -598,7 +598,7 @@ void tst_qqmllistcompositor::setFlags_data()
<< IndexArray() << ListArray()
<< IndexArray() << ListArray();
} { static const int cacheIndexes[] = {0,0,0,0};
- static const void *cacheLists[] = {0,0,0,0};
+ static const void *cacheLists[] = {nullptr,nullptr,nullptr,nullptr};
static const int defaultIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,11};
static const void *defaultLists[] = {a,a,a,a,a,a,a,a,a,a, a, a};
static const int visibleIndexes[] = {2,3};
@@ -606,7 +606,7 @@ void tst_qqmllistcompositor::setFlags_data()
QTest::newRow("Default, 2, 2, Visible")
<< (RangeList()
<< Range(a, 0, 12, C::DefaultFlag)
- << Range(0, 0, 4, C::CacheFlag))
+ << Range(nullptr, 0, 4, C::CacheFlag))
<< C::Default << 2 << 2 << int(VisibleFlag)
<< (InsertList()
<< Insert(0, 0, 2, 0, 2, VisibleFlag))
@@ -615,7 +615,7 @@ void tst_qqmllistcompositor::setFlags_data()
<< IndexArray(visibleIndexes) << ListArray(visibleLists)
<< IndexArray() << ListArray();
} { static const int cacheIndexes[] = {3,6,0,0,0,0};
- static const void *cacheLists[] = {a,a,0,0,0,0};
+ static const void *cacheLists[] = {a,a,nullptr,nullptr,nullptr,nullptr};
static const int defaultIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,11};
static const void *defaultLists[] = {a,a,a,a,a,a,a,a,a,a, a, a};
static const int visibleIndexes[] = {2,3,6,7};
@@ -629,7 +629,7 @@ void tst_qqmllistcompositor::setFlags_data()
<< Range(a, 4, 2, C::DefaultFlag)
<< Range(a, 6, 2, VisibleFlag | C::DefaultFlag)
<< Range(a, 8, 4, C::DefaultFlag)
- << Range(0, 0, 4, C::CacheFlag))
+ << Range(nullptr, 0, 4, C::CacheFlag))
<< Visible << 1 << 2 << int(SelectionFlag | C::CacheFlag)
<< (InsertList()
<< Insert(0, 1, 3, 0, 1, SelectionFlag | C::CacheFlag)
@@ -639,11 +639,11 @@ void tst_qqmllistcompositor::setFlags_data()
<< IndexArray(visibleIndexes) << ListArray(visibleLists)
<< IndexArray(selectionIndexes) << ListArray(selectionLists);
} { static const int cacheIndexes[] = {3,6,0,0,0,0};
- static const void *cacheLists[] = {a,a,0,0,0,0};
+ static const void *cacheLists[] = {a,a,nullptr,nullptr,nullptr,nullptr};
static const int defaultIndexes[] = {0,1,2,3,4,5,6,7,8,9,10,11};
static const void *defaultLists[] = {a,a,a,a,a,a,a,a,a,a, a, a};
static const int visibleIndexes[] = {2,3,6,7,0};
- static const void *visibleLists[] = {a,a,a,a,0};
+ static const void *visibleLists[] = {a,a,a,a,nullptr};
static const int selectionIndexes[] = {3,6};
static const void *selectionLists[] = {a,a};
QTest::newRow("Cache, 3, 1, Visible")
@@ -655,7 +655,7 @@ void tst_qqmllistcompositor::setFlags_data()
<< Range(a, 6, 1, SelectionFlag | VisibleFlag | C::DefaultFlag | C::CacheFlag)
<< Range(a, 7, 1, VisibleFlag | C::DefaultFlag)
<< Range(a, 8, 4, C::DefaultFlag)
- << Range(0, 0, 4, C::CacheFlag))
+ << Range(nullptr, 0, 4, C::CacheFlag))
<< C::Cache << 3 << 1 << int(VisibleFlag)
<< (InsertList()
<< Insert(2, 4, 12, 3, 1, VisibleFlag | C::CacheFlag))
@@ -770,14 +770,14 @@ void tst_qqmllistcompositor::move_data()
int listC; void *c = &listC;
{ static const int cacheIndexes[] = {0,0,0,0,2,3};
- static const void *cacheLists[] = {0,0,0,0,c,c};
+ static const void *cacheLists[] = {nullptr,nullptr,nullptr,nullptr,c,c};
static const int defaultIndexes[] = {0,0,1,2,3,4,5,0,1,2,3,4,5,1,2,3,0,1,2,3,4,5};
- static const void *defaultLists[] = {0,a,a,a,a,a,a,b,b,b,b,b,b,0,0,0,c,c,c,c,c,c};
+ static const void *defaultLists[] = {nullptr,a,a,a,a,a,a,b,b,b,b,b,b,nullptr,nullptr,nullptr,c,c,c,c,c,c};
QTest::newRow("15, 0, 1")
<< (RangeList()
<< Range(a, 0, 6, C::DefaultFlag)
<< Range(b, 0, 6, C::AppendFlag | C::PrependFlag | C::DefaultFlag)
- << Range(0, 0, 4, C::DefaultFlag | C::CacheFlag)
+ << Range(nullptr, 0, 4, C::DefaultFlag | C::CacheFlag)
<< Range(c, 0, 2, C::PrependFlag | C::DefaultFlag)
<< Range(c, 2, 2, C::PrependFlag | C::DefaultFlag | C::CacheFlag)
<< Range(c, 4, 2, C::AppendFlag | C::PrependFlag | C::DefaultFlag))
@@ -791,15 +791,15 @@ void tst_qqmllistcompositor::move_data()
<< IndexArray() << ListArray()
<< IndexArray() << ListArray();
} { static const int cacheIndexes[] = {0,0,0,0,2,3};
- static const void *cacheLists[] = {0,0,0,0,c,c};
+ static const void *cacheLists[] = {nullptr,nullptr,nullptr,nullptr,c,c};
static const int defaultIndexes[] = {0,1,0,1,2,3,4,5,0,1,2,3,4,5,2,3,0,1,2,3,4,5};
- static const void *defaultLists[] = {0,0,a,a,a,a,a,a,b,b,b,b,b,b,0,0,c,c,c,c,c,c};
+ static const void *defaultLists[] = {nullptr,nullptr,a,a,a,a,a,a,b,b,b,b,b,b,nullptr,nullptr,c,c,c,c,c,c};
QTest::newRow("15, 1, 1")
<< (RangeList()
- << Range(0, 0, 1, C::DefaultFlag | C::CacheFlag)
+ << Range(nullptr, 0, 1, C::DefaultFlag | C::CacheFlag)
<< Range(a, 0, 6, C::DefaultFlag)
<< Range(b, 0, 6, C::AppendFlag | C::PrependFlag | C::DefaultFlag)
- << Range(0, 0, 3, C::DefaultFlag | C::CacheFlag)
+ << Range(nullptr, 0, 3, C::DefaultFlag | C::CacheFlag)
<< Range(c, 0, 2, C::PrependFlag | C::DefaultFlag)
<< Range(c, 2, 2, C::PrependFlag | C::DefaultFlag | C::CacheFlag)
<< Range(c, 4, 2, C::AppendFlag | C::PrependFlag | C::DefaultFlag))
@@ -813,15 +813,15 @@ void tst_qqmllistcompositor::move_data()
<< IndexArray() << ListArray()
<< IndexArray() << ListArray();
} { static const int cacheIndexes[] = {0,0,0,0,2,3};
- static const void *cacheLists[] = {0,0,0,0,c,c};
+ static const void *cacheLists[] = {nullptr,nullptr,nullptr,nullptr,c,c};
static const int defaultIndexes[] = {0,1,2,0,1,3,4,5,0,1,2,3,4,5,2,3,0,1,2,3,4,5};
- static const void *defaultLists[] = {a,a,a,0,0,a,a,a,b,b,b,b,b,b,0,0,c,c,c,c,c,c};
+ static const void *defaultLists[] = {a,a,a,nullptr,nullptr,a,a,a,b,b,b,b,b,b,nullptr,nullptr,c,c,c,c,c,c};
QTest::newRow("0, 3, 2")
<< (RangeList()
- << Range(0, 0, 2, C::DefaultFlag | C::CacheFlag)
+ << Range(nullptr, 0, 2, C::DefaultFlag | C::CacheFlag)
<< Range(a, 0, 6, C::DefaultFlag)
<< Range(b, 0, 6, C::AppendFlag | C::PrependFlag | C::DefaultFlag)
- << Range(0, 0, 2, C::DefaultFlag | C::CacheFlag)
+ << Range(nullptr, 0, 2, C::DefaultFlag | C::CacheFlag)
<< Range(c, 0, 2, C::PrependFlag | C::DefaultFlag)
<< Range(c, 2, 2, C::PrependFlag | C::DefaultFlag | C::CacheFlag)
<< Range(c, 4, 2, C::AppendFlag | C::PrependFlag | C::DefaultFlag))
@@ -835,16 +835,16 @@ void tst_qqmllistcompositor::move_data()
<< IndexArray() << ListArray()
<< IndexArray() << ListArray();
} { static const int cacheIndexes[] = {0,0,0,0,2,3};
- static const void *cacheLists[] = {0,0,0,0,c,c};
+ static const void *cacheLists[] = {nullptr,nullptr,nullptr,nullptr,c,c};
static const int defaultIndexes[] = {0,5,0,1,2,3,4,5,0,1,0,1,2,2,3,3,4,1,2,3,4,5};
- static const void *defaultLists[] = {a,a,b,b,b,b,b,b,0,0,c,a,a,0,0,a,a,c,c,c,c,c};
+ static const void *defaultLists[] = {a,a,b,b,b,b,b,b,nullptr,nullptr,c,a,a,nullptr,nullptr,a,a,c,c,c,c,c};
QTest::newRow("7, 1, 10")
<< (RangeList()
<< Range(a, 0, 3, C::DefaultFlag)
- << Range(0, 0, 2, C::DefaultFlag | C::CacheFlag)
+ << Range(nullptr, 0, 2, C::DefaultFlag | C::CacheFlag)
<< Range(a, 3, 3, C::DefaultFlag)
<< Range(b, 0, 6, C::AppendFlag | C::PrependFlag | C::DefaultFlag)
- << Range(0, 0, 2, C::DefaultFlag | C::CacheFlag)
+ << Range(nullptr, 0, 2, C::DefaultFlag | C::CacheFlag)
<< Range(c, 0, 2, C::PrependFlag | C::DefaultFlag)
<< Range(c, 2, 2, C::PrependFlag | C::DefaultFlag | C::CacheFlag)
<< Range(c, 4, 2, C::AppendFlag | C::PrependFlag | C::DefaultFlag))
@@ -864,18 +864,18 @@ void tst_qqmllistcompositor::move_data()
<< IndexArray() << ListArray()
<< IndexArray() << ListArray();
} { static const int cacheIndexes[] = {0,0,0,0,3,2};
- static const void *cacheLists[] = {0,0,0,0,c,c};
+ static const void *cacheLists[] = {nullptr,nullptr,nullptr,nullptr,c,c};
static const int defaultIndexes[] = {0,5,0,1,2,3,4,5,0,1,0,1,2,2,3,3,4,3,4,5,1,2};
- static const void *defaultLists[] = {a,a,b,b,b,b,b,b,0,0,c,a,a,0,0,a,a,c,c,c,c,c};
+ static const void *defaultLists[] = {a,a,b,b,b,b,b,b,nullptr,nullptr,c,a,a,nullptr,nullptr,a,a,c,c,c,c,c};
QTest::newRow("17, 20, 2")
<< (RangeList()
<< Range(a, 0, 1, C::DefaultFlag)
<< Range(a, 5, 1, C::DefaultFlag)
<< Range(b, 0, 6, C::DefaultFlag)
- << Range(0, 0, 2, C::DefaultFlag | C::CacheFlag)
+ << Range(nullptr, 0, 2, C::DefaultFlag | C::CacheFlag)
<< Range(c, 0, 1, C::DefaultFlag)
<< Range(a, 1, 2, C::DefaultFlag)
- << Range(0, 0, 2, C::DefaultFlag | C::CacheFlag)
+ << Range(nullptr, 0, 2, C::DefaultFlag | C::CacheFlag)
<< Range(a, 3, 2, C::DefaultFlag)
<< Range(b, 0, 6, C::AppendFlag | C::PrependFlag)
<< Range(c, 0, 1, C::PrependFlag)
@@ -1072,7 +1072,7 @@ void tst_qqmllistcompositor::clear()
compositor.append(a, 0, 8, C::AppendFlag | C::PrependFlag | VisibleFlag | C::DefaultFlag);
compositor.append(b, 4, 5, VisibleFlag | C::DefaultFlag);
- compositor.append(0, 0, 3, VisibleFlag | C::DefaultFlag | C::CacheFlag);
+ compositor.append(nullptr, 0, 3, VisibleFlag | C::DefaultFlag | C::CacheFlag);
QCOMPARE(compositor.count(C::Default), 16);
QCOMPARE(compositor.count(Visible), 16);
diff --git a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
index 1fbca26a66..4618ea4071 100644
--- a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
+++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
@@ -49,7 +49,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();
}
@@ -132,7 +132,7 @@ bool tst_qqmllistmodel::compareVariantList(const QVariantList &testList, QVarian
bool allOk = true;
QQmlListModel *model = qobject_cast<QQmlListModel *>(object.value<QObject *>());
- if (model == 0)
+ if (model == nullptr)
return false;
if (model->count() != testList.count())
@@ -255,7 +255,7 @@ void tst_qqmllistmodel::static_types()
QVERIFY(!component.isError());
QObject *obj = component.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
if (error.isEmpty()) {
QVariant actual = obj->property("test");
@@ -326,7 +326,7 @@ void tst_qqmllistmodel::static_i18n()
QVERIFY(!component.isError());
QObject *obj = component.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QVariant actual = obj->property("test");
@@ -375,7 +375,7 @@ void tst_qqmllistmodel::dynamic_i18n()
QVERIFY(!component.isError());
QObject *obj = component.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QVariant actual = obj->property("test");
@@ -413,7 +413,7 @@ void tst_qqmllistmodel::static_nestedElements()
component.setData(componentStr.toUtf8(), QUrl::fromLocalFile(""));
QObject *obj = component.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QVariant count = obj->property("count");
QCOMPARE(count.type(), QVariant::Int);
@@ -613,7 +613,7 @@ void tst_qqmllistmodel::enumerate()
QQmlComponent component(&eng, testFileUrl("enumerate.qml"));
QVERIFY(!component.isError());
QQuickItem *item = qobject_cast<QQuickItem*>(component.create());
- QVERIFY(item != 0);
+ QVERIFY(item != nullptr);
QLatin1String expectedStrings[] = {
QLatin1String("val1=1Y"),
@@ -958,9 +958,9 @@ void tst_qqmllistmodel::crash_model_with_multiple_roles()
QQmlComponent component(&eng, testFileUrl("multipleroles.qml"));
QObject *rootItem = component.create();
QVERIFY(component.errorString().isEmpty());
- QVERIFY(rootItem != 0);
+ QVERIFY(rootItem != nullptr);
QQmlListModel *model = rootItem->findChild<QQmlListModel*>("listModel");
- QVERIFY(model != 0);
+ QVERIFY(model != nullptr);
// used to cause a crash
model->setProperty(0, "black", true);
@@ -974,9 +974,9 @@ void tst_qqmllistmodel::crash_model_with_unknown_roles()
QQmlComponent component(&eng, testFileUrl("multipleroles.qml"));
QScopedPointer<QObject> rootItem(component.create());
QVERIFY(component.errorString().isEmpty());
- QVERIFY(rootItem != 0);
+ QVERIFY(rootItem != nullptr);
QQmlListModel *model = rootItem->findChild<QQmlListModel*>("listModel");
- QVERIFY(model != 0);
+ QVERIFY(model != nullptr);
// used to cause a crash in debug builds
model->index(0, 0, QModelIndex()).data(Qt::DisplayRole);
@@ -990,7 +990,7 @@ void tst_qqmllistmodel::set_model_cache()
QQmlComponent component(&eng, testFileUrl("setmodelcachelist.qml"));
QObject *model = component.create();
QVERIFY2(component.errorString().isEmpty(), QTest::toString(component.errorString()));
- QVERIFY(model != 0);
+ QVERIFY(model != nullptr);
QVERIFY(model->property("ok").toBool());
delete model;
@@ -1188,10 +1188,10 @@ void tst_qqmllistmodel::signal_handlers()
QQmlComponent component(&eng, testFileUrl("signalhandlers.qml"));
QObject *model = component.create();
QQmlListModel *lm = qobject_cast<QQmlListModel *>(model);
- QVERIFY(lm != 0);
+ QVERIFY(lm != nullptr);
lm->setDynamicRoles(dynamicRoles);
QVERIFY2(component.errorString().isEmpty(), QTest::toString(component.errorString()));
- QVERIFY(model != 0);
+ QVERIFY(model != nullptr);
QVERIFY(model->property("ok").toBool());
delete model;
@@ -1275,7 +1275,7 @@ void tst_qqmllistmodel::empty_element_warning()
QVERIFY(!component.isError());
QObject *obj = component.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
delete obj;
}
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);
diff --git a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
index 5c16a48378..199f7bc7e4 100644
--- a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
+++ b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
@@ -115,7 +115,7 @@ void tst_qqmllistreference::qmllistreference_invalid()
QVERIFY(!r.canAt());
QVERIFY(!r.canClear());
QVERIFY(!r.canCount());
- QVERIFY(!r.append(0));
+ QVERIFY(!r.append(nullptr));
QVERIFY(!r.at(10));
QVERIFY(!r.clear());
QCOMPARE(r.count(), 0);
@@ -132,7 +132,7 @@ void tst_qqmllistreference::qmllistreference_invalid()
QVERIFY(!r.canAt());
QVERIFY(!r.canClear());
QVERIFY(!r.canCount());
- QVERIFY(!r.append(0));
+ QVERIFY(!r.append(nullptr));
QVERIFY(!r.at(10));
QVERIFY(!r.clear());
QCOMPARE(r.count(), 0);
@@ -149,7 +149,7 @@ void tst_qqmllistreference::qmllistreference_invalid()
QVERIFY(!r.canAt());
QVERIFY(!r.canClear());
QVERIFY(!r.canCount());
- QVERIFY(!r.append(0));
+ QVERIFY(!r.append(nullptr));
QVERIFY(!r.at(10));
QVERIFY(!r.clear());
QCOMPARE(r.count(), 0);
@@ -247,7 +247,7 @@ void tst_qqmllistreference::canAppend()
{
TestType tt;
- tt.property.append = 0;
+ tt.property.append = nullptr;
QQmlListReference ref(&tt, "data");
QVERIFY(!ref.canAppend());
}
@@ -276,7 +276,7 @@ void tst_qqmllistreference::canAt()
{
TestType tt;
- tt.property.at = 0;
+ tt.property.at = nullptr;
QQmlListReference ref(&tt, "data");
QVERIFY(!ref.canAt());
}
@@ -305,7 +305,7 @@ void tst_qqmllistreference::canClear()
{
TestType tt;
- tt.property.clear = 0;
+ tt.property.clear = nullptr;
QQmlListReference ref(&tt, "data");
QVERIFY(!ref.canClear());
}
@@ -334,7 +334,7 @@ void tst_qqmllistreference::canCount()
{
TestType tt;
- tt.property.count = 0;
+ tt.property.count = nullptr;
QQmlListReference ref(&tt, "data");
QVERIFY(!ref.canCount());
}
@@ -363,7 +363,7 @@ void tst_qqmllistreference::isReadable()
{
TestType tt;
- tt.property.count = 0;
+ tt.property.count = nullptr;
QQmlListReference ref(&tt, "data");
QVERIFY(!ref.isReadable());
}
@@ -392,7 +392,7 @@ void tst_qqmllistreference::isManipulable()
{
TestType tt;
- tt.property.count = 0;
+ tt.property.count = nullptr;
QQmlListReference ref(&tt, "data");
QVERIFY(!ref.isManipulable());
}
@@ -421,17 +421,17 @@ void tst_qqmllistreference::append()
QVERIFY(!ref.append(&object));
QCOMPARE(tt->data.count(), 1);
QCOMPARE(tt->data.at(0), tt);
- QVERIFY(ref.append(0));
+ QVERIFY(ref.append(nullptr));
QCOMPARE(tt->data.count(), 2);
QCOMPARE(tt->data.at(0), tt);
QVERIFY(!tt->data.at(1));
delete tt;
- QVERIFY(!ref.append(0));
+ QVERIFY(!ref.append(nullptr));
}
{
TestType tt;
- tt.property.append = 0;
+ tt.property.append = nullptr;
QQmlListReference ref(&tt, "data");
QVERIFY(!ref.append(&tt));
}
@@ -466,7 +466,7 @@ void tst_qqmllistreference::at()
{
TestType tt;
tt.data.append(&tt);
- tt.property.at = 0;
+ tt.property.at = nullptr;
QQmlListReference ref(&tt, "data");
QVERIFY(!ref.at(0));
}
@@ -499,7 +499,7 @@ void tst_qqmllistreference::clear()
{
TestType tt;
- tt.property.clear = 0;
+ tt.property.clear = nullptr;
QQmlListReference ref(&tt, "data");
QVERIFY(!ref.clear());
}
@@ -534,7 +534,7 @@ void tst_qqmllistreference::count()
{
TestType tt;
tt.data.append(&tt);
- tt.property.count = 0;
+ tt.property.count = nullptr;
QQmlListReference ref(&tt, "data");
QCOMPARE(ref.count(), 0);
}
@@ -626,17 +626,17 @@ void tst_qqmllistreference::listProperty()
QQmlComponent component(&engine, testFileUrl("propertyList.qml"));
QScopedPointer<QObject> object( component.create() );
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE( object->property("state").toString(), QStringLiteral("MyState2") );
QQmlListReference list( object.data(), "states");
QCOMPARE( list.count(), 2 );
QQuickState* state1 = dynamic_cast<QQuickState*>( list.at( 0 ) );
- QVERIFY(state1 != 0);
+ QVERIFY(state1 != nullptr);
QCOMPARE( state1->name(), QStringLiteral("MyState1") );
QQuickState* state2 = dynamic_cast<QQuickState*>( list.at( 1 ) );
- QVERIFY(state2 != 0);
+ QVERIFY(state2 != nullptr);
QCOMPARE( state2->name(), QStringLiteral("MyState2") );
}
diff --git a/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp b/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
index 4f4deaafe5..c2c2413c98 100644
--- a/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
+++ b/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
@@ -152,7 +152,7 @@ void tst_qqmllocale::addPropertyData(const QString &l)
LOCALE_PROP(QString,exponential),
LOCALE_PROP(int,measurementSystem),
LOCALE_PROP(int,textDirection),
- { 0, QVariant() }
+ { nullptr, QVariant() }
};
int i = 0;
@@ -663,7 +663,7 @@ void tst_qqmllocale::addDateTimeFormatData(const QString &l)
"h:m:sap ddd MMMM d yy",
"'The date and time is: 'H:mm:ss:zzz dd/MM/yy",
"MMM d yyyy HH:mm t",
- 0
+ nullptr
};
QByteArray locale = l.toLatin1();
int i = 0;
@@ -751,7 +751,7 @@ void tst_qqmllocale::addDateFormatData(const QString &l)
"ddd MMMM d yy",
"'The date is: 'dd/MM/yy",
"MMM d yyyy",
- 0
+ nullptr
};
QByteArray locale = l.toLatin1();
int i = 0;
@@ -839,7 +839,7 @@ void tst_qqmllocale::addTimeFormatData(const QString &l)
"h:m:sap",
"'The time is: 'H:mm:ss:zzz",
"HH:mm t",
- 0
+ nullptr
};
QByteArray locale = l.toLatin1();
int i = 0;
diff --git a/tests/auto/qml/qqmlmetaobject/tst_qqmlmetaobject.cpp b/tests/auto/qml/qqmlmetaobject/tst_qqmlmetaobject.cpp
index 9467af6754..ea157a7d15 100644
--- a/tests/auto/qml/qqmlmetaobject/tst_qqmlmetaobject.cpp
+++ b/tests/auto/qml/qqmlmetaobject/tst_qqmlmetaobject.cpp
@@ -186,10 +186,10 @@ void tst_QQmlMetaObject::property()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl(testFile));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
const QMetaObject *mo = object->metaObject();
- QVERIFY(mo->superClass() != 0);
+ QVERIFY(mo->superClass() != nullptr);
QVERIFY(QByteArray(mo->className()).contains("_QML_"));
QCOMPARE(mo->propertyOffset(), mo->superClass()->propertyCount());
QCOMPARE(mo->propertyCount(), mo->superClass()->propertyCount() + 1);
@@ -361,10 +361,10 @@ void tst_QQmlMetaObject::method()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl(testFile));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
const QMetaObject *mo = object->metaObject();
- QVERIFY(mo->superClass() != 0);
+ QVERIFY(mo->superClass() != nullptr);
QVERIFY(QByteArray(mo->className()).contains("_QML_"));
QCOMPARE(mo->methodOffset(), mo->superClass()->methodCount());
QCOMPARE(mo->methodCount(), mo->superClass()->methodCount() + 1);
diff --git a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
index 58361b4b12..ff3361ff82 100644
--- a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
+++ b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
@@ -271,7 +271,7 @@ void tst_qqmlmetatype::defaultObject()
TestType t;
ParserStatusTestType p;
- QVERIFY(QQmlMetaType::defaultProperty((QObject *)0).name() == 0);
+ QVERIFY(QQmlMetaType::defaultProperty((QObject *)nullptr).name() == nullptr);
QVERIFY(!QQmlMetaType::defaultProperty(&o).name());
QVERIFY(!QQmlMetaType::defaultProperty(&p).name());
QCOMPARE(QString(QQmlMetaType::defaultProperty(&t).name()), QString("foo"));
diff --git a/tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/plugin.cpp
index fa9782f8c2..b44bc58373 100644
--- a/tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/plugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/invalidFirstCommandModule/plugin.cpp
@@ -34,7 +34,7 @@ class MyPluginType : public QObject
{
Q_OBJECT
public:
- MyPluginType(QObject *parent=0) : QObject(parent) {}
+ MyPluginType(QObject *parent=nullptr) : QObject(parent) {}
};
diff --git a/tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/plugin.cpp
index fe01507412..ccd1066a36 100644
--- a/tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/plugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/invalidNamespaceModule/plugin.cpp
@@ -34,7 +34,7 @@ class MyPluginType : public QObject
{
Q_OBJECT
public:
- MyPluginType(QObject *parent=0) : QObject(parent) {}
+ MyPluginType(QObject *parent=nullptr) : QObject(parent) {}
};
diff --git a/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp b/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp
index 92d30351a7..610710fbf8 100644
--- a/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp
@@ -36,7 +36,7 @@ class MyPluginType : public QObject
Q_PROPERTY(QString value READ value)
public:
- MyPluginType(QObject *parent=0) : QObject(parent) {}
+ MyPluginType(QObject *parent=nullptr) : QObject(parent) {}
QString value() const { return "Hello"; }
};
@@ -47,7 +47,7 @@ class MyNestedPluginType : public QObject
Q_PROPERTY(QString value READ value)
public:
- MyNestedPluginType(QObject *parent=0) : QObject(parent) {}
+ MyNestedPluginType(QObject *parent=nullptr) : QObject(parent) {}
QString value() const { return "Goodbye"; }
};
diff --git a/tests/auto/qml/qqmlmoduleplugin/nonstrictModule/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/nonstrictModule/plugin.cpp
index 5fc05b91bd..4c2109e02a 100644
--- a/tests/auto/qml/qqmlmoduleplugin/nonstrictModule/plugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/nonstrictModule/plugin.cpp
@@ -34,7 +34,7 @@ class MyPluginType : public QObject
{
Q_OBJECT
public:
- MyPluginType(QObject *parent=0) : QObject(parent) {}
+ MyPluginType(QObject *parent=nullptr) : QObject(parent) {}
};
diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/childplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/childplugin.cpp
index 515d56a3c4..cb8c395fdf 100644
--- a/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/childplugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/childplugin/childplugin.cpp
@@ -37,7 +37,7 @@ class MyChildPluginType : public QObject
Q_PROPERTY(int valueOnlyIn2 READ value WRITE setValue)
public:
- MyChildPluginType(QObject *parent=0) : QObject(parent)
+ MyChildPluginType(QObject *parent=nullptr) : QObject(parent)
{
qWarning("child import2.1 worked");
}
diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/plugin.cpp
index 6cae5254bc..ced7e0895d 100644
--- a/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/plugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2.1/plugin.cpp
@@ -37,7 +37,7 @@ class MyPluginType : public QObject
Q_PROPERTY(int valueOnlyIn2 READ value WRITE setValue)
public:
- MyPluginType(QObject *parent=0) : QObject(parent)
+ MyPluginType(QObject *parent=nullptr) : QObject(parent)
{
qWarning("import2.1 worked");
}
diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2.2/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/plugin.2.2/plugin.cpp
index ecec870374..67cfc2a579 100644
--- a/tests/auto/qml/qqmlmoduleplugin/plugin.2.2/plugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2.2/plugin.cpp
@@ -37,7 +37,7 @@ class MyPluginType : public QObject
Q_PROPERTY(int valueOnlyIn2 READ value WRITE setValue)
public:
- MyPluginType(QObject *parent=0) : QObject(parent)
+ MyPluginType(QObject *parent=nullptr) : QObject(parent)
{
qWarning("import2.2 worked");
}
diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/childplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/childplugin.cpp
index 56545cfa3c..7b8f2a96be 100644
--- a/tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/childplugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2/childplugin/childplugin.cpp
@@ -37,7 +37,7 @@ class MyChildPluginType : public QObject
Q_PROPERTY(int valueOnlyIn2 READ value WRITE setValue)
public:
- MyChildPluginType(QObject *parent=0) : QObject(parent)
+ MyChildPluginType(QObject *parent=nullptr) : QObject(parent)
{
qWarning("child import2 worked");
}
diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin.2/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/plugin.2/plugin.cpp
index 49a2a747a4..8a4598e3bf 100644
--- a/tests/auto/qml/qqmlmoduleplugin/plugin.2/plugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/plugin.2/plugin.cpp
@@ -37,7 +37,7 @@ class MyPluginType : public QObject
Q_PROPERTY(int valueOnlyIn2 READ value WRITE setValue)
public:
- MyPluginType(QObject *parent=0) : QObject(parent)
+ MyPluginType(QObject *parent=nullptr) : QObject(parent)
{
qWarning("import2 worked");
}
diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/childplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/childplugin.cpp
index 28490d3d98..6a2deca1df 100644
--- a/tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/childplugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/plugin/childplugin/childplugin.cpp
@@ -36,7 +36,7 @@ class MyChildPluginType : public QObject
Q_PROPERTY(int value READ value WRITE setValue)
public:
- MyChildPluginType(QObject *parent=0) : QObject(parent)
+ MyChildPluginType(QObject *parent=nullptr) : QObject(parent)
{
qWarning("child import worked");
}
diff --git a/tests/auto/qml/qqmlmoduleplugin/plugin/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/plugin/plugin.cpp
index db51185de6..5e39966a2a 100644
--- a/tests/auto/qml/qqmlmoduleplugin/plugin/plugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/plugin/plugin.cpp
@@ -36,7 +36,7 @@ class MyPluginType : public QObject
Q_PROPERTY(int value READ value WRITE setValue)
public:
- MyPluginType(QObject *parent=0) : QObject(parent)
+ MyPluginType(QObject *parent=nullptr) : QObject(parent)
{
qWarning("import worked");
}
diff --git a/tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/plugin.cpp
index 7669d65568..5c3c1b81c6 100644
--- a/tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/plugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/plugin.cpp
@@ -36,7 +36,7 @@ class MyPluginType : public QObject
Q_PROPERTY(int value READ value WRITE setValue)
public:
- MyPluginType(QObject *parent=0) : QObject(parent)
+ MyPluginType(QObject *parent=nullptr) : QObject(parent)
{
qWarning("import worked");
}
diff --git a/tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/plugin.cpp
index 92211ebf9d..0780ea8325 100644
--- a/tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/plugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/preemptedStrictModule/plugin.cpp
@@ -34,7 +34,7 @@ class MyPluginType : public QObject
{
Q_OBJECT
public:
- MyPluginType(QObject *parent=0) : QObject(parent) {}
+ MyPluginType(QObject *parent=nullptr) : QObject(parent) {}
};
diff --git a/tests/auto/qml/qqmlmoduleplugin/preemptiveModule/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/preemptiveModule/plugin.cpp
index 3df3e9cc81..bc896716e2 100644
--- a/tests/auto/qml/qqmlmoduleplugin/preemptiveModule/plugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/preemptiveModule/plugin.cpp
@@ -34,7 +34,7 @@ class MyPluginType : public QObject
{
Q_OBJECT
public:
- MyPluginType(QObject *parent=0) : QObject(parent) {}
+ MyPluginType(QObject *parent=nullptr) : QObject(parent) {}
};
diff --git a/tests/auto/qml/qqmlmoduleplugin/protectedModule/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/protectedModule/plugin.cpp
index afdeea80f4..ae8c231aab 100644
--- a/tests/auto/qml/qqmlmoduleplugin/protectedModule/plugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/protectedModule/plugin.cpp
@@ -33,7 +33,7 @@ class MyPluginType : public QObject
{
Q_OBJECT
public:
- MyPluginType(QObject *parent=0) : QObject(parent) {}
+ MyPluginType(QObject *parent=nullptr) : QObject(parent) {}
};
diff --git a/tests/auto/qml/qqmlmoduleplugin/strictModule.2/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/strictModule.2/plugin.cpp
index 4f5176ae62..312ed325b1 100644
--- a/tests/auto/qml/qqmlmoduleplugin/strictModule.2/plugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/strictModule.2/plugin.cpp
@@ -34,7 +34,7 @@ class MyPluginType : public QObject
{
Q_OBJECT
public:
- MyPluginType(QObject *parent=0) : QObject(parent) {}
+ MyPluginType(QObject *parent=nullptr) : QObject(parent) {}
};
diff --git a/tests/auto/qml/qqmlmoduleplugin/strictModule/plugin.cpp b/tests/auto/qml/qqmlmoduleplugin/strictModule/plugin.cpp
index eaa9aeb1d0..a622078159 100644
--- a/tests/auto/qml/qqmlmoduleplugin/strictModule/plugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/strictModule/plugin.cpp
@@ -34,7 +34,7 @@ class MyPluginType : public QObject
{
Q_OBJECT
public:
- MyPluginType(QObject *parent=0) : QObject(parent) {}
+ MyPluginType(QObject *parent=nullptr) : QObject(parent) {}
};
diff --git a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp
index 85e4918b61..fac3ff15fd 100644
--- a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp
@@ -217,7 +217,7 @@ void tst_qqmlmoduleplugin::importsPlugin()
qWarning() << err;
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("value").toInt(),123);
delete object;
}
@@ -285,7 +285,7 @@ void tst_qqmlmoduleplugin::importPluginWithQmlFile()
qWarning() << err;
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
}
@@ -301,7 +301,7 @@ void tst_qqmlmoduleplugin::remoteImportWithQuotedUrl()
QTRY_COMPARE(component.status(), QQmlComponent::Ready);
QObject *object = component.create();
QCOMPARE(object->property("width").toInt(), 300);
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
delete object;
foreach (QQmlError err, component.errors())
@@ -323,7 +323,7 @@ void tst_qqmlmoduleplugin::remoteImportWithUnquotedUri()
QTRY_COMPARE(component.status(), QQmlComponent::Ready);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("width").toInt(), 300);
delete object;
@@ -345,7 +345,7 @@ void tst_qqmlmoduleplugin::importsMixedQmlCppPlugin()
QQmlComponent component(&engine, testFileUrl(QStringLiteral("importsMixedQmlCppPlugin.qml")));
QObject *o = component.create();
- QVERIFY2(o != 0, QQmlDataTest::msgComponentError(component, &engine));
+ QVERIFY2(o != nullptr, QQmlDataTest::msgComponentError(component, &engine));
QCOMPARE(o->property("test").toBool(), true);
delete o;
}
@@ -354,7 +354,7 @@ void tst_qqmlmoduleplugin::importsMixedQmlCppPlugin()
QQmlComponent component(&engine, testFileUrl(QStringLiteral("importsMixedQmlCppPlugin.2.qml")));
QObject *o = component.create();
- QVERIFY2(o != 0, QQmlDataTest::msgComponentError(component, &engine));
+ QVERIFY2(o != nullptr, QQmlDataTest::msgComponentError(component, &engine));
QCOMPARE(o->property("test").toBool(), true);
QCOMPARE(o->property("test2").toBool(), true);
delete o;
@@ -482,7 +482,7 @@ void tst_qqmlmoduleplugin::importLocalModule()
component.setData(qml.toUtf8(), testFileUrl("empty.qml"));
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("majorVersion").value<int>(), majorVersion);
QCOMPARE(object->property("minorVersion").value<int>(), minorVersion);
}
@@ -539,7 +539,7 @@ void tst_qqmlmoduleplugin::importStrictModule()
if (error.isEmpty()) {
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
} else {
QVERIFY(!component.isReady());
QCOMPARE(component.errors().count(), 1);
@@ -623,7 +623,7 @@ void tst_qqmlmoduleplugin::importProtectedModule()
//If plugin is loaded due to import, should assert
QScopedPointer<QObject> object(component.create());
//qDebug() << component.errorString();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
}
void tst_qqmlmoduleplugin::importVersionedModule()
@@ -664,7 +664,7 @@ void tst_qqmlmoduleplugin::importsChildPlugin()
qWarning() << err;
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("value").toInt(),123);
delete object;
}
@@ -681,7 +681,7 @@ void tst_qqmlmoduleplugin::importsChildPlugin2()
qWarning() << err;
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("value").toInt(),123);
delete object;
}
@@ -698,7 +698,7 @@ void tst_qqmlmoduleplugin::importsChildPlugin21()
qWarning() << err;
VERIFY_ERRORS(0);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("value").toInt(),123);
delete object;
}
diff --git a/tests/auto/qml/qqmlnotifier/tst_qqmlnotifier.cpp b/tests/auto/qml/qqmlnotifier/tst_qqmlnotifier.cpp
index 88a5d41975..381ae98195 100644
--- a/tests/auto/qml/qqmlnotifier/tst_qqmlnotifier.cpp
+++ b/tests/auto/qml/qqmlnotifier/tst_qqmlnotifier.cpp
@@ -142,7 +142,7 @@ class tst_qqmlnotifier : public QQmlDataTest
Q_OBJECT
public:
tst_qqmlnotifier()
- : root(0), exportedClass(0), exportedObject(0)
+ : root(nullptr), exportedClass(nullptr), exportedObject(nullptr)
{}
private slots:
@@ -180,28 +180,28 @@ void tst_qqmlnotifier::initTestCase()
void tst_qqmlnotifier::createObjects()
{
delete root;
- root = 0;
- exportedClass = exportedObject = 0;
+ root = nullptr;
+ exportedClass = exportedObject = nullptr;
QQmlComponent component(&engine, testFileUrl("connectnotify.qml"));
exportedObject = new ExportedClass();
exportedObject->setObjectName("exportedObject");
engine.rootContext()->setContextProperty("_exportedObject", exportedObject);
root = component.create();
- QVERIFY(root != 0);
+ QVERIFY(root != nullptr);
exportedClass = qobject_cast<ExportedClass *>(
root->findChild<ExportedClass*>("exportedClass"));
- QVERIFY(exportedClass != 0);
+ QVERIFY(exportedClass != nullptr);
exportedClass->verifyReceiverCount();
}
void tst_qqmlnotifier::cleanupTestCase()
{
delete root;
- root = 0;
+ root = nullptr;
delete exportedObject;
- exportedObject = 0;
+ exportedObject = nullptr;
}
void tst_qqmlnotifier::testConnectNotify()
@@ -303,7 +303,7 @@ void tst_qqmlnotifier::disconnectOnDestroy()
// Deleting a QML object should remove all connections. For exportedClass, this is tested in
// the destructor, and for exportedObject, it is tested below.
delete root;
- root = 0;
+ root = nullptr;
QCOMPARE(exportedObject->cppObjectPropConnections, 0);
exportedObject->verifyReceiverCount();
}
diff --git a/tests/auto/qml/qqmlopenmetaobject/tst_qqmlopenmetaobject.cpp b/tests/auto/qml/qqmlopenmetaobject/tst_qqmlopenmetaobject.cpp
index c3ace5e0f3..7fd4d69b5e 100644
--- a/tests/auto/qml/qqmlopenmetaobject/tst_qqmlopenmetaobject.cpp
+++ b/tests/auto/qml/qqmlopenmetaobject/tst_qqmlopenmetaobject.cpp
@@ -44,7 +44,7 @@ class CustomObject: public QObject
{
Q_OBJECT
public:
- CustomObject(QObject *parent = 0)
+ CustomObject(QObject *parent = nullptr)
: QObject(parent) {}
};
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);
diff --git a/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp b/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp
index ac1b76b9d2..b9e56b39a2 100644
--- a/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp
+++ b/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp
@@ -61,7 +61,7 @@ class BaseObject : public QObject
Q_PROPERTY(int propertyA READ propertyA NOTIFY propertyAChanged)
Q_PROPERTY(QString propertyB READ propertyB NOTIFY propertyBChanged)
public:
- BaseObject(QObject *parent = 0) : QObject(parent) {}
+ BaseObject(QObject *parent = nullptr) : QObject(parent) {}
int propertyA() const { return 0; }
QString propertyB() const { return QString(); }
@@ -81,7 +81,7 @@ class DerivedObject : public BaseObject
Q_PROPERTY(int propertyC READ propertyC NOTIFY propertyCChanged)
Q_PROPERTY(QString propertyD READ propertyD NOTIFY propertyDChanged)
public:
- DerivedObject(QObject *parent = 0) : BaseObject(parent) {}
+ DerivedObject(QObject *parent = nullptr) : BaseObject(parent) {}
int propertyC() const { return 0; }
QString propertyD() const { return QString(); }
@@ -97,7 +97,7 @@ Q_SIGNALS:
QQmlPropertyData *cacheProperty(QQmlPropertyCache *cache, const char *name)
{
- return cache->property(QLatin1String(name), 0, 0);
+ return cache->property(QLatin1String(name), nullptr, nullptr);
}
void tst_qqmlpropertycache::properties()
diff --git a/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp b/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp
index b8ea98df2b..62a8cd117d 100644
--- a/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp
+++ b/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp
@@ -71,7 +71,7 @@ class LazyPropertyMap : public QQmlPropertyMap, public QQmlParserStatus
Q_PROPERTY(int someFixedProperty READ someFixedProperty WRITE setSomeFixedProperty NOTIFY someFixedPropertyChanged)
public:
LazyPropertyMap()
- : QQmlPropertyMap(this, /*parent*/0)
+ : QQmlPropertyMap(this, /*parent*/nullptr)
, value(0)
{}
@@ -313,7 +313,7 @@ class MyEnhancedPropertyMap : public QQmlPropertyMap
{
Q_OBJECT
public:
- MyEnhancedPropertyMap() : QQmlPropertyMap(this, 0), m_testSlotCalled(false) {}
+ MyEnhancedPropertyMap() : QQmlPropertyMap(this, nullptr), m_testSlotCalled(false) {}
bool testSlotCalled() const { return m_testSlotCalled; }
signals:
diff --git a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
index 0bc1127069..b96eecafe8 100644
--- a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
+++ b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
@@ -168,7 +168,7 @@ void tst_qqmlqt::enums()
{
QQmlComponent component(&engine, testFileUrl("enums.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1").toInt(), (int)Qt::Key_Escape);
QCOMPARE(object->property("test2").toInt(), (int)Qt::DescendingOrder);
@@ -188,7 +188,7 @@ void tst_qqmlqt::rgba()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(1, 0, 0, 0.8));
@@ -211,7 +211,7 @@ void tst_qqmlqt::hsla()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromHslF(1, 0, 0, 0.8));
QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor::fromHslF(1, 0.5, 0.3, 1));
@@ -233,7 +233,7 @@ void tst_qqmlqt::hsva()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromHsvF(1, 0, 0, 0.8));
QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor::fromHsvF(1, 0.5, 0.3, 1));
@@ -261,7 +261,7 @@ void tst_qqmlqt::colorEqual()
QTest::ignoreMessage(QtWarningMsg, qPrintable(component.url().toString() + ":35: Error: Qt.colorEqual(): Invalid color name"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1a").toBool(), false);
QCOMPARE(object->property("test1b").toBool(), false);
@@ -338,7 +338,7 @@ void tst_qqmlqt::rect()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QRectF>(object->property("test1")), QRectF(10, 13, 100, 109));
QCOMPARE(qvariant_cast<QRectF>(object->property("test2")), QRectF(-10, 13, 100, 109.6));
@@ -359,7 +359,7 @@ void tst_qqmlqt::point()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QPointF>(object->property("test1")), QPointF(19, 34));
QCOMPARE(qvariant_cast<QPointF>(object->property("test2")), QPointF(-3, 109.2));
@@ -379,7 +379,7 @@ void tst_qqmlqt::size()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QSizeF>(object->property("test1")), QSizeF(19, 34));
QCOMPARE(qvariant_cast<QSizeF>(object->property("test2")), QSizeF(3, 109.2));
@@ -400,7 +400,7 @@ void tst_qqmlqt::vector2d()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QVector2D>(object->property("test1")), QVector2D(1, 0.9f));
QCOMPARE(qvariant_cast<QVector2D>(object->property("test2")), QVector2D(102, -982.1f));
@@ -420,7 +420,7 @@ void tst_qqmlqt::vector3d()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QVector3D>(object->property("test1")), QVector3D(1, 0, 0.9f));
QCOMPARE(qvariant_cast<QVector3D>(object->property("test2")), QVector3D(102, -10, -982.1f));
@@ -440,7 +440,7 @@ void tst_qqmlqt::vector4d()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QVector4D>(object->property("test1")), QVector4D(1, 0, 0.9f, 0.6f));
QCOMPARE(qvariant_cast<QVector4D>(object->property("test2")), QVector4D(102, -10, -982.1f, 10));
@@ -460,7 +460,7 @@ void tst_qqmlqt::quaternion()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QQuaternion>(object->property("test1")), QQuaternion(2, 17, 0.9f, 0.6f));
QCOMPARE(qvariant_cast<QQuaternion>(object->property("test2")), QQuaternion(102, -10, -982.1f, 10));
@@ -482,7 +482,7 @@ void tst_qqmlqt::matrix4x4()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning3));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QMatrix4x4>(object->property("test1")), QMatrix4x4(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16));
QCOMPARE(qvariant_cast<QMatrix4x4>(object->property("test2")), QMatrix4x4(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4));
@@ -503,7 +503,7 @@ void tst_qqmlqt::font()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QFont>(object->property("test1")), QFont("Arial", 22));
QCOMPARE(qvariant_cast<QFont>(object->property("test2")), QFont("Arial", 20, QFont::DemiBold, true));
@@ -523,7 +523,7 @@ void tst_qqmlqt::lighter()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(1, 0.8, 0.3).lighter());
QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor());
@@ -545,7 +545,7 @@ void tst_qqmlqt::darker()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(1, 0.8, 0.3).darker());
QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor());
@@ -568,7 +568,7 @@ void tst_qqmlqt::tint()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(0, 0, 1));
QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor::fromRgbF(1, 0, 0));
@@ -601,7 +601,7 @@ void tst_qqmlqt::openUrlExternally()
QQmlComponent component(&engine, testFileUrl("openUrlExternally.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(handler.called,1);
QCOMPARE(handler.last, QUrl("test:url"));
@@ -623,7 +623,7 @@ void tst_qqmlqt::openUrlExternally_pragmaLibrary()
QQmlComponent component(&engine, testFileUrl("openUrlExternally_lib.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(handler.called,1);
QCOMPARE(handler.last, QUrl("test:url"));
@@ -644,7 +644,7 @@ void tst_qqmlqt::md5()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test2").toString(), QLatin1String(QCryptographicHash::hash("Hello World", QCryptographicHash::Md5).toHex()));
@@ -662,7 +662,7 @@ void tst_qqmlqt::createComponent()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("absoluteUrl").toString(), QString("http://www.example.com/test.qml"));
QCOMPARE(object->property("relativeUrl").toString(), testFileUrl("createComponentData.qml").toString());
@@ -676,7 +676,7 @@ void tst_qqmlqt::createComponent()
{
QQmlComponent component(&engine, testFileUrl("createComponent.2.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QTRY_VERIFY(object->property("success").toBool());
delete object;
}
@@ -687,7 +687,7 @@ void tst_qqmlqt::createComponent_pragmaLibrary()
// Currently, just loading createComponent_lib.qml causes crash on some platforms
QQmlComponent component(&engine, testFileUrl("createComponent_lib.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("status").toInt(), int(QQmlComponent::Ready));
QCOMPARE(object->property("readValue").toInt(), int(1913));
delete object;
@@ -711,13 +711,13 @@ void tst_qqmlqt::createQmlObject()
QTest::ignoreMessage(QtDebugMsg, qPrintable(warning6));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("emptyArg").toBool(), true);
QCOMPARE(object->property("success").toBool(), true);
QQuickItem *item = qobject_cast<QQuickItem *>(object);
- QVERIFY(item != 0);
+ QVERIFY(item != nullptr);
QCOMPARE(item->childItems().count(), 1);
delete object;
@@ -790,7 +790,7 @@ void tst_qqmlqt::dateTimeFormatting()
QObject *object = component.create();
QVERIFY2(component.errorString().isEmpty(), qPrintable(component.errorString()));
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(inputProperties.count() > 0);
QVariant result;
@@ -863,7 +863,7 @@ void tst_qqmlqt::dateTimeFormattingVariants()
QObject *object = component.create();
QVERIFY2(component.errorString().isEmpty(), qPrintable(component.errorString()));
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVariant result;
QVERIFY(QMetaObject::invokeMethod(object, method.toUtf8().constData(),
@@ -923,7 +923,7 @@ void tst_qqmlqt::isQtObject()
{
QQmlComponent component(&engine, testFileUrl("isQtObject.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test1").toBool(), true);
QCOMPARE(object->property("test2").toBool(), false);
@@ -942,7 +942,7 @@ void tst_qqmlqt::btoa()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test2").toString(), QString("SGVsbG8gd29ybGQh"));
@@ -957,7 +957,7 @@ void tst_qqmlqt::atob()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("test2").toString(), QString("Hello world!"));
@@ -972,7 +972,7 @@ void tst_qqmlqt::fontFamilies()
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QFontDatabase database;
QCOMPARE(object->property("test2"), QVariant::fromValue(database.families()));
@@ -986,7 +986,7 @@ void tst_qqmlqt::quit()
QSignalSpy spy(&engine, SIGNAL(quit()));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(spy.count(), 1);
delete object;
@@ -1011,7 +1011,7 @@ void tst_qqmlqt::resolvedUrl()
QQmlComponent component(&engine, testFileUrl("resolvedUrl.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QCOMPARE(object->property("result").toString(), component.url().toString());
QCOMPARE(object->property("isString").toBool(), true);
@@ -1101,14 +1101,14 @@ void tst_qqmlqt::later()
QQmlComponent component(&engine, testFileUrl("later.qml"));
QObject *root = component.create();
- QVERIFY(root != 0);
+ QVERIFY(root != nullptr);
if (!function.isEmpty())
QMetaObject::invokeMethod(root, qPrintable(function));
for (int i = 0; i < propNames.size(); ++i) {
if (propNames.at(i) == QLatin1String("processEvents")) {
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
} else if (propNames.at(i) == QLatin1String("collectGarbage")) {
engine.collectGarbage();
@@ -1131,7 +1131,7 @@ void tst_qqmlqt::qtObjectContents()
QQmlComponent component(&engine, testFileUrl("qtObjectContents.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("values").canConvert<QJSValue>());
QVariantMap values = object->property("values").value<QJSValue>().toVariant().toMap();
@@ -1255,7 +1255,7 @@ void tst_qqmlqt::timeRoundtrip()
eng.rootContext()->setContextProperty(QLatin1String("tp"), &tp);
QQmlComponent component(&eng, testFileUrl("timeRoundtrip.qml"));
QObject *obj = component.create();
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
// QML reads m_getTime and saves the result as m_putTime; this should come out the same, without
// any perturbation (e.g. by DST effects) from converting from QTime to V4's Date and back
diff --git a/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp b/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp
index e08389045c..12c3032eda 100644
--- a/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp
+++ b/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp
@@ -87,7 +87,7 @@ class CppObject : public QObject
Q_PROPERTY(QFont fontProperty MEMBER m_fontProperty NOTIFY fontPropertyChanged)
public:
- CppObject(QObject *parent = 0) : QObject(parent),
+ CppObject(QObject *parent = nullptr) : QObject(parent),
m_intProperty(123),
m_boolProperty(true),
m_realProperty(1.23),
diff --git a/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp b/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp
index 3b982d1ab7..f1dcefdab6 100644
--- a/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp
+++ b/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp
@@ -164,7 +164,7 @@ void tst_qqmlsqldatabase::testQml()
component.setData(qml.toUtf8(), testFileUrl("empty.qml")); // just a file for relative local imports
QVERIFY(!component.isError());
QQuickText *text = qobject_cast<QQuickText*>(component.create());
- QVERIFY(text != 0);
+ QVERIFY(text != nullptr);
QCOMPARE(text->text(),QString("passed"));
}
diff --git a/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp b/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp
index 5231af88be..52e27af647 100644
--- a/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp
+++ b/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp
@@ -86,7 +86,7 @@ void tst_qqmlstatemachine::tst_cppObjectSignal()
QQmlContext *ctxt = engine.rootContext();
ctxt->setContextProperty("_cppObject", &cppObject);
QScopedPointer<QObject> rootObject(component.create());
- QVERIFY(rootObject != 0);
+ QVERIFY(rootObject != nullptr);
// wait for state machine to start
QTRY_VERIFY(rootObject->property("running").toBool());
diff --git a/tests/auto/qml/qqmltimer/tst_qqmltimer.cpp b/tests/auto/qml/qqmltimer/tst_qqmltimer.cpp
index 44e7c706bf..64f804c200 100644
--- a/tests/auto/qml/qqmltimer/tst_qqmltimer.cpp
+++ b/tests/auto/qml/qqmltimer/tst_qqmltimer.cpp
@@ -116,7 +116,7 @@ void tst_qqmltimer::notRepeating()
QQmlComponent component(&engine);
component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 100; running: true }"), QUrl::fromLocalFile(""));
QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create());
- QVERIFY(timer != 0);
+ QVERIFY(timer != nullptr);
QVERIFY(timer->isRunning());
QVERIFY(!timer->isRepeating());
QCOMPARE(timer->interval(), 100);
@@ -138,7 +138,7 @@ void tst_qqmltimer::notRepeatingStart()
QQmlComponent component(&engine);
component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 100 }"), QUrl::fromLocalFile(""));
QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create());
- QVERIFY(timer != 0);
+ QVERIFY(timer != nullptr);
QVERIFY(!timer->isRunning());
TimerHelper helper;
@@ -163,7 +163,7 @@ void tst_qqmltimer::repeat()
QQmlComponent component(&engine);
component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 100; repeat: true; running: true }"), QUrl::fromLocalFile(""));
QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create());
- QVERIFY(timer != 0);
+ QVERIFY(timer != nullptr);
TimerHelper helper;
connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
@@ -205,7 +205,7 @@ void tst_qqmltimer::triggeredOnStart()
QQmlComponent component(&engine);
component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 100; running: true; triggeredOnStart: true }"), QUrl::fromLocalFile(""));
QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create());
- QVERIFY(timer != 0);
+ QVERIFY(timer != nullptr);
QVERIFY(timer->triggeredOnStart());
TimerHelper helper;
@@ -239,7 +239,7 @@ void tst_qqmltimer::triggeredOnStartRepeat()
QQmlComponent component(&engine);
component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 100; running: true; triggeredOnStart: true; repeat: true }"), QUrl::fromLocalFile(""));
QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create());
- QVERIFY(timer != 0);
+ QVERIFY(timer != nullptr);
TimerHelper helper;
connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
@@ -268,7 +268,7 @@ void tst_qqmltimer::noTriggerIfNotRunning()
"}"
), QUrl::fromLocalFile(""));
QObject *item = component.create();
- QVERIFY(item != 0);
+ QVERIFY(item != nullptr);
consistentWait(200);
QCOMPARE(item->property("ok").toBool(), true);
@@ -281,7 +281,7 @@ void tst_qqmltimer::changeDuration()
QQmlComponent component(&engine);
component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 200; repeat: true; running: true }"), QUrl::fromLocalFile(""));
QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create());
- QVERIFY(timer != 0);
+ QVERIFY(timer != nullptr);
TimerHelper helper;
connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
@@ -317,7 +317,7 @@ void tst_qqmltimer::restart()
QQmlComponent component(&engine);
component.setData(QByteArray("import QtQml 2.0\nTimer { interval: 500; repeat: true; running: true }"), QUrl::fromLocalFile(""));
QQmlTimer *timer = qobject_cast<QQmlTimer*>(component.create());
- QVERIFY(timer != 0);
+ QVERIFY(timer != nullptr);
TimerHelper helper;
connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
@@ -350,7 +350,7 @@ void tst_qqmltimer::restartFromTriggered()
" }"), QUrl::fromLocalFile(""));
QScopedPointer<QObject> object(component.create());
QQmlTimer *timer = qobject_cast<QQmlTimer*>(object.data());
- QVERIFY(timer != 0);
+ QVERIFY(timer != nullptr);
TimerHelper helper;
connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
@@ -378,7 +378,7 @@ void tst_qqmltimer::runningFromTriggered()
" }"), QUrl::fromLocalFile(""));
QScopedPointer<QObject> object(component.create());
QQmlTimer *timer = qobject_cast<QQmlTimer*>(object.data());
- QVERIFY(timer != 0);
+ QVERIFY(timer != nullptr);
TimerHelper helper;
connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
@@ -401,9 +401,9 @@ void tst_qqmltimer::parentProperty()
QQmlComponent component(&engine);
component.setData(QByteArray("import QtQuick 2.0\nItem { Timer { objectName: \"timer\"; running: parent.visible } }"), QUrl::fromLocalFile(""));
QQuickItem *item = qobject_cast<QQuickItem*>(component.create());
- QVERIFY(item != 0);
+ QVERIFY(item != nullptr);
QQmlTimer *timer = item->findChild<QQmlTimer*>("timer");
- QVERIFY(timer != 0);
+ QVERIFY(timer != nullptr);
QVERIFY(timer->isRunning());
diff --git a/tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp b/tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp
index 80c54bdf8e..fc736cde1a 100644
--- a/tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp
+++ b/tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp
@@ -71,7 +71,7 @@ void tst_qqmltranslation::translation()
QQmlEngine engine;
QQmlComponent component(&engine, testFile);
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
if (verifyCompiledData) {
QQmlContext *context = qmlContext(object);
@@ -131,7 +131,7 @@ void tst_qqmltranslation::idTranslation()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("idtranslation.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
{
QQmlContext *context = qmlContext(object);
diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
index 5a3d76e903..c10a8a08c1 100644
--- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
+++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
@@ -61,7 +61,7 @@ void tst_QQMLTypeLoader::testLoadComplete()
QVERIFY(QTest::qWaitForWindowExposed(window));
QObject *rootObject = window->rootObject();
- QTRY_VERIFY(rootObject != 0);
+ QTRY_VERIFY(rootObject != nullptr);
QTRY_COMPARE(rootObject->property("created").toInt(), 2);
QTRY_COMPARE(rootObject->property("loaded").toInt(), 2);
delete window;
@@ -136,7 +136,7 @@ void tst_QQMLTypeLoader::trimCache3()
QQmlProperty::write(window->rootObject(), "source", QString());
// handle our deleteLater and cleanup
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QCoreApplication::processEvents();
window->engine()->collectGarbage();
@@ -173,7 +173,7 @@ class TestObject : public QObject
{
Q_OBJECT
public:
- TestObject(QObject *parent = 0) : QObject(parent) {}
+ TestObject(QObject *parent = nullptr) : QObject(parent) {}
};
QML_DECLARE_TYPE(TestObject)
diff --git a/tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp b/tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp
index 1902801c8f..22074602b7 100644
--- a/tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp
+++ b/tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp
@@ -78,7 +78,7 @@ void tst_qqmlvaluetypeproviders::qtqmlValueTypes()
QVERIFY(!component.isError());
QVERIFY(component.errors().isEmpty());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("qtqmlTypeSuccess").toBool());
QVERIFY(object->property("qtquickTypeSuccess").toBool());
delete object;
@@ -91,7 +91,7 @@ void tst_qqmlvaluetypeproviders::qtquickValueTypes()
QVERIFY(!component.isError());
QVERIFY(component.errors().isEmpty());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("qtqmlTypeSuccess").toBool());
QVERIFY(object->property("qtquickTypeSuccess").toBool());
delete object;
@@ -104,7 +104,7 @@ void tst_qqmlvaluetypeproviders::comparisonSemantics()
QVERIFY(!component.isError());
QVERIFY(component.errors().isEmpty());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("comparisonSuccess").toBool());
delete object;
}
@@ -116,7 +116,7 @@ void tst_qqmlvaluetypeproviders::cppIntegration()
QVERIFY(!component.isError());
QVERIFY(component.errors().isEmpty());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
// ensure accessing / comparing / assigning cpp-defined props
// and qml-defined props works in QML.
@@ -156,7 +156,7 @@ void tst_qqmlvaluetypeproviders::jsObjectConversion()
QVERIFY(!component.isError());
QVERIFY(component.errors().isEmpty());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("qtquickTypeSuccess").toBool());
delete object;
}
@@ -168,7 +168,7 @@ void tst_qqmlvaluetypeproviders::invokableFunctions()
QVERIFY(!component.isError());
QVERIFY(component.errors().isEmpty());
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("complete").toBool());
QVERIFY(object->property("success").toBool());
delete object;
@@ -233,7 +233,7 @@ public:
if (type == qMetaTypeId<TestValue>())
return &TestValueType::staticMetaObject;
- return 0;
+ return nullptr;
}
};
@@ -284,7 +284,7 @@ void tst_qqmlvaluetypeproviders::userType()
QQmlComponent component(&e, testFileUrl("userType.qml"));
QScopedPointer<QObject> obj(component.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QCOMPARE(obj->property("success").toBool(), true);
}
@@ -295,7 +295,7 @@ void tst_qqmlvaluetypeproviders::changedSignal()
QVERIFY(!component.isError());
QVERIFY(component.errors().isEmpty());
QScopedPointer<QObject> object(component.create());
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("complete").toBool());
QVERIFY(object->property("success").toBool());
}
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);
diff --git a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
index 1a23286ede..1f1be122f1 100644
--- a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
+++ b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
@@ -115,7 +115,7 @@ void tst_qquickfolderlistmodel::basicProperties()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
QCOMPARE(flm->property("nameFilters").toStringList(), QStringList() << "*.qml"); // from basic.qml
QCOMPARE(flm->property("folder").toUrl(), QUrl::fromLocalFile(QDir::currentPath()));
@@ -149,7 +149,7 @@ void tst_qquickfolderlistmodel::status()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
QTRY_COMPARE(flm->property("status").toInt(), int(Ready));
flm->setProperty("folder", QUrl::fromLocalFile(""));
QTRY_COMPARE(flm->property("status").toInt(), int(Null));
@@ -163,7 +163,7 @@ void tst_qquickfolderlistmodel::showFiles()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
flm->setProperty("folder", dataDirectoryUrl());
QTRY_COMPARE(flm->property("count").toInt(), 8); // wait for refresh
@@ -181,7 +181,7 @@ void tst_qquickfolderlistmodel::resetFiltering()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
flm->setProperty("folder", testFileUrl("resetfiltering"));
// _q_directoryUpdated may be triggered if model was empty before, but there won't be a rowsRemoved signal
@@ -203,7 +203,7 @@ void tst_qquickfolderlistmodel::nameFilters()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
connect(flm, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SLOT(removed(QModelIndex,int,int)));
@@ -235,7 +235,7 @@ void tst_qquickfolderlistmodel::refresh()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
flm->setProperty("folder", dataDirectoryUrl());
QTRY_COMPARE(flm->property("count").toInt(),8); // wait for refresh
@@ -258,7 +258,7 @@ void tst_qquickfolderlistmodel::cdUp()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
const QUrl startFolder = flm->property("folder").toUrl();
QVERIFY(startFolder.isValid());
@@ -336,7 +336,7 @@ void tst_qquickfolderlistmodel::showDotAndDotDot()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
flm->setProperty("folder", folder);
flm->setProperty("rootFolder", rootFolder);
@@ -371,7 +371,7 @@ void tst_qquickfolderlistmodel::sortReversed()
QQmlComponent component(&engine, testFileUrl("sortReversed.qml"));
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
flm->setProperty("folder", dataDirectoryUrl());
QTRY_COMPARE(flm->property("count").toInt(), 9); // wait for refresh
QCOMPARE(flm->data(flm->index(0),FileNameRole).toString(), QLatin1String("txtdir"));
@@ -382,7 +382,7 @@ void tst_qquickfolderlistmodel::introspectQrc()
QQmlComponent component(&engine, testFileUrl("qrc.qml"));
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
QTRY_COMPARE(flm->property("count").toInt(), 1); // wait for refresh
QCOMPARE(flm->data(flm->index(0),FileNameRole).toString(), QLatin1String("hello.txt"));
}
diff --git a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
index 49135ca920..e8a4be6faf 100644
--- a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
+++ b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
@@ -79,7 +79,7 @@ void tst_QQuickWorkerScript::source()
{
QQmlComponent component(&m_engine, testFileUrl("worker.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
const QMetaObject *mo = worker->metaObject();
QVariant value(100);
@@ -104,7 +104,7 @@ void tst_QQuickWorkerScript::messaging()
QQmlComponent component(&m_engine, testFileUrl("worker.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
waitForEchoMessage(worker);
@@ -144,7 +144,7 @@ void tst_QQuickWorkerScript::messaging_sendQObjectList()
QQmlComponent component(&m_engine, testFileUrl("worker.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QVariantList objects;
for (int i=0; i<3; i++)
@@ -165,7 +165,7 @@ void tst_QQuickWorkerScript::messaging_sendJsObject()
{
QQmlComponent component(&m_engine, testFileUrl("worker.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
// Properties are in alphabetical order to enable string-based comparison after
// QVariant roundtrip, since the properties will be stored in a QVariantMap.
@@ -204,7 +204,7 @@ void tst_QQuickWorkerScript::script_with_pragma()
QQmlComponent component(&m_engine, testFileUrl("worker_pragma.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
waitForEchoMessage(worker);
@@ -220,7 +220,7 @@ void tst_QQuickWorkerScript::script_included()
{
QQmlComponent component(&m_engine, testFileUrl("worker_include.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QString value("Hello");
@@ -247,7 +247,7 @@ void tst_QQuickWorkerScript::scriptError_onLoad()
QtMessageHandler previousMsgHandler = qInstallMessageHandler(qquickworkerscript_warningsHandler);
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QTRY_COMPARE(qquickworkerscript_lastWarning,
testFileUrl("script_error_onLoad.js").toString() + QLatin1String(":3:10: SyntaxError: Expected token `,'"));
@@ -261,7 +261,7 @@ void tst_QQuickWorkerScript::scriptError_onCall()
{
QQmlComponent component(&m_engine, testFileUrl("worker_error_onCall.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QtMessageHandler previousMsgHandler = qInstallMessageHandler(qquickworkerscript_warningsHandler);
QVariant value;
@@ -279,7 +279,7 @@ void tst_QQuickWorkerScript::script_function()
{
QQmlComponent component(&m_engine, testFileUrl("worker_function.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QString value("Hello");
@@ -297,7 +297,7 @@ void tst_QQuickWorkerScript::script_var()
{
QQmlComponent component(&m_engine, testFileUrl("worker_var.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QString value("Hello");
@@ -316,7 +316,7 @@ void tst_QQuickWorkerScript::script_global()
{
QQmlComponent component(&m_engine, testFileUrl("worker_global.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QString value("Hello");
@@ -340,7 +340,7 @@ void tst_QQuickWorkerScript::script_global()
QQmlComponent component(&m_engine, testFileUrl("worker_global2.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
- QVERIFY(worker != 0);
+ QVERIFY(worker != nullptr);
QTRY_COMPARE(qquickworkerscript_lastWarning,
testFileUrl("script_global2.js").toString() + QLatin1String(":1: Invalid write to global property \"world\""));
diff --git a/tests/auto/qml/qtqmlmodules/tst_qtqmlmodules.cpp b/tests/auto/qml/qtqmlmodules/tst_qtqmlmodules.cpp
index eab3837245..90b6feee28 100644
--- a/tests/auto/qml/qtqmlmodules/tst_qtqmlmodules.cpp
+++ b/tests/auto/qml/qtqmlmodules/tst_qtqmlmodules.cpp
@@ -49,7 +49,7 @@ void tst_qtqmlmodules::baseTypes()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("base.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("success").toBool());
delete object;
@@ -60,7 +60,7 @@ void tst_qtqmlmodules::modelsTypes()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("models.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("success").toBool());
delete object;
@@ -71,7 +71,7 @@ void tst_qtqmlmodules::unavailableTypes()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("unavailable.qml"));
QObject *object = component.create();
- QVERIFY(object != 0);
+ QVERIFY(object != nullptr);
QVERIFY(object->property("success").toBool());
delete object;