aboutsummaryrefslogtreecommitdiffstats
path: root/src/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 /src/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 'src/qml')
-rw-r--r--src/qml/animations/qabstractanimationjob.cpp8
-rw-r--r--src/qml/animations/qanimationgroupjob.cpp18
-rw-r--r--src/qml/animations/qsequentialanimationgroupjob.cpp10
-rw-r--r--src/qml/animations/qsequentialanimationgroupjob_p.h2
-rw-r--r--src/qml/compiler/qqmlirbuilder.cpp76
-rw-r--r--src/qml/compiler/qqmlirbuilder_p.h22
-rw-r--r--src/qml/compiler/qqmlpropertycachecreator_p.h8
-rw-r--r--src/qml/compiler/qqmlpropertyvalidator.cpp18
-rw-r--r--src/qml/compiler/qqmltypecompiler.cpp30
-rw-r--r--src/qml/compiler/qv4bytecodegenerator_p.h2
-rw-r--r--src/qml/compiler/qv4codegen.cpp20
-rw-r--r--src/qml/compiler/qv4codegen_p.h6
-rw-r--r--src/qml/compiler/qv4compileddata.cpp18
-rw-r--r--src/qml/compiler/qv4compilercontext_p.h10
-rw-r--r--src/qml/compiler/qv4compilercontrolflow_p.h12
-rw-r--r--src/qml/compiler/qv4compilerscanfunctions.cpp8
-rw-r--r--src/qml/compiler/qv4compilerscanfunctions_p.h2
-rw-r--r--src/qml/debugger/qqmlabstractprofileradapter_p.h4
-rw-r--r--src/qml/debugger/qqmlconfigurabledebugservice_p.h2
-rw-r--r--src/qml/debugger/qqmldebugconnector.cpp10
-rw-r--r--src/qml/debugger/qqmldebugconnector_p.h2
-rw-r--r--src/qml/debugger/qqmldebugserverconnection_p.h2
-rw-r--r--src/qml/debugger/qqmldebugservice_p.h2
-rw-r--r--src/qml/debugger/qqmlprofiler_p.h2
-rw-r--r--src/qml/jit/qv4assembler.cpp4
-rw-r--r--src/qml/jsapi/qjsengine.cpp2
-rw-r--r--src/qml/jsapi/qjsengine_p.h2
-rw-r--r--src/qml/jsapi/qjsvalue.cpp18
-rw-r--r--src/qml/jsapi/qjsvalue_p.h8
-rw-r--r--src/qml/jsruntime/qv4arraybuffer.cpp4
-rw-r--r--src/qml/jsruntime/qv4arraybuffer_p.h4
-rw-r--r--src/qml/jsruntime/qv4arraydata.cpp12
-rw-r--r--src/qml/jsruntime/qv4arraydata_p.h2
-rw-r--r--src/qml/jsruntime/qv4context.cpp2
-rw-r--r--src/qml/jsruntime/qv4context_p.h4
-rw-r--r--src/qml/jsruntime/qv4dataview.cpp6
-rw-r--r--src/qml/jsruntime/qv4dateobject_p.h2
-rw-r--r--src/qml/jsruntime/qv4engine.cpp44
-rw-r--r--src/qml/jsruntime/qv4engine_p.h2
-rw-r--r--src/qml/jsruntime/qv4errorobject_p.h4
-rw-r--r--src/qml/jsruntime/qv4executableallocator.cpp6
-rw-r--r--src/qml/jsruntime/qv4executableallocator_p.h8
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp6
-rw-r--r--src/qml/jsruntime/qv4functionobject_p.h4
-rw-r--r--src/qml/jsruntime/qv4globalobject.cpp6
-rw-r--r--src/qml/jsruntime/qv4identifier.cpp10
-rw-r--r--src/qml/jsruntime/qv4identifier_p.h2
-rw-r--r--src/qml/jsruntime/qv4identifiertable.cpp4
-rw-r--r--src/qml/jsruntime/qv4include.cpp4
-rw-r--r--src/qml/jsruntime/qv4internalclass.cpp16
-rw-r--r--src/qml/jsruntime/qv4internalclass_p.h8
-rw-r--r--src/qml/jsruntime/qv4jscall_p.h4
-rw-r--r--src/qml/jsruntime/qv4jsonobject.cpp6
-rw-r--r--src/qml/jsruntime/qv4managed.cpp8
-rw-r--r--src/qml/jsruntime/qv4memberdata_p.h2
-rw-r--r--src/qml/jsruntime/qv4object.cpp24
-rw-r--r--src/qml/jsruntime/qv4object_p.h14
-rw-r--r--src/qml/jsruntime/qv4objectiterator.cpp8
-rw-r--r--src/qml/jsruntime/qv4objectiterator_p.h2
-rw-r--r--src/qml/jsruntime/qv4objectproto.cpp2
-rw-r--r--src/qml/jsruntime/qv4persistent.cpp16
-rw-r--r--src/qml/jsruntime/qv4persistent_p.h20
-rw-r--r--src/qml/jsruntime/qv4profiling_p.h4
-rw-r--r--src/qml/jsruntime/qv4property_p.h4
-rw-r--r--src/qml/jsruntime/qv4qmlcontext.cpp6
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp76
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper_p.h4
-rw-r--r--src/qml/jsruntime/qv4regexp.cpp4
-rw-r--r--src/qml/jsruntime/qv4regexpobject.cpp38
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp12
-rw-r--r--src/qml/jsruntime/qv4runtimecodegen.cpp6
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h6
-rw-r--r--src/qml/jsruntime/qv4script.cpp16
-rw-r--r--src/qml/jsruntime/qv4script_p.h6
-rw-r--r--src/qml/jsruntime/qv4sequenceobject.cpp6
-rw-r--r--src/qml/jsruntime/qv4sparsearray.cpp40
-rw-r--r--src/qml/jsruntime/qv4sparsearray_p.h6
-rw-r--r--src/qml/jsruntime/qv4string.cpp2
-rw-r--r--src/qml/jsruntime/qv4string_p.h2
-rw-r--r--src/qml/jsruntime/qv4stringobject.cpp6
-rw-r--r--src/qml/jsruntime/qv4typedarray.cpp10
-rw-r--r--src/qml/jsruntime/qv4value_p.h6
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp2
-rw-r--r--src/qml/memory/qv4mm.cpp12
-rw-r--r--src/qml/memory/qv4mm_p.h12
-rw-r--r--src/qml/memory/qv4mmdefs_p.h6
-rw-r--r--src/qml/parser/qqmljsast.cpp8
-rw-r--r--src/qml/parser/qqmljsast_p.h56
-rw-r--r--src/qml/parser/qqmljsengine_p.cpp2
-rw-r--r--src/qml/parser/qqmljsgrammar.cpp6
-rw-r--r--src/qml/parser/qqmljslexer.cpp16
-rw-r--r--src/qml/parser/qqmljsmemorypool_p.h10
-rw-r--r--src/qml/parser/qqmljsparser.cpp68
-rw-r--r--src/qml/parser/qqmljsparser_p.h6
-rw-r--r--src/qml/qml/ftw/qbitfield_p.h4
-rw-r--r--src/qml/qml/ftw/qfieldlist_p.h22
-rw-r--r--src/qml/qml/ftw/qfinitestack_p.h6
-rw-r--r--src/qml/qml/ftw/qhashedstring_p.h50
-rw-r--r--src/qml/qml/ftw/qintrusivelist_p.h20
-rw-r--r--src/qml/qml/ftw/qpodvector_p.h4
-rw-r--r--src/qml/qml/ftw/qqmlrefcount_p.h2
-rw-r--r--src/qml/qml/ftw/qqmlthread.cpp14
-rw-r--r--src/qml/qml/ftw/qqmlthread_p.h2
-rw-r--r--src/qml/qml/ftw/qrecursionwatcher_p.h4
-rw-r--r--src/qml/qml/ftw/qrecyclepool_p.h4
-rw-r--r--src/qml/qml/qqml.h2
-rw-r--r--src/qml/qml/qqmlabstractbinding.cpp4
-rw-r--r--src/qml/qml/qqmlapplicationengine.cpp2
-rw-r--r--src/qml/qml/qqmlbinding.cpp16
-rw-r--r--src/qml/qml/qqmlboundsignal.cpp14
-rw-r--r--src/qml/qml/qqmlboundsignal_p.h4
-rw-r--r--src/qml/qml/qqmlboundsignalexpressionpointer_p.h2
-rw-r--r--src/qml/qml/qqmlcleanup.cpp8
-rw-r--r--src/qml/qml/qqmlcleanup_p.h2
-rw-r--r--src/qml/qml/qqmlcomponent.cpp32
-rw-r--r--src/qml/qml/qqmlcomponent_p.h2
-rw-r--r--src/qml/qml/qqmlcomponentattached_p.h4
-rw-r--r--src/qml/qml/qqmlcontext.cpp74
-rw-r--r--src/qml/qml/qqmlcontext_p.h22
-rw-r--r--src/qml/qml/qqmlcustomparser.cpp4
-rw-r--r--src/qml/qml/qqmlcustomparser_p.h4
-rw-r--r--src/qml/qml/qqmldata_p.h14
-rw-r--r--src/qml/qml/qqmldelayedcallqueue.cpp2
-rw-r--r--src/qml/qml/qqmlengine.cpp94
-rw-r--r--src/qml/qml/qqmlengine_p.h10
-rw-r--r--src/qml/qml/qqmlerror.cpp12
-rw-r--r--src/qml/qml/qqmlexpression.cpp10
-rw-r--r--src/qml/qml/qqmlexpression_p.h4
-rw-r--r--src/qml/qml/qqmlfile.cpp10
-rw-r--r--src/qml/qml/qqmlfileselector.cpp6
-rw-r--r--src/qml/qml/qqmlglobal.cpp18
-rw-r--r--src/qml/qml/qqmlglobal_p.h4
-rw-r--r--src/qml/qml/qqmlguard_p.h12
-rw-r--r--src/qml/qml/qqmlimport.cpp24
-rw-r--r--src/qml/qml/qqmlimport_p.h8
-rw-r--r--src/qml/qml/qqmlincubator.cpp40
-rw-r--r--src/qml/qml/qqmlinfo.cpp2
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp26
-rw-r--r--src/qml/qml/qqmljavascriptexpression_p.h22
-rw-r--r--src/qml/qml/qqmllist.cpp18
-rw-r--r--src/qml/qml/qqmllistwrapper.cpp4
-rw-r--r--src/qml/qml/qqmllocale.cpp34
-rw-r--r--src/qml/qml/qqmllocale_p.h2
-rw-r--r--src/qml/qml/qqmlloggingcategory_p.h2
-rw-r--r--src/qml/qml/qqmlmetatype.cpp88
-rw-r--r--src/qml/qml/qqmlmetatype_p.h6
-rw-r--r--src/qml/qml/qqmlnotifier.cpp6
-rw-r--r--src/qml/qml/qqmlnotifier_p.h18
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp88
-rw-r--r--src/qml/qml/qqmlobjectcreator_p.h6
-rw-r--r--src/qml/qml/qqmlopenmetaobject.cpp20
-rw-r--r--src/qml/qml/qqmlopenmetaobject_p.h2
-rw-r--r--src/qml/qml/qqmlparserstatus.cpp4
-rw-r--r--src/qml/qml/qqmlplatform_p.h2
-rw-r--r--src/qml/qml/qqmlprivate.h4
-rw-r--r--src/qml/qml/qqmlproperty.cpp64
-rw-r--r--src/qml/qml/qqmlproperty_p.h6
-rw-r--r--src/qml/qml/qqmlpropertycache.cpp72
-rw-r--r--src/qml/qml/qqmlpropertycache_p.h24
-rw-r--r--src/qml/qml/qqmlpropertyvalueinterceptor.cpp2
-rw-r--r--src/qml/qml/qqmlproxymetaobject.cpp6
-rw-r--r--src/qml/qml/qqmlscriptstring_p.h2
-rw-r--r--src/qml/qml/qqmlstringconverters_p.h18
-rw-r--r--src/qml/qml/qqmltypeloader.cpp42
-rw-r--r--src/qml/qml/qqmltypeloader_p.h6
-rw-r--r--src/qml/qml/qqmltypenamecache.cpp20
-rw-r--r--src/qml/qml/qqmltypenamecache_p.h6
-rw-r--r--src/qml/qml/qqmltypewrapper.cpp2
-rw-r--r--src/qml/qml/qqmlvaluetype.cpp14
-rw-r--r--src/qml/qml/qqmlvaluetype_p.h8
-rw-r--r--src/qml/qml/qqmlvaluetypeproxybinding.cpp6
-rw-r--r--src/qml/qml/qqmlvaluetypewrapper.cpp32
-rw-r--r--src/qml/qml/qqmlvme.cpp6
-rw-r--r--src/qml/qml/qqmlvme_p.h6
-rw-r--r--src/qml/qml/qqmlvmemetaobject.cpp42
-rw-r--r--src/qml/qml/qqmlvmemetaobject_p.h8
-rw-r--r--src/qml/qml/qqmlxmlhttprequest.cpp78
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp24
-rw-r--r--src/qml/qml/v8/qv8engine.cpp6
-rw-r--r--src/qml/qml/v8/qv8engine_p.h2
-rw-r--r--src/qml/types/qqmlbind.cpp4
-rw-r--r--src/qml/types/qqmlbind_p.h2
-rw-r--r--src/qml/types/qqmlconnections.cpp6
-rw-r--r--src/qml/types/qqmlconnections_p.h2
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp118
-rw-r--r--src/qml/types/qqmldelegatemodel_p.h8
-rw-r--r--src/qml/types/qqmldelegatemodel_p_p.h8
-rw-r--r--src/qml/types/qqmlinstantiator.cpp14
-rw-r--r--src/qml/types/qqmlinstantiator_p.h2
-rw-r--r--src/qml/types/qqmllistmodel.cpp102
-rw-r--r--src/qml/types/qqmllistmodel_p.h4
-rw-r--r--src/qml/types/qqmllistmodelworkeragent.cpp2
-rw-r--r--src/qml/types/qqmllistmodelworkeragent_p.h2
-rw-r--r--src/qml/types/qqmlobjectmodel.cpp4
-rw-r--r--src/qml/types/qqmlobjectmodel_p.h4
-rw-r--r--src/qml/types/qqmltimer_p.h2
-rw-r--r--src/qml/types/qquickpackage.cpp2
-rw-r--r--src/qml/types/qquickpackage_p.h2
-rw-r--r--src/qml/types/qquickworkerscript.cpp16
-rw-r--r--src/qml/types/qquickworkerscript_p.h4
-rw-r--r--src/qml/util/qqmladaptormodel.cpp40
-rw-r--r--src/qml/util/qqmladaptormodel_p.h4
-rw-r--r--src/qml/util/qqmlchangeset.cpp2
-rw-r--r--src/qml/util/qqmlchangeset_p.h2
-rw-r--r--src/qml/util/qqmllistaccessor.cpp2
-rw-r--r--src/qml/util/qqmllistaccessor_p.h2
-rw-r--r--src/qml/util/qqmllistcompositor.cpp2
-rw-r--r--src/qml/util/qqmllistcompositor_p.h36
208 files changed, 1454 insertions, 1454 deletions
diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp
index b726d2fc43..3f33e7e81b 100644
--- a/src/qml/animations/qabstractanimationjob.cpp
+++ b/src/qml/animations/qabstractanimationjob.cpp
@@ -258,7 +258,7 @@ int QQmlAnimationTimer::closestPauseAnimationTimeToFinish()
QAbstractAnimationJob::QAbstractAnimationJob()
: m_loopCount(1)
- , m_group(0)
+ , m_group(nullptr)
, m_direction(QAbstractAnimationJob::Forward)
, m_state(QAbstractAnimationJob::Stopped)
, m_totalCurrentTime(0)
@@ -266,9 +266,9 @@ QAbstractAnimationJob::QAbstractAnimationJob()
, m_currentLoop(0)
, m_uncontrolledFinishTime(-1)
, m_currentLoopStartTime(0)
- , m_nextSibling(0)
- , m_previousSibling(0)
- , m_wasDeleted(0)
+ , m_nextSibling(nullptr)
+ , m_previousSibling(nullptr)
+ , m_wasDeleted(nullptr)
, m_hasRegisteredTimer(false)
, m_isPause(false)
, m_isGroup(false)
diff --git a/src/qml/animations/qanimationgroupjob.cpp b/src/qml/animations/qanimationgroupjob.cpp
index ea6d87952a..344791fd83 100644
--- a/src/qml/animations/qanimationgroupjob.cpp
+++ b/src/qml/animations/qanimationgroupjob.cpp
@@ -42,7 +42,7 @@
QT_BEGIN_NAMESPACE
QAnimationGroupJob::QAnimationGroupJob()
- : QAbstractAnimationJob(), m_firstChild(0), m_lastChild(0)
+ : QAbstractAnimationJob(), m_firstChild(nullptr), m_lastChild(nullptr)
{
m_isGroup = true;
}
@@ -111,25 +111,25 @@ void QAnimationGroupJob::removeAnimation(QAbstractAnimationJob *animation)
else
m_lastChild = prev;
- animation->m_previousSibling = 0;
- animation->m_nextSibling = 0;
+ animation->m_previousSibling = nullptr;
+ animation->m_nextSibling = nullptr;
- animation->m_group = 0;
+ animation->m_group = nullptr;
animationRemoved(animation, prev, next);
}
void QAnimationGroupJob::clear()
{
QAbstractAnimationJob *child = firstChild();
- QAbstractAnimationJob *nextSibling = 0;
- while (child != 0) {
- child->m_group = 0;
+ QAbstractAnimationJob *nextSibling = nullptr;
+ while (child != nullptr) {
+ child->m_group = nullptr;
nextSibling = child->nextSibling();
delete child;
child = nextSibling;
}
- m_firstChild = 0;
- m_lastChild = 0;
+ m_firstChild = nullptr;
+ m_lastChild = nullptr;
}
void QAnimationGroupJob::resetUncontrolledAnimationsFinishTime()
diff --git a/src/qml/animations/qsequentialanimationgroupjob.cpp b/src/qml/animations/qsequentialanimationgroupjob.cpp
index 25d31e4042..22e20d9268 100644
--- a/src/qml/animations/qsequentialanimationgroupjob.cpp
+++ b/src/qml/animations/qsequentialanimationgroupjob.cpp
@@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE
QSequentialAnimationGroupJob::QSequentialAnimationGroupJob()
: QAnimationGroupJob()
- , m_currentAnimation(0)
+ , m_currentAnimation(nullptr)
, m_previousLoop(0)
{
}
@@ -87,7 +87,7 @@ QSequentialAnimationGroupJob::AnimationIndex QSequentialAnimationGroupJob::index
Q_ASSERT(firstChild());
AnimationIndex ret;
- QAbstractAnimationJob *anim = 0;
+ QAbstractAnimationJob *anim = nullptr;
int duration = 0;
for (anim = firstChild(); anim; anim = anim->nextSibling()) {
@@ -283,7 +283,7 @@ void QSequentialAnimationGroupJob::setCurrentAnimation(QAbstractAnimationJob *an
{
if (!anim) {
Q_ASSERT(!firstChild());
- m_currentAnimation = 0;
+ m_currentAnimation = nullptr;
return;
}
@@ -364,7 +364,7 @@ void QSequentialAnimationGroupJob::uncontrolledAnimationFinished(QAbstractAnimat
void QSequentialAnimationGroupJob::animationInserted(QAbstractAnimationJob *anim)
{
- if (m_currentAnimation == 0)
+ if (m_currentAnimation == nullptr)
setCurrentAnimation(firstChild()); // initialize the current animation
if (m_currentAnimation == anim->nextSibling()
@@ -393,7 +393,7 @@ void QSequentialAnimationGroupJob::animationRemoved(QAbstractAnimationJob *anim,
else if (prev)
setCurrentAnimation(prev);
else// case all animations were removed
- setCurrentAnimation(0);
+ setCurrentAnimation(nullptr);
}
// duration of the previous animations up to the current animation
diff --git a/src/qml/animations/qsequentialanimationgroupjob_p.h b/src/qml/animations/qsequentialanimationgroupjob_p.h
index 5fbafcb9ac..c7023b77c6 100644
--- a/src/qml/animations/qsequentialanimationgroupjob_p.h
+++ b/src/qml/animations/qsequentialanimationgroupjob_p.h
@@ -77,7 +77,7 @@ protected:
private:
struct AnimationIndex
{
- AnimationIndex() : afterCurrent(false), timeOffset(0), animation(0) {}
+ AnimationIndex() : afterCurrent(false), timeOffset(0), animation(nullptr) {}
// AnimationIndex points to the animation at timeOffset, skipping 0 duration animations.
// Note that the index semantic is slightly different depending on the direction.
bool afterCurrent; //whether animation is before or after m_currentAnimation //TODO: make enum Before/After/Same
diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp
index 6c8ca4bbfc..237cd9bf3b 100644
--- a/src/qml/compiler/qqmlirbuilder.cpp
+++ b/src/qml/compiler/qqmlirbuilder.cpp
@@ -93,7 +93,7 @@ void Object::init(QQmlJS::MemoryPool *pool, int typeNameIndex, int idIndex, cons
bindings = pool->New<PoolList<Binding> >();
functions = pool->New<PoolList<Function> >();
functionsAndExpressions = pool->New<PoolList<CompiledFunctionOrExpression> >();
- declarationsOverride = 0;
+ declarationsOverride = nullptr;
}
QString Object::sanityCheckFunctionNames(const QSet<QString> &illegalNames, QQmlJS::AST::SourceLocation *errorLocation)
@@ -233,7 +233,7 @@ Binding *Object::findBinding(quint32 nameIndex) const
for (Binding *b = bindings->first; b; b = b->next)
if (b->propertyNameIndex == nameIndex)
return b;
- return 0;
+ return nullptr;
}
void Object::insertSorted(Binding *b)
@@ -275,7 +275,7 @@ void Document::removeScriptPragmas(QString &script)
const QLatin1String pragma("pragma");
const QLatin1String library("library");
- QQmlJS::Lexer l(0);
+ QQmlJS::Lexer l(nullptr);
l.setCode(script, 0);
int token = l.lex();
@@ -317,7 +317,7 @@ void Document::removeScriptPragmas(QString &script)
Document::Document(bool debugMode)
: jsModule(debugMode)
- , program(0)
+ , program(nullptr)
, jsGenerator(&jsModule)
{
}
@@ -363,16 +363,16 @@ void ScriptDirectivesCollector::importModule(const QString &uri, const QString &
IRBuilder::IRBuilder(const QSet<QString> &illegalNames)
: illegalNames(illegalNames)
- , _object(0)
- , _propertyDeclaration(0)
- , pool(0)
- , jsGenerator(0)
+ , _object(nullptr)
+ , _propertyDeclaration(nullptr)
+ , pool(nullptr)
+ , jsGenerator(nullptr)
{
}
bool IRBuilder::generateFromQml(const QString &code, const QString &url, Document *output)
{
- QQmlJS::AST::UiProgram *program = 0;
+ QQmlJS::AST::UiProgram *program = nullptr;
{
QQmlJS::Lexer lexer(&output->jsParserEngine);
lexer.setCode(code, /*line = */ 1);
@@ -479,7 +479,7 @@ bool IRBuilder::visit(QQmlJS::AST::UiObjectDefinition *node)
appendBinding(nameLocation, nameLocation, emptyStringIndex, idx);
} else {
int idx = 0;
- if (!defineQMLObject(&idx, /*qualfied type name id*/0, node->qualifiedTypeNameId->firstSourceLocation(), node->initializer, /*declarations should go here*/_object))
+ if (!defineQMLObject(&idx, /*qualfied type name id*/nullptr, node->qualifiedTypeNameId->firstSourceLocation(), node->initializer, /*declarations should go here*/_object))
return false;
appendBinding(node->qualifiedTypeNameId, idx);
}
@@ -504,7 +504,7 @@ bool IRBuilder::visit(QQmlJS::AST::UiScriptBinding *node)
bool IRBuilder::visit(QQmlJS::AST::UiArrayBinding *node)
{
const QQmlJS::AST::SourceLocation qualifiedNameLocation = node->qualifiedId->identifierToken;
- Object *object = 0;
+ Object *object = nullptr;
QQmlJS::AST::UiQualifiedId *name = node->qualifiedId;
if (!resolveQualifiedId(&name, &object))
return false;
@@ -513,7 +513,7 @@ bool IRBuilder::visit(QQmlJS::AST::UiArrayBinding *node)
const int propertyNameIndex = registerString(name->name.toString());
- if (bindingsTarget()->findBinding(propertyNameIndex) != 0) {
+ if (bindingsTarget()->findBinding(propertyNameIndex) != nullptr) {
recordError(name->identifierToken, tr("Property value set multiple times"));
return false;
}
@@ -588,7 +588,7 @@ bool IRBuilder::defineQMLObject(int *objectIndex, QQmlJS::AST::UiQualifiedId *qu
_object->declarationsOverride = declarationsOverride;
// A new object is also a boundary for property declarations.
- Property *declaration = 0;
+ Property *declaration = nullptr;
qSwap(_propertyDeclaration, declaration);
accept(initializer);
@@ -831,7 +831,7 @@ bool IRBuilder::visit(QQmlJS::AST::UiPublicMember *node)
return false;
}
- const TypeNameToType *type = 0;
+ const TypeNameToType *type = nullptr;
for (int typeIndex = 0; typeIndex < propTypeNameToTypesCount; ++typeIndex) {
const TypeNameToType *t = propTypeNameToTypes + typeIndex;
if (memberType == QLatin1String(t->name, static_cast<int>(t->nameLength))) {
@@ -1219,7 +1219,7 @@ void IRBuilder::tryGeneratingTranslationBinding(const QStringRef &base, AST::Arg
void IRBuilder::appendBinding(QQmlJS::AST::UiQualifiedId *name, QQmlJS::AST::Statement *value)
{
const QQmlJS::AST::SourceLocation qualifiedNameLocation = name->identifierToken;
- Object *object = 0;
+ Object *object = nullptr;
if (!resolveQualifiedId(&name, &object))
return;
if (_object == object && name->name == QLatin1String("id")) {
@@ -1234,7 +1234,7 @@ void IRBuilder::appendBinding(QQmlJS::AST::UiQualifiedId *name, QQmlJS::AST::Sta
void IRBuilder::appendBinding(QQmlJS::AST::UiQualifiedId *name, int objectIndex, bool isOnAssignment)
{
const QQmlJS::AST::SourceLocation qualifiedNameLocation = name->identifierToken;
- Object *object = 0;
+ Object *object = nullptr;
if (!resolveQualifiedId(&name, &object, isOnAssignment))
return;
qSwap(_object, object);
@@ -1385,7 +1385,7 @@ bool IRBuilder::setId(const QQmlJS::AST::SourceLocation &idLocation, QQmlJS::AST
if (QQmlJS::AST::ExpressionStatement *stmt = QQmlJS::AST::cast<QQmlJS::AST::ExpressionStatement *>(node)) {
if (QQmlJS::AST::StringLiteral *lit = QQmlJS::AST::cast<QQmlJS::AST::StringLiteral *>(stmt->expression)) {
str = lit->value;
- node = 0;
+ node = nullptr;
} else
node = stmt->expression;
}
@@ -1456,9 +1456,9 @@ bool IRBuilder::resolveQualifiedId(QQmlJS::AST::UiQualifiedId **nameToResolve, O
if (binding) {
if (isAttachedProperty) {
if (!binding->isAttachedProperty())
- binding = 0;
+ binding = nullptr;
} else if (!binding->isGroupProperty()) {
- binding = 0;
+ binding = nullptr;
}
}
if (!binding) {
@@ -1480,7 +1480,7 @@ bool IRBuilder::resolveQualifiedId(QQmlJS::AST::UiQualifiedId **nameToResolve, O
binding->type = QV4::CompiledData::Binding::Type_GroupProperty;
int objIndex = 0;
- if (!defineQMLObject(&objIndex, 0, QQmlJS::AST::SourceLocation(), 0, 0))
+ if (!defineQMLObject(&objIndex, nullptr, QQmlJS::AST::SourceLocation(), nullptr, nullptr))
return false;
binding->value.objectIndex = objIndex;
@@ -1582,7 +1582,7 @@ QV4::CompiledData::Unit *QmlUnitGenerator::generate(Document &output, const QV4:
memset(data + unitSize, 0, totalSize - unitSize);
if (jsUnit != compilationUnit->data)
free(jsUnit);
- jsUnit = 0;
+ jsUnit = nullptr;
QV4::CompiledData::Unit *qmlUnit = reinterpret_cast<QV4::CompiledData::Unit *>(data);
qmlUnit->unitSize = totalSize;
@@ -1782,8 +1782,8 @@ JSCodeGen::JSCodeGen(const QString &sourceCode, QV4::Compiler::JSUnitGenerator *
, imports(imports)
, stringPool(stringPool)
, _disableAcceleratedLookups(false)
- , _contextObject(0)
- , _scopeObject(0)
+ , _contextObject(nullptr)
+ , _scopeObject(nullptr)
, _qmlContextSlot(-1)
, _importedScriptsSlot(-1)
, m_globalNames(globalNames)
@@ -1796,7 +1796,7 @@ void JSCodeGen::beginContextScope(const JSCodeGen::ObjectIdMapping &objectIds, Q
{
_idObjects = objectIds;
_contextObject = contextObject;
- _scopeObject = 0;
+ _scopeObject = nullptr;
}
void JSCodeGen::beginObjectScope(QQmlPropertyCache *scopeObject)
@@ -1809,7 +1809,7 @@ QVector<int> JSCodeGen::generateJSCodeForFunctionsAndBindings(const QList<Compil
QVector<int> runtimeFunctionIndices(functions.size());
QV4::Compiler::ScanFunctions scan(this, sourceCode, QV4::Compiler::GlobalCode);
- scan.enterEnvironment(0, QV4::Compiler::QmlBinding);
+ scan.enterEnvironment(nullptr, QV4::Compiler::QmlBinding);
scan.enterQmlScope(qmlRoot, QStringLiteral("context scope"));
for (const CompiledFunctionOrExpression &f : functions) {
Q_ASSERT(f.node != qmlRoot);
@@ -1826,7 +1826,7 @@ QVector<int> JSCodeGen::generateJSCodeForFunctionsAndBindings(const QList<Compil
scan.leaveEnvironment();
scan.leaveEnvironment();
- _context = 0;
+ _context = nullptr;
for (int i = 0; i < functions.count(); ++i) {
const CompiledFunctionOrExpression &qmlFunction = functions.at(i);
@@ -1845,7 +1845,7 @@ QVector<int> JSCodeGen::generateJSCodeForFunctionsAndBindings(const QList<Compil
QQmlJS::AST::SourceElements *body;
if (function)
- body = function->body ? function->body->elements : 0;
+ body = function->body ? function->body->elements : nullptr;
else {
// Synthesize source elements.
QQmlJS::MemoryPool *pool = jsEngine->pool();
@@ -1863,7 +1863,7 @@ QVector<int> JSCodeGen::generateJSCodeForFunctionsAndBindings(const QList<Compil
_disableAcceleratedLookups = qmlFunction.disableAcceleratedLookups;
int idx = defineFunction(name, node,
- function ? function->formals : 0,
+ function ? function->formals : nullptr,
body);
runtimeFunctionIndices[i] = idx;
}
@@ -1889,14 +1889,14 @@ int JSCodeGen::defineFunction(const QString &name, AST::Node *ast, AST::FormalPa
#ifndef V4_BOOTSTRAP
QQmlPropertyData *JSCodeGen::lookupQmlCompliantProperty(QQmlPropertyCache *cache, const QString &name)
{
- QQmlPropertyData *pd = cache->property(name, /*object*/0, /*context*/0);
+ QQmlPropertyData *pd = cache->property(name, /*object*/nullptr, /*context*/nullptr);
// Q_INVOKABLEs can't be FINAL, so we have to look them up at run-time
if (!pd || pd->isFunction())
- return 0;
+ return nullptr;
if (!cache->isAllowedInRevision(pd))
- return 0;
+ return nullptr;
return pd;
}
@@ -2273,7 +2273,7 @@ QQmlPropertyData *PropertyResolver::property(const QString &name, bool *notInRev
{
if (notInRevision) *notInRevision = false;
- QQmlPropertyData *d = cache->property(name, 0, 0);
+ QQmlPropertyData *d = cache->property(name, nullptr, nullptr);
// Find the first property
while (d && d->isFunction())
@@ -2281,7 +2281,7 @@ QQmlPropertyData *PropertyResolver::property(const QString &name, bool *notInRev
if (check != IgnoreRevision && d && !cache->isAllowedInRevision(d)) {
if (notInRevision) *notInRevision = true;
- return 0;
+ return nullptr;
} else {
return d;
}
@@ -2292,7 +2292,7 @@ QQmlPropertyData *PropertyResolver::signal(const QString &name, bool *notInRevis
{
if (notInRevision) *notInRevision = false;
- QQmlPropertyData *d = cache->property(name, 0, 0);
+ QQmlPropertyData *d = cache->property(name, nullptr, nullptr);
if (notInRevision) *notInRevision = false;
while (d && !(d->isFunction()))
@@ -2300,7 +2300,7 @@ QQmlPropertyData *PropertyResolver::signal(const QString &name, bool *notInRevis
if (d && !cache->isAllowedInRevision(d)) {
if (notInRevision) *notInRevision = true;
- return 0;
+ return nullptr;
} else if (d && d->isSignal()) {
return d;
}
@@ -2313,7 +2313,7 @@ QQmlPropertyData *PropertyResolver::signal(const QString &name, bool *notInRevis
return cache->signal(d->notifyIndex());
}
- return 0;
+ return nullptr;
}
IRLoader::IRLoader(const QV4::CompiledData::Unit *qmlData, QmlIR::Document *output)
@@ -2450,7 +2450,7 @@ QmlIR::Object *IRLoader::loadObject(const QV4::CompiledData::Object *serializedO
f->location = compiledFunction->location;
f->nameIndex = compiledFunction->nameIndex;
- QQmlJS::AST::FormalParameterList *paramList = 0;
+ QQmlJS::AST::FormalParameterList *paramList = nullptr;
const quint32_le *formalNameIdx = compiledFunction->formalsTable();
for (uint i = 0; i < compiledFunction->nFormals; ++i, ++formalNameIdx) {
const QString formal = unit->stringAt(*formalNameIdx);
@@ -2466,7 +2466,7 @@ QmlIR::Object *IRLoader::loadObject(const QV4::CompiledData::Object *serializedO
paramList = paramList->finish();
const QString name = unit->stringAt(compiledFunction->nameIndex);
- f->functionDeclaration = new(pool) QQmlJS::AST::FunctionDeclaration(jsParserEngine->newStringRef(name), paramList, /*body*/0);
+ f->functionDeclaration = new(pool) QQmlJS::AST::FunctionDeclaration(jsParserEngine->newStringRef(name), paramList, /*body*/nullptr);
f->formals.allocate(pool, int(compiledFunction->nFormals));
formalNameIdx = compiledFunction->formalsTable();
diff --git a/src/qml/compiler/qqmlirbuilder_p.h b/src/qml/compiler/qqmlirbuilder_p.h
index f8f8649fc7..673bc2c481 100644
--- a/src/qml/compiler/qqmlirbuilder_p.h
+++ b/src/qml/compiler/qqmlirbuilder_p.h
@@ -80,8 +80,8 @@ template <typename T>
struct PoolList
{
PoolList()
- : first(0)
- , last(0)
+ : first(nullptr)
+ , last(nullptr)
, count(0)
{}
@@ -90,7 +90,7 @@ struct PoolList
int count;
int append(T *item) {
- item->next = 0;
+ item->next = nullptr;
if (last)
last->next = item;
else
@@ -110,7 +110,7 @@ struct PoolList
template <typename Sortable, typename Base, Sortable Base::*sortMember>
T *findSortedInsertionPoint(T *item) const
{
- T *insertPos = 0;
+ T *insertPos = nullptr;
for (T *it = first; it; it = it->next) {
if (!(it->*sortMember <= item->*sortMember))
@@ -208,7 +208,7 @@ public:
int count;
FixedPoolArray()
- : data(0)
+ : data(nullptr)
, count(0)
{}
@@ -343,16 +343,16 @@ struct Function
struct Q_QML_PRIVATE_EXPORT CompiledFunctionOrExpression
{
CompiledFunctionOrExpression()
- : node(0)
+ : node(nullptr)
, nameIndex(0)
, disableAcceleratedLookups(false)
- , next(0)
+ , next(nullptr)
{}
CompiledFunctionOrExpression(QQmlJS::AST::Node *n)
: node(n)
, nameIndex(0)
, disableAcceleratedLookups(false)
- , next(0)
+ , next(nullptr)
{}
QQmlJS::AST::Node *node; // FunctionDeclaration, Statement or Expression
quint32 nameIndex;
@@ -514,8 +514,8 @@ public:
void accept(QQmlJS::AST::Node *node);
// returns index in _objects
- bool defineQMLObject(int *objectIndex, QQmlJS::AST::UiQualifiedId *qualifiedTypeNameId, const QQmlJS::AST::SourceLocation &location, QQmlJS::AST::UiObjectInitializer *initializer, Object *declarationsOverride = 0);
- bool defineQMLObject(int *objectIndex, QQmlJS::AST::UiObjectDefinition *node, Object *declarationsOverride = 0)
+ bool defineQMLObject(int *objectIndex, QQmlJS::AST::UiQualifiedId *qualifiedTypeNameId, const QQmlJS::AST::SourceLocation &location, QQmlJS::AST::UiObjectInitializer *initializer, Object *declarationsOverride = nullptr);
+ bool defineQMLObject(int *objectIndex, QQmlJS::AST::UiObjectDefinition *node, Object *declarationsOverride = nullptr)
{ return defineQMLObject(objectIndex, node->qualifiedTypeNameId, node->qualifiedTypeNameId->firstSourceLocation(), node->initializer, declarationsOverride); }
static QString asString(QQmlJS::AST::UiQualifiedId *node);
@@ -598,7 +598,7 @@ struct Q_QML_EXPORT PropertyResolver
IgnoreRevision
};
- QQmlPropertyData *property(const QString &name, bool *notInRevision = 0, RevisionCheck check = CheckRevision) const;
+ QQmlPropertyData *property(const QString &name, bool *notInRevision = nullptr, RevisionCheck check = CheckRevision) const;
// This code must match the semantics of QQmlPropertyPrivate::findSignalByName
QQmlPropertyData *signal(const QString &name, bool *notInRevision) const;
diff --git a/src/qml/compiler/qqmlpropertycachecreator_p.h b/src/qml/compiler/qqmlpropertycachecreator_p.h
index 7a52f3a12c..2af0fe0036 100644
--- a/src/qml/compiler/qqmlpropertycachecreator_p.h
+++ b/src/qml/compiler/qqmlpropertycachecreator_p.h
@@ -214,7 +214,7 @@ inline QQmlPropertyCache *QQmlPropertyCacheCreator<ObjectContainer>::propertyCac
QQmlType qmltype = typeRef->type;
if (!qmltype.isValid()) {
QString propertyName = stringAt(context.instantiatingBinding->propertyNameIndex);
- if (imports->resolveType(propertyName, &qmltype, 0, 0, 0)) {
+ if (imports->resolveType(propertyName, &qmltype, nullptr, nullptr, nullptr)) {
if (qmltype.isComposite()) {
QQmlTypeData *tdata = enginePrivate->typeLoader.getType(qmltype.sourceUrl());
Q_ASSERT(tdata);
@@ -411,7 +411,7 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj
Q_ASSERT(param->type == QV4::CompiledData::Property::Custom);
const QString customTypeName = stringAt(param->customTypeNameIndex);
QQmlType qmltype;
- if (!imports->resolveType(customTypeName, &qmltype, 0, 0, 0))
+ if (!imports->resolveType(customTypeName, &qmltype, nullptr, nullptr, nullptr))
return QQmlCompileError(s->location, QQmlPropertyCacheCreatorBase::tr("Invalid signal parameter type: %1").arg(customTypeName));
if (qmltype.isComposite()) {
@@ -441,7 +441,7 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj
seenSignals.insert(signalName);
cache->appendSignal(signalName, flags, effectiveMethodIndex++,
- paramCount?paramTypes.constData():0, names);
+ paramCount?paramTypes.constData():nullptr, names);
}
@@ -492,7 +492,7 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj
p->type == QV4::CompiledData::Property::Custom);
QQmlType qmltype;
- if (!imports->resolveType(stringAt(p->customTypeNameIndex), &qmltype, 0, 0, 0)) {
+ if (!imports->resolveType(stringAt(p->customTypeNameIndex), &qmltype, nullptr, nullptr, nullptr)) {
return QQmlCompileError(p->location, QQmlPropertyCacheCreatorBase::tr("Invalid property type"));
}
diff --git a/src/qml/compiler/qqmlpropertyvalidator.cpp b/src/qml/compiler/qqmlpropertyvalidator.cpp
index 3aa8befa2c..00bb694ef4 100644
--- a/src/qml/compiler/qqmlpropertyvalidator.cpp
+++ b/src/qml/compiler/qqmlpropertyvalidator.cpp
@@ -58,7 +58,7 @@ QQmlPropertyValidator::QQmlPropertyValidator(QQmlEnginePrivate *enginePrivate, c
QVector<QQmlCompileError> QQmlPropertyValidator::validate()
{
- return validateObject(/*root object*/0, /*instantiatingBinding*/0);
+ return validateObject(/*root object*/0, /*instantiatingBinding*/nullptr);
}
typedef QVarLengthArray<const QV4::CompiledData::Binding *, 8> GroupPropertyVector;
@@ -94,7 +94,7 @@ QVector<QQmlCompileError> QQmlPropertyValidator::validateObject(int objectIndex,
if (!propertyCache)
return QVector<QQmlCompileError>();
- QQmlCustomParser *customParser = 0;
+ QQmlCustomParser *customParser = nullptr;
if (auto typeRef = resolvedTypes.value(obj->inheritedTypeNameIndex)) {
if (typeRef->type.isValid())
customParser = typeRef->type.customParser();
@@ -124,7 +124,7 @@ QVector<QQmlCompileError> QQmlPropertyValidator::validateObject(int objectIndex,
QmlIR::PropertyResolver propertyResolver(propertyCache);
QString defaultPropertyName;
- QQmlPropertyData *defaultProperty = 0;
+ QQmlPropertyData *defaultProperty = nullptr;
if (obj->indexOfDefaultPropertyOrAlias != -1) {
QQmlPropertyCache *cache = propertyCache->parent();
defaultPropertyName = cache->defaultPropertyName();
@@ -157,7 +157,7 @@ QVector<QQmlCompileError> QQmlPropertyValidator::validateObject(int objectIndex,
bool isGroupProperty = instantiatingBinding && instantiatingBinding->type == QV4::CompiledData::Binding::Type_GroupProperty;
bool notInRevision = false;
- QQmlPropertyData *pd = 0;
+ QQmlPropertyData *pd = nullptr;
if (!name.isEmpty()) {
if (binding->flags & QV4::CompiledData::Binding::IsSignalHandlerExpression
|| binding->flags & QV4::CompiledData::Binding::IsSignalHandlerObject)
@@ -188,8 +188,8 @@ QVector<QQmlCompileError> QQmlPropertyValidator::validateObject(int objectIndex,
if (name.constData()->isUpper() && !binding->isAttachedProperty()) {
QQmlType type;
- QQmlImportNamespace *typeNamespace = 0;
- imports.resolveType(stringAt(binding->propertyNameIndex), &type, 0, 0, &typeNamespace);
+ QQmlImportNamespace *typeNamespace = nullptr;
+ imports.resolveType(stringAt(binding->propertyNameIndex), &type, nullptr, nullptr, &typeNamespace);
if (typeNamespace)
return recordError(binding->location, tr("Invalid use of namespace"));
return recordError(binding->location, tr("Invalid attached object assignment"));
@@ -306,9 +306,9 @@ QVector<QQmlCompileError> QQmlPropertyValidator::validateObject(int objectIndex,
customParser->engine = enginePrivate;
customParser->imports = &imports;
customParser->verifyBindings(qmlUnit, customBindings);
- customParser->validator = 0;
- customParser->engine = 0;
- customParser->imports = (QQmlImports*)0;
+ customParser->validator = nullptr;
+ customParser->engine = nullptr;
+ customParser->imports = (QQmlImports*)nullptr;
QVector<QQmlCompileError> parserErrors = customParser->errors();
if (!parserErrors.isEmpty())
return parserErrors;
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp
index ac373aafb4..3415e1c073 100644
--- a/src/qml/compiler/qqmltypecompiler.cpp
+++ b/src/qml/compiler/qqmltypecompiler.cpp
@@ -332,7 +332,7 @@ bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclaratio
auto *typeRef = resolvedTypes.value(binding->propertyNameIndex);
QQmlType type = typeRef ? typeRef->type : QQmlType();
if (!type.isValid()) {
- if (imports->resolveType(propertyName, &type, 0, 0, 0)) {
+ if (imports->resolveType(propertyName, &type, nullptr, nullptr, nullptr)) {
if (type.isComposite()) {
QQmlTypeData *tdata = enginePrivate->typeLoader.getType(type.sourceUrl());
Q_ASSERT(tdata);
@@ -397,7 +397,7 @@ bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclaratio
} else {
if (notInRevision) {
// Try assinging it as a property later
- if (resolver.property(propertyName, /*notInRevision ptr*/0))
+ if (resolver.property(propertyName, /*notInRevision ptr*/nullptr))
continue;
const QString &originalPropertyName = stringAt(binding->propertyNameIndex);
@@ -457,7 +457,7 @@ bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclaratio
QQmlJS::MemoryPool *pool = compiler->memoryPool();
- QQmlJS::AST::FormalParameterList *paramList = 0;
+ QQmlJS::AST::FormalParameterList *paramList = nullptr;
for (const QString &param : qAsConst(parameters)) {
QStringRef paramNameRef = compiler->newStringRef(param);
@@ -471,7 +471,7 @@ bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclaratio
paramList = paramList->finish();
QmlIR::CompiledFunctionOrExpression *foe = obj->functionsAndExpressions->slowAt(binding->value.compiledScriptIndex);
- QQmlJS::AST::FunctionDeclaration *functionDeclaration = 0;
+ QQmlJS::AST::FunctionDeclaration *functionDeclaration = nullptr;
if (QQmlJS::AST::ExpressionStatement *es = QQmlJS::AST::cast<QQmlJS::AST::ExpressionStatement*>(foe->node)) {
if (QQmlJS::AST::FunctionExpression *fe = QQmlJS::AST::cast<QQmlJS::AST::FunctionExpression*>(es->expression)) {
functionDeclaration = new (pool) QQmlJS::AST::FunctionDeclaration(fe->name, fe->formals, fe->body);
@@ -611,7 +611,7 @@ bool QQmlEnumTypeResolver::tryQualifiedEnumAssignment(const QmlIR::Object *obj,
return true;
}
QQmlType type;
- imports->resolveType(typeName, &type, 0, 0, 0);
+ imports->resolveType(typeName, &type, nullptr, nullptr, nullptr);
if (!type.isValid() && !isQtObject)
return true;
@@ -663,7 +663,7 @@ int QQmlEnumTypeResolver::evaluateEnum(const QString &scope, const QStringRef &e
if (scope != QLatin1String("Qt")) {
QQmlType type;
- imports->resolveType(scope, &type, 0, 0, 0);
+ imports->resolveType(scope, &type, nullptr, nullptr, nullptr);
if (!type.isValid())
return -1;
if (!enumName.isEmpty())
@@ -814,7 +814,7 @@ void QQmlComponentAndAliasResolver::findAndRegisterImplicitComponents(const QmlI
continue;
}
- QQmlPropertyData *pd = 0;
+ QQmlPropertyData *pd = nullptr;
if (binding->propertyNameIndex != quint32(0)) {
bool notInRevision = false;
pd = propertyResolver.property(stringAt(binding->propertyNameIndex), &notInRevision);
@@ -825,7 +825,7 @@ void QQmlComponentAndAliasResolver::findAndRegisterImplicitComponents(const QmlI
continue;
QQmlPropertyCache *pc = enginePrivate->rawPropertyCacheForType(pd->propType(), pd->typeMinorVersion());
- const QMetaObject *mo = pc ? pc->firstCppMetaObject() : 0;
+ const QMetaObject *mo = pc ? pc->firstCppMetaObject() : nullptr;
while (mo) {
if (mo == &QQmlComponent::staticMetaObject)
break;
@@ -1204,7 +1204,7 @@ bool QQmlDeferredAndCustomParserBindingScanner::scanObject(int objectIndex)
return true;
QString defaultPropertyName;
- QQmlPropertyData *defaultProperty = 0;
+ QQmlPropertyData *defaultProperty = nullptr;
if (obj->indexOfDefaultPropertyOrAlias != -1) {
QQmlPropertyCache *cache = propertyCache->parent();
defaultPropertyName = cache->defaultPropertyName();
@@ -1229,7 +1229,7 @@ bool QQmlDeferredAndCustomParserBindingScanner::scanObject(int objectIndex)
}
for (QmlIR::Binding *binding = obj->firstBinding(); binding; binding = binding->next) {
- QQmlPropertyData *pd = 0;
+ QQmlPropertyData *pd = nullptr;
QString name = stringAt(binding->propertyNameIndex);
if (customParser) {
@@ -1334,7 +1334,7 @@ bool QQmlJSCodeGenerator::compileComponent(int contextObject)
auto *tref = resolvedTypes.value(obj->inheritedTypeNameIndex);
if (tref && tref->isFullyDynamicType)
- m.type = 0;
+ m.type = nullptr;
idMapping << m;
}
@@ -1412,10 +1412,10 @@ void QQmlDefaultPropertyMerger::mergeDefaultProperties(int objectIndex)
QmlIR::Object *object = qmlObjects.at(objectIndex);
QString defaultProperty = object->indexOfDefaultPropertyOrAlias != -1 ? propertyCache->parent()->defaultPropertyName() : propertyCache->defaultPropertyName();
- QmlIR::Binding *bindingsToReinsert = 0;
- QmlIR::Binding *tail = 0;
+ QmlIR::Binding *bindingsToReinsert = nullptr;
+ QmlIR::Binding *tail = nullptr;
- QmlIR::Binding *previousBinding = 0;
+ QmlIR::Binding *previousBinding = nullptr;
QmlIR::Binding *binding = object->firstBinding();
while (binding) {
if (binding->propertyNameIndex == quint32(0) || stringAt(binding->propertyNameIndex) != defaultProperty) {
@@ -1434,7 +1434,7 @@ void QQmlDefaultPropertyMerger::mergeDefaultProperties(int objectIndex)
tail->next = toReinsert;
tail = tail->next;
}
- tail->next = 0;
+ tail->next = nullptr;
}
binding = bindingsToReinsert;
diff --git a/src/qml/compiler/qv4bytecodegenerator_p.h b/src/qml/compiler/qv4bytecodegenerator_p.h
index 3d516da922..3b3c766bfe 100644
--- a/src/qml/compiler/qv4bytecodegenerator_p.h
+++ b/src/qml/compiler/qv4bytecodegenerator_p.h
@@ -94,7 +94,7 @@ public:
generator->labels[index] = generator->instructions.size();
}
- BytecodeGenerator *generator = 0;
+ BytecodeGenerator *generator = nullptr;
int index = -1;
};
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index f236683506..eb5772e1bc 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -89,10 +89,10 @@ static inline void setJumpOutLocation(QV4::Moth::BytecodeGenerator *bytecodeGene
}
Codegen::Codegen(QV4::Compiler::JSUnitGenerator *jsUnitGenerator, bool strict)
- : _module(0)
+ : _module(nullptr)
, _returnAddress(0)
- , _context(0)
- , _labelledStatement(0)
+ , _context(nullptr)
+ , _labelledStatement(nullptr)
, jsUnitGenerator(jsUnitGenerator)
, _strictMode(strict)
, _fileNameIsUrl(false)
@@ -111,7 +111,7 @@ void Codegen::generateFromProgram(const QString &fileName,
Q_ASSERT(node);
_module = module;
- _context = 0;
+ _context = nullptr;
// ### should be set on the module outside of this method
_module->fileName = fileName;
@@ -120,7 +120,7 @@ void Codegen::generateFromProgram(const QString &fileName,
ScanFunctions scan(this, sourceCode, mode);
scan(node);
- defineFunction(QStringLiteral("%entry"), node, 0, node->elements);
+ defineFunction(QStringLiteral("%entry"), node, nullptr, node->elements);
}
void Codegen::enterContext(Node *node)
@@ -635,14 +635,14 @@ bool Codegen::visit(ArrayLiteral *ast)
for (ElementList *it = ast->elements; it; it = it->next) {
for (Elision *elision = it->elision; elision; elision = elision->next)
- push(0);
+ push(nullptr);
push(it->expression);
if (hasError)
return false;
}
for (Elision *elision = ast->elision; elision; elision = elision->next)
- push(0);
+ push(nullptr);
if (args == -1) {
Q_ASSERT(argc == 0);
@@ -1496,7 +1496,7 @@ bool Codegen::visit(FunctionExpression *ast)
RegisterScope scope(this);
- int function = defineFunction(ast->name.toString(), ast, ast->formals, ast->body ? ast->body->elements : 0);
+ int function = defineFunction(ast->name.toString(), ast, ast->formals, ast->body ? ast->body->elements : nullptr);
loadClosure(function);
_expr.setResult(Reference::fromAccumulator(this));
return false;
@@ -1720,7 +1720,7 @@ bool Codegen::visit(ObjectLiteral *ast)
v.rvalue = value.storeOnStack();
} else if (PropertyGetterSetter *gs = AST::cast<AST::PropertyGetterSetter *>(it->assignment)) {
- const int function = defineFunction(name, gs, gs->formals, gs->functionBody ? gs->functionBody->elements : 0);
+ const int function = defineFunction(name, gs, gs->formals, gs->functionBody ? gs->functionBody->elements : nullptr);
ObjectPropertyValue &v = valueMap[name];
if (v.rvalue.isValid() ||
(gs->type == PropertyGetterSetter::Getter && v.hasGetter()) ||
@@ -2142,7 +2142,7 @@ int Codegen::defineFunction(const QString &name, AST::Node *ast,
for (const Context::Member &member : qAsConst(_context->members)) {
if (member.function) {
const int function = defineFunction(member.function->name.toString(), member.function, member.function->formals,
- member.function->body ? member.function->body->elements : 0);
+ member.function->body ? member.function->body->elements : nullptr);
loadClosure(function);
if (! _context->parent) {
Reference::fromName(this, member.function->name.toString()).storeConsumeAccumulator();
diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h
index e52f63e1f4..27c8e96e16 100644
--- a/src/qml/compiler/qv4codegen_p.h
+++ b/src/qml/compiler/qv4codegen_p.h
@@ -423,8 +423,8 @@ protected:
}
explicit Result(Format requested = ex)
- : _iftrue(0)
- , _iffalse(0)
+ : _iftrue(nullptr)
+ , _iffalse(nullptr)
, _format(ex)
, _requested(requested) {}
@@ -671,7 +671,7 @@ protected:
Context *_context;
AST::LabelledStatement *_labelledStatement;
QV4::Compiler::JSUnitGenerator *jsUnitGenerator;
- BytecodeGenerator *bytecodeGenerator = 0;
+ BytecodeGenerator *bytecodeGenerator = nullptr;
bool _strictMode;
bool useFastLookups = true;
bool requiresReturnValue = false;
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index 05869c3287..cc11b250f3 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -109,7 +109,7 @@ CompilationUnit::~CompilationUnit()
unlink();
if (data && !(data->flags & QV4::CompiledData::Unit::StaticData))
free(const_cast<Unit *>(data));
- data = 0;
+ data = nullptr;
}
QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine)
@@ -201,7 +201,7 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine)
if (data->indexOfRootFunction != -1)
return runtimeFunctions[data->indexOfRootFunction];
else
- return 0;
+ return nullptr;
}
void CompilationUnit::unlink()
@@ -228,16 +228,16 @@ void CompilationUnit::unlink()
qDeleteAll(resolvedTypes);
resolvedTypes.clear();
- engine = 0;
- qmlEngine = 0;
+ engine = nullptr;
+ qmlEngine = nullptr;
free(runtimeStrings);
- runtimeStrings = 0;
+ runtimeStrings = nullptr;
delete [] runtimeLookups;
- runtimeLookups = 0;
+ runtimeLookups = nullptr;
delete [] runtimeRegularExpressions;
- runtimeRegularExpressions = 0;
+ runtimeRegularExpressions = nullptr;
free(runtimeClasses);
- runtimeClasses = 0;
+ runtimeClasses = nullptr;
qDeleteAll(runtimeFunctions);
runtimeFunctions.clear();
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
@@ -676,7 +676,7 @@ bool qtTypeInherits(const QMetaObject *mo) {
void ResolvedTypeReference::doDynamicTypeCheck()
{
- const QMetaObject *mo = 0;
+ const QMetaObject *mo = nullptr;
if (typePropertyCache)
mo = typePropertyCache->firstCppMetaObject();
else if (type.isValid())
diff --git a/src/qml/compiler/qv4compilercontext_p.h b/src/qml/compiler/qv4compilercontext_p.h
index bd68ea513e..d375942d0e 100644
--- a/src/qml/compiler/qv4compilercontext_p.h
+++ b/src/qml/compiler/qv4compilercontext_p.h
@@ -120,7 +120,7 @@ struct Context {
int index = -1;
QQmlJS::AST::VariableDeclaration::VariableScope scope = QQmlJS::AST::VariableDeclaration::FunctionScope;
mutable bool canEscape = false;
- QQmlJS::AST::FunctionExpression *function = 0;
+ QQmlJS::AST::FunctionExpression *function = nullptr;
bool isLexicallyScoped() const { return this->scope != QQmlJS::AST::VariableDeclaration::FunctionScope; }
};
@@ -128,12 +128,12 @@ struct Context {
MemberMap members;
QSet<QString> usedVariables;
- QQmlJS::AST::FormalParameterList *formals = 0;
+ QQmlJS::AST::FormalParameterList *formals = nullptr;
QStringList arguments;
QStringList locals;
QVector<Context *> nestedContexts;
- ControlFlow *controlFlow = 0;
+ ControlFlow *controlFlow = nullptr;
QByteArray code;
QVector<CompiledData::CodeOffsetToLine> lineNumberMapping;
@@ -245,7 +245,7 @@ struct Context {
Q_ASSERT(m);
MemberMap::const_iterator it = members.find(name);
if (it == members.end()) {
- *m = 0;
+ *m = nullptr;
return false;
}
*m = &(*it);
@@ -256,7 +256,7 @@ struct Context {
usedVariables.insert(name);
}
- void addLocalVar(const QString &name, MemberType type, QQmlJS::AST::VariableDeclaration::VariableScope scope, QQmlJS::AST::FunctionExpression *function = 0)
+ void addLocalVar(const QString &name, MemberType type, QQmlJS::AST::VariableDeclaration::VariableScope scope, QQmlJS::AST::FunctionExpression *function = nullptr)
{
if (! name.isEmpty()) {
if (type != FunctionDefinition) {
diff --git a/src/qml/compiler/qv4compilercontrolflow_p.h b/src/qml/compiler/qv4compilercontrolflow_p.h
index 13716fe29f..9bda20905a 100644
--- a/src/qml/compiler/qv4compilercontrolflow_p.h
+++ b/src/qml/compiler/qv4compilercontrolflow_p.h
@@ -159,7 +159,7 @@ struct ControlFlow {
virtual Handler getHandler(HandlerType type, const QString &label = QString()) = 0;
BytecodeGenerator::ExceptionHandler *parentExceptionHandler() {
- return parent ? parent->exceptionHandler() : 0;
+ return parent ? parent->exceptionHandler() : nullptr;
}
virtual BytecodeGenerator::ExceptionHandler *exceptionHandler() {
@@ -184,7 +184,7 @@ protected:
QString label;
if (cg->_labelledStatement) {
label = cg->_labelledStatement->label.toString();
- cg->_labelledStatement = 0;
+ cg->_labelledStatement = nullptr;
}
return label;
}
@@ -196,10 +196,10 @@ protected:
struct ControlFlowLoop : public ControlFlow
{
QString loopLabel;
- BytecodeGenerator::Label *breakLabel = 0;
- BytecodeGenerator::Label *continueLabel = 0;
+ BytecodeGenerator::Label *breakLabel = nullptr;
+ BytecodeGenerator::Label *continueLabel = nullptr;
- ControlFlowLoop(Codegen *cg, BytecodeGenerator::Label *breakLabel, BytecodeGenerator::Label *continueLabel = 0)
+ ControlFlowLoop(Codegen *cg, BytecodeGenerator::Label *breakLabel, BytecodeGenerator::Label *continueLabel = nullptr)
: ControlFlow(cg, Loop), loopLabel(ControlFlow::loopLabel()), breakLabel(breakLabel), continueLabel(continueLabel)
{
}
@@ -407,7 +407,7 @@ struct ControlFlowFinally : public ControlFlowUnwind
ControlFlowFinally(Codegen *cg, AST::Finally *finally)
: ControlFlowUnwind(cg, Finally), finally(finally)
{
- Q_ASSERT(finally != 0);
+ Q_ASSERT(finally != nullptr);
generator()->setExceptionHandler(&unwindLabel);
}
diff --git a/src/qml/compiler/qv4compilerscanfunctions.cpp b/src/qml/compiler/qv4compilerscanfunctions.cpp
index 808e79959d..89f602b409 100644
--- a/src/qml/compiler/qv4compilerscanfunctions.cpp
+++ b/src/qml/compiler/qv4compilerscanfunctions.cpp
@@ -59,7 +59,7 @@ using namespace QQmlJS::AST;
ScanFunctions::ScanFunctions(Codegen *cg, const QString &sourceCode, CompilationMode defaultProgramMode)
: _cg(cg)
, _sourceCode(sourceCode)
- , _context(0)
+ , _context(nullptr)
, _allowFuncDecls(true)
, defaultProgramMode(defaultProgramMode)
{
@@ -208,7 +208,7 @@ bool ScanFunctions::visit(VariableDeclaration *ast)
return false;
}
QString name = ast->name.toString();
- const Context::Member *m = 0;
+ const Context::Member *m = nullptr;
if (_context->memberInfo(name, &m)) {
if (m->isLexicallyScoped() || ast->isLexicallyScoped()) {
_cg->throwSyntaxError(ast->identifierToken, QStringLiteral("Identifier %1 has already been declared").arg(name));
@@ -258,7 +258,7 @@ void ScanFunctions::enterFunction(FunctionExpression *ast, bool enterName)
{
if (_context->isStrict && (ast->name == QLatin1String("eval") || ast->name == QLatin1String("arguments")))
_cg->throwSyntaxError(ast->identifierToken, QStringLiteral("Function name may not be eval or arguments in strict mode"));
- enterFunction(ast, ast->name.toString(), ast->formals, ast->body, enterName ? ast : 0);
+ enterFunction(ast, ast->name.toString(), ast->formals, ast->body, enterName ? ast : nullptr);
}
void ScanFunctions::endVisit(FunctionExpression *)
@@ -287,7 +287,7 @@ bool ScanFunctions::visit(ObjectLiteral *ast)
bool ScanFunctions::visit(PropertyGetterSetter *ast)
{
TemporaryBoolAssignment allowFuncDecls(_allowFuncDecls, true);
- enterFunction(ast, QString(), ast->formals, ast->functionBody, /*FunctionExpression*/0);
+ enterFunction(ast, QString(), ast->formals, ast->functionBody, /*FunctionExpression*/nullptr);
return true;
}
diff --git a/src/qml/compiler/qv4compilerscanfunctions_p.h b/src/qml/compiler/qv4compilerscanfunctions_p.h
index 526278fdd8..745e9f8a73 100644
--- a/src/qml/compiler/qv4compilerscanfunctions_p.h
+++ b/src/qml/compiler/qv4compilerscanfunctions_p.h
@@ -88,7 +88,7 @@ public:
void leaveEnvironment();
void enterQmlScope(AST::Node *ast, const QString &name)
- { enterFunction(ast, name, /*formals*/0, /*body*/0, /*expr*/0); }
+ { enterFunction(ast, name, /*formals*/nullptr, /*body*/nullptr, /*expr*/nullptr); }
void enterQmlFunction(AST::FunctionDeclaration *ast)
{ enterFunction(ast, false); }
diff --git a/src/qml/debugger/qqmlabstractprofileradapter_p.h b/src/qml/debugger/qqmlabstractprofileradapter_p.h
index 5d1b339324..f86855e964 100644
--- a/src/qml/debugger/qqmlabstractprofileradapter_p.h
+++ b/src/qml/debugger/qqmlabstractprofileradapter_p.h
@@ -68,8 +68,8 @@ class Q_QML_PRIVATE_EXPORT QQmlAbstractProfilerAdapter : public QObject, public
public:
static const int s_numMessagesPerBatch = 1000;
- QQmlAbstractProfilerAdapter(QObject *parent = 0) :
- QObject(parent), service(0), waiting(true), featuresEnabled(0) {}
+ QQmlAbstractProfilerAdapter(QObject *parent = nullptr) :
+ QObject(parent), service(nullptr), waiting(true), featuresEnabled(0) {}
virtual ~QQmlAbstractProfilerAdapter() {}
void setService(QQmlProfilerService *new_service) { service = new_service; }
diff --git a/src/qml/debugger/qqmlconfigurabledebugservice_p.h b/src/qml/debugger/qqmlconfigurabledebugservice_p.h
index e09d5f779a..96ec46f475 100644
--- a/src/qml/debugger/qqmlconfigurabledebugservice_p.h
+++ b/src/qml/debugger/qqmlconfigurabledebugservice_p.h
@@ -63,7 +63,7 @@ template <class Base>
class QQmlConfigurableDebugService : public Base
{
protected:
- QQmlConfigurableDebugService(float version, QObject *parent = 0) :
+ QQmlConfigurableDebugService(float version, QObject *parent = nullptr) :
Base(version, parent), m_configMutex(QMutex::Recursive)
{
init();
diff --git a/src/qml/debugger/qqmldebugconnector.cpp b/src/qml/debugger/qqmldebugconnector.cpp
index 01f74f08be..d9f51ce09f 100644
--- a/src/qml/debugger/qqmldebugconnector.cpp
+++ b/src/qml/debugger/qqmldebugconnector.cpp
@@ -66,7 +66,7 @@ struct QQmlDebugConnectorParams {
QString arguments;
QQmlDebugConnector *instance;
- QQmlDebugConnectorParams() : instance(0)
+ QQmlDebugConnectorParams() : instance(nullptr)
{
if (qApp) {
QCoreApplicationPrivate *appD =
@@ -109,7 +109,7 @@ QQmlDebugConnector *QQmlDebugConnector::instance()
{
QQmlDebugConnectorParams *params = qmlDebugConnectorParams();
if (!params)
- return 0;
+ return nullptr;
if (!QQmlEnginePrivate::qml_debugging_enabled) {
if (!params->arguments.isEmpty()) {
@@ -118,14 +118,14 @@ QQmlDebugConnector *QQmlDebugConnector::instance()
"has not been enabled.").arg(params->arguments);
params->arguments.clear();
}
- return 0;
+ return nullptr;
}
if (!params->instance) {
if (!params->pluginKey.isEmpty()) {
params->instance = loadQQmlDebugConnector(params->pluginKey);
} else if (params->arguments.isEmpty()) {
- return 0; // no explicit class name given and no command line arguments
+ return nullptr; // no explicit class name given and no command line arguments
} else if (params->arguments.startsWith(QLatin1String("connector:"))) {
static const int connectorBegin = int(strlen("connector:"));
@@ -169,7 +169,7 @@ QQmlDebugConnectorFactory::~QQmlDebugConnectorFactory()
params->arguments.clear();
params->services.clear();
delete params->instance;
- params->instance = 0;
+ params->instance = nullptr;
}
}
diff --git a/src/qml/debugger/qqmldebugconnector_p.h b/src/qml/debugger/qqmldebugconnector_p.h
index a2a6f5047d..cead6af338 100644
--- a/src/qml/debugger/qqmldebugconnector_p.h
+++ b/src/qml/debugger/qqmldebugconnector_p.h
@@ -114,7 +114,7 @@ public:
static Service *service()
{
QQmlDebugConnector *inst = instance();
- return inst ? static_cast<Service *>(inst->service(Service::s_key)) : 0;
+ return inst ? static_cast<Service *>(inst->service(Service::s_key)) : nullptr;
}
protected:
diff --git a/src/qml/debugger/qqmldebugserverconnection_p.h b/src/qml/debugger/qqmldebugserverconnection_p.h
index 536ad830b4..9c4af4d225 100644
--- a/src/qml/debugger/qqmldebugserverconnection_p.h
+++ b/src/qml/debugger/qqmldebugserverconnection_p.h
@@ -61,7 +61,7 @@ class Q_QML_PRIVATE_EXPORT QQmlDebugServerConnection : public QObject
{
Q_OBJECT
public:
- QQmlDebugServerConnection(QObject *parent = 0) : QObject(parent) {}
+ QQmlDebugServerConnection(QObject *parent = nullptr) : QObject(parent) {}
virtual void setServer(QQmlDebugServer *server) = 0;
virtual bool setPortRange(int portFrom, int portTo, bool block, const QString &hostaddress) = 0;
diff --git a/src/qml/debugger/qqmldebugservice_p.h b/src/qml/debugger/qqmldebugservice_p.h
index 34bbd631ec..e9f7d2d396 100644
--- a/src/qml/debugger/qqmldebugservice_p.h
+++ b/src/qml/debugger/qqmldebugservice_p.h
@@ -93,7 +93,7 @@ public:
static QObject *objectForId(int id) { return objectsForIds().value(id); }
protected:
- explicit QQmlDebugService(const QString &, float version, QObject *parent = 0);
+ explicit QQmlDebugService(const QString &, float version, QObject *parent = nullptr);
signals:
void attachedToEngine(QJSEngine *);
diff --git a/src/qml/debugger/qqmlprofiler_p.h b/src/qml/debugger/qqmlprofiler_p.h
index 58db26f2ac..deb4d107d6 100644
--- a/src/qml/debugger/qqmlprofiler_p.h
+++ b/src/qml/debugger/qqmlprofiler_p.h
@@ -450,7 +450,7 @@ struct QQmlCompilingProfiler : public QQmlProfilerHelper {
struct QQmlVmeProfiler : public QQmlProfilerDefinitions {
public:
- QQmlVmeProfiler() : profiler(0) {}
+ QQmlVmeProfiler() : profiler(nullptr) {}
void init(QQmlProfiler *p, int maxDepth)
{
diff --git a/src/qml/jit/qv4assembler.cpp b/src/qml/jit/qv4assembler.cpp
index fdb795be92..186e5952da 100644
--- a/src/qml/jit/qv4assembler.cpp
+++ b/src/qml/jit/qv4assembler.cpp
@@ -1319,7 +1319,7 @@ class QIODevicePrintStream: public FilePrintStream
public:
explicit QIODevicePrintStream(QIODevice *dest)
- : FilePrintStream(0)
+ : FilePrintStream(nullptr)
, dest(dest)
, buf(4096, '0')
{
@@ -1373,7 +1373,7 @@ void Assembler::link(Function *function)
jumpTarget.jump.linkTo(pasm()->labelsByOffset[jumpTarget.offset], pasm());
JSC::JSGlobalData dummy(function->internalClass->engine->executableAllocator);
- JSC::LinkBuffer<PlatformAssembler::MacroAssembler> linkBuffer(dummy, pasm(), 0);
+ JSC::LinkBuffer<PlatformAssembler::MacroAssembler> linkBuffer(dummy, pasm(), nullptr);
for (const auto &ehTarget : pasm()->ehTargets) {
auto targetLabel = pasm()->labelsByOffset.value(ehTarget.offset);
diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp
index 1c1314f05d..c483af638b 100644
--- a/src/qml/jsapi/qjsengine.cpp
+++ b/src/qml/jsapi/qjsengine.cpp
@@ -783,7 +783,7 @@ QJSEngine *qjsEngine(const QObject *object)
{
QQmlData *data = QQmlData::get(object, false);
if (!data || data->jsWrapper.isNullOrUndefined())
- return 0;
+ return nullptr;
return data->jsWrapper.engine()->jsEngine();
}
diff --git a/src/qml/jsapi/qjsengine_p.h b/src/qml/jsapi/qjsengine_p.h
index cbfe0f14a3..1ea1d77851 100644
--- a/src/qml/jsapi/qjsengine_p.h
+++ b/src/qml/jsapi/qjsengine_p.h
@@ -163,7 +163,7 @@ QQmlPropertyCache until the QQmlEngine is destroyed.
QQmlPropertyCache *QJSEnginePrivate::cache(QObject *obj)
{
if (!obj || QObjectPrivate::get(obj)->metaObject || QObjectPrivate::get(obj)->wasDeleted)
- return 0;
+ return nullptr;
Locker locker(this);
const QMetaObject *mo = obj->metaObject();
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp
index c4090ac482..b97468ab7b 100644
--- a/src/qml/jsapi/qjsvalue.cpp
+++ b/src/qml/jsapi/qjsvalue.cpp
@@ -662,7 +662,7 @@ QVariant QJSValue::toVariant() const
return QVariant(val->asDouble());
}
if (val->isNull())
- return QVariant(QMetaType::Nullptr, 0);
+ return QVariant(QMetaType::Nullptr, nullptr);
Q_ASSERT(val->isUndefined());
return QVariant();
}
@@ -831,7 +831,7 @@ QJSEngine* QJSValue::engine() const
QV4::ExecutionEngine *engine = QJSValuePrivate::engine(this);
if (engine)
return engine->jsEngine();
- return 0;
+ return nullptr;
}
#endif // QT_DEPRECATED
@@ -884,7 +884,7 @@ void QJSValue::setPrototype(const QJSValue& prototype)
if (!val)
return;
if (val->isNull()) {
- o->setPrototype(0);
+ o->setPrototype(nullptr);
return;
}
@@ -1308,11 +1308,11 @@ QObject *QJSValue::toQObject() const
{
QV4::ExecutionEngine *engine = QJSValuePrivate::engine(this);
if (!engine)
- return 0;
+ return nullptr;
QV4::Scope scope(engine);
QV4::Scoped<QV4::QObjectWrapper> wrapper(scope, QJSValuePrivate::getValue(this));
if (!wrapper)
- return 0;
+ return nullptr;
return wrapper->object();
}
@@ -1329,11 +1329,11 @@ const QMetaObject *QJSValue::toQMetaObject() const
{
QV4::ExecutionEngine *engine = QJSValuePrivate::engine(this);
if (!engine)
- return 0;
+ return nullptr;
QV4::Scope scope(engine);
QV4::Scoped<QV4::QMetaObjectWrapper> wrapper(scope, QJSValuePrivate::getValue(this));
if (!wrapper)
- return 0;
+ return nullptr;
return wrapper->metaObject();
}
@@ -1389,7 +1389,7 @@ bool QJSValue::isRegExp() const
bool QJSValue::isQObject() const
{
QV4::Value *val = QJSValuePrivate::getValue(this);
- return val && val->as<QV4::QObjectWrapper>() != 0;
+ return val && val->as<QV4::QObjectWrapper>() != nullptr;
}
/*!
@@ -1403,7 +1403,7 @@ bool QJSValue::isQObject() const
bool QJSValue::isQMetaObject() const
{
QV4::Value *val = QJSValuePrivate::getValue(this);
- return val && val->as<QV4::QMetaObjectWrapper>() != 0;
+ return val && val->as<QV4::QMetaObjectWrapper>() != nullptr;
}
QT_END_NAMESPACE
diff --git a/src/qml/jsapi/qjsvalue_p.h b/src/qml/jsapi/qjsvalue_p.h
index c4761ad6ea..62e09f72be 100644
--- a/src/qml/jsapi/qjsvalue_p.h
+++ b/src/qml/jsapi/qjsvalue_p.h
@@ -68,7 +68,7 @@ public:
static inline QV4::Value *getValue(const QJSValue *jsval)
{
if (jsval->d & 3)
- return 0;
+ return nullptr;
return reinterpret_cast<QV4::Value *>(jsval->d);
}
@@ -76,7 +76,7 @@ public:
{
if (jsval->d & 1)
return reinterpret_cast<QVariant *>(jsval->d & ~3);
- return 0;
+ return nullptr;
}
static inline void setVariant(QJSValue *jsval, const QVariant &v) {
@@ -153,14 +153,14 @@ public:
*v = QV4::Encode(variant->toUInt());
break;
default:
- return 0;
+ return nullptr;
}
return v;
}
static QV4::ExecutionEngine *engine(const QJSValue *jsval) {
QV4::Value *v = getValue(jsval);
- return v ? QV4::PersistentValueStorage::getEngine(v) : 0;
+ return v ? QV4::PersistentValueStorage::getEngine(v) : nullptr;
}
static inline bool checkEngine(QV4::ExecutionEngine *e, const QJSValue &jsval) {
diff --git a/src/qml/jsruntime/qv4arraybuffer.cpp b/src/qml/jsruntime/qv4arraybuffer.cpp
index f7b9e8acef..c4eddb6b2a 100644
--- a/src/qml/jsruntime/qv4arraybuffer.cpp
+++ b/src/qml/jsruntime/qv4arraybuffer.cpp
@@ -96,7 +96,7 @@ void Heap::ArrayBuffer::init(size_t length)
Object::init();
data = QTypedArrayData<char>::allocate(length + 1);
if (!data) {
- data = 0;
+ data = nullptr;
internalClass->engine->throwRangeError(QStringLiteral("ArrayBuffer: out of memory"));
return;
}
@@ -152,7 +152,7 @@ void ArrayBufferPrototype::init(ExecutionEngine *engine, Object *ctor)
ctor->defineReadonlyProperty(engine->id_prototype(), (o = this));
ctor->defineDefaultProperty(QStringLiteral("isView"), ArrayBufferCtor::method_isView, 1);
defineDefaultProperty(engine->id_constructor(), (o = ctor));
- defineAccessorProperty(QStringLiteral("byteLength"), method_get_byteLength, 0);
+ defineAccessorProperty(QStringLiteral("byteLength"), method_get_byteLength, nullptr);
defineDefaultProperty(QStringLiteral("slice"), method_slice, 2);
defineDefaultProperty(QStringLiteral("toString"), method_toString, 0);
}
diff --git a/src/qml/jsruntime/qv4arraybuffer_p.h b/src/qml/jsruntime/qv4arraybuffer_p.h
index e236a23d1f..59e78ee85f 100644
--- a/src/qml/jsruntime/qv4arraybuffer_p.h
+++ b/src/qml/jsruntime/qv4arraybuffer_p.h
@@ -93,8 +93,8 @@ struct Q_QML_PRIVATE_EXPORT ArrayBuffer : Object
QByteArray asByteArray() const;
uint byteLength() const { return d()->byteLength(); }
- char *data() { detach(); return d()->data ? d()->data->data() : 0; }
- const char *constData() { detach(); return d()->data ? d()->data->data() : 0; }
+ char *data() { detach(); return d()->data ? d()->data->data() : nullptr; }
+ const char *constData() { detach(); return d()->data ? d()->data->data() : nullptr; }
private:
void detach();
diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp
index 5e971c8e9b..30c8527f21 100644
--- a/src/qml/jsruntime/qv4arraydata.cpp
+++ b/src/qml/jsruntime/qv4arraydata.cpp
@@ -50,7 +50,7 @@ using namespace QV4;
QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON
const QV4::VTable QV4::ArrayData::static_vtbl = {
- 0,
+ nullptr,
0,
0,
QV4::ArrayData::IsExecutionContext,
@@ -69,7 +69,7 @@ const QV4::VTable QV4::ArrayData::static_vtbl = {
const ArrayVTable SimpleArrayData::static_vtbl =
{
- DEFINE_MANAGED_VTABLE_INT(SimpleArrayData, 0),
+ DEFINE_MANAGED_VTABLE_INT(SimpleArrayData, nullptr),
Heap::ArrayData::Simple,
SimpleArrayData::reallocate,
SimpleArrayData::get,
@@ -85,7 +85,7 @@ const ArrayVTable SimpleArrayData::static_vtbl =
const ArrayVTable SparseArrayData::static_vtbl =
{
- DEFINE_MANAGED_VTABLE_INT(SparseArrayData, 0),
+ DEFINE_MANAGED_VTABLE_INT(SparseArrayData, nullptr),
Heap::ArrayData::Sparse,
SparseArrayData::reallocate,
SparseArrayData::get,
@@ -170,7 +170,7 @@ void ArrayData::realloc(Object *o, Type newType, uint requested, bool enforceAtt
newData->setType(newType);
if (d)
newData->d()->needsMark = d->d()->needsMark;
- newData->setAttrs(enforceAttributes ? reinterpret_cast<PropertyAttributes *>(newData->d()->values.values + alloc) : 0);
+ newData->setAttrs(enforceAttributes ? reinterpret_cast<PropertyAttributes *>(newData->d()->values.values + alloc) : nullptr);
o->setArrayData(newData);
if (d) {
@@ -203,7 +203,7 @@ void ArrayData::realloc(Object *o, Type newType, uint requested, bool enforceAtt
if (d && d->type() == Heap::ArrayData::Sparse) {
Heap::SparseArrayData *old = static_cast<Heap::SparseArrayData *>(d->d());
sparse->sparse = old->sparse;
- old->sparse = 0;
+ old->sparse = nullptr;
lastFree = &sparse->sparse->freeList;
} else {
sparse->sparse = new SparseArray;
@@ -779,7 +779,7 @@ void ArrayData::sort(ExecutionEngine *engine, Object *thisObject, const Value &c
if (!sparse->sparse()->nEntries())
return;
- thisObject->setArrayData(0);
+ thisObject->setArrayData(nullptr);
ArrayData::realloc(thisObject, Heap::ArrayData::Simple, sparse->sparse()->nEntries(), sparse->attrs() ? true : false);
Heap::SimpleArrayData *d = thisObject->d()->arrayData.cast<Heap::SimpleArrayData>();
diff --git a/src/qml/jsruntime/qv4arraydata_p.h b/src/qml/jsruntime/qv4arraydata_p.h
index d6549e44ee..9356670b6d 100644
--- a/src/qml/jsruntime/qv4arraydata_p.h
+++ b/src/qml/jsruntime/qv4arraydata_p.h
@@ -331,7 +331,7 @@ ArrayData::Index ArrayData::getValueOrSetter(uint index, PropertyAttributes *att
uint idx = mappedIndex(index);
if (idx == UINT_MAX) {
*attrs = Attr_Invalid;
- return { 0, 0 };
+ return { nullptr, 0 };
}
*attrs = attributes(index);
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index 00d816fe91..020e519e74 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -302,7 +302,7 @@ ReturnedValue ExecutionContext::getProperty(String *name)
ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Value *base)
{
- base->setM(0);
+ base->setM(nullptr);
name->makeIdentifier();
Heap::ExecutionContext *ctx = d();
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h
index dfac5534be..512bfa06d8 100644
--- a/src/qml/jsruntime/qv4context_p.h
+++ b/src/qml/jsruntime/qv4context_p.h
@@ -246,12 +246,12 @@ struct CatchContext : public ExecutionContext
inline CallContext *ExecutionContext::asCallContext()
{
- return d()->type == Heap::ExecutionContext::Type_CallContext ? static_cast<CallContext *>(this) : 0;
+ return d()->type == Heap::ExecutionContext::Type_CallContext ? static_cast<CallContext *>(this) : nullptr;
}
inline const CallContext *ExecutionContext::asCallContext() const
{
- return d()->type == Heap::ExecutionContext::Type_CallContext ? static_cast<const CallContext *>(this) : 0;
+ return d()->type == Heap::ExecutionContext::Type_CallContext ? static_cast<const CallContext *>(this) : nullptr;
}
} // namespace QV4
diff --git a/src/qml/jsruntime/qv4dataview.cpp b/src/qml/jsruntime/qv4dataview.cpp
index 397ef1cfec..d894d909ff 100644
--- a/src/qml/jsruntime/qv4dataview.cpp
+++ b/src/qml/jsruntime/qv4dataview.cpp
@@ -88,9 +88,9 @@ void DataViewPrototype::init(ExecutionEngine *engine, Object *ctor)
ctor->defineReadonlyProperty(engine->id_length(), Primitive::fromInt32(3));
ctor->defineReadonlyProperty(engine->id_prototype(), (o = this));
defineDefaultProperty(engine->id_constructor(), (o = ctor));
- defineAccessorProperty(QStringLiteral("buffer"), method_get_buffer, 0);
- defineAccessorProperty(QStringLiteral("byteLength"), method_get_byteLength, 0);
- defineAccessorProperty(QStringLiteral("byteOffset"), method_get_byteOffset, 0);
+ defineAccessorProperty(QStringLiteral("buffer"), method_get_buffer, nullptr);
+ defineAccessorProperty(QStringLiteral("byteLength"), method_get_byteLength, nullptr);
+ defineAccessorProperty(QStringLiteral("byteOffset"), method_get_byteOffset, nullptr);
defineDefaultProperty(QStringLiteral("getInt8"), method_getChar<signed char>, 0);
defineDefaultProperty(QStringLiteral("getUint8"), method_getChar<unsigned char>, 0);
diff --git a/src/qml/jsruntime/qv4dateobject_p.h b/src/qml/jsruntime/qv4dateobject_p.h
index a4ab0a27ed..2b9a580288 100644
--- a/src/qml/jsruntime/qv4dateobject_p.h
+++ b/src/qml/jsruntime/qv4dateobject_p.h
@@ -101,7 +101,7 @@ struct DateObject: Object {
template<>
inline const DateObject *Value::as() const {
- return isManaged() && m()->vtable()->type == Managed::Type_DateObject ? static_cast<const DateObject *>(this) : 0;
+ return isManaged() && m()->vtable()->type == Managed::Type_DateObject ? static_cast<const DateObject *>(this) : nullptr;
}
struct DateCtor: FunctionObject
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 4b5aadbdcf..168a2ea9d4 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -127,13 +127,13 @@ ExecutionEngine::ExecutionEngine()
, bumperPointerAllocator(new WTF::BumpPointerAllocator)
, jsStack(new WTF::PageAllocation)
, gcStack(new WTF::PageAllocation)
- , globalCode(0)
- , v8Engine(0)
- , argumentsAccessors(0)
+ , globalCode(nullptr)
+ , v8Engine(nullptr)
+ , argumentsAccessors(nullptr)
, nArgumentsAccessors(0)
, m_engineId(engineSerial.fetchAndAddOrdered(1))
- , regExpCache(0)
- , m_multiplyWrappedQObjects(0)
+ , regExpCache(nullptr)
+ , m_multiplyWrappedQObjects(nullptr)
#if defined(V4_ENABLE_JIT) && !defined(V4_BOOTSTRAP)
, m_canAllocateExecutableMemory(OSAllocator::canAllocateExecutableMemory())
#endif
@@ -314,7 +314,7 @@ ExecutionEngine::ExecutionEngine()
internalClasses[EngineBase::Class_RegExpExecArray] = ic->addMember(id_input(), Attr_Data, &index);
Q_ASSERT(index == RegExpObject::Index_ArrayInput);
- ic = newInternalClass(ErrorObject::staticVTable(), 0);
+ ic = newInternalClass(ErrorObject::staticVTable(), nullptr);
ic = ic->addMember((str = newIdentifier(QStringLiteral("stack"))), Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable, &index);
Q_ASSERT(index == ErrorObject::Index_Stack);
ic = ic->addMember((str = newIdentifier(QStringLiteral("fileName"))), Attr_Data|Attr_NotEnumerable, &index);
@@ -396,8 +396,8 @@ ExecutionEngine::ExecutionEngine()
jsObjects[DataView_Ctor] = memoryManager->allocObject<DataViewCtor>(global);
jsObjects[DataViewProto] = memoryManager->allocObject<DataViewPrototype>();
static_cast<DataViewPrototype *>(dataViewPrototype())->init(this, dataViewCtor());
- jsObjects[ValueTypeProto] = (Heap::Base *) 0;
- jsObjects[SignalHandlerProto] = (Heap::Base *) 0;
+ jsObjects[ValueTypeProto] = (Heap::Base *) nullptr;
+ jsObjects[SignalHandlerProto] = (Heap::Base *) nullptr;
for (int i = 0; i < Heap::TypedArray::NTypes; ++i) {
static_cast<Value &>(typedArrayCtors[i]) = memoryManager->allocObject<TypedArrayCtor>(global, Heap::TypedArray::Type(i));
@@ -480,7 +480,7 @@ ExecutionEngine::ExecutionEngine()
ExecutionEngine::~ExecutionEngine()
{
delete m_multiplyWrappedQObjects;
- m_multiplyWrappedQObjects = 0;
+ m_multiplyWrappedQObjects = nullptr;
delete identifierTable;
delete memoryManager;
@@ -531,7 +531,7 @@ InternalClass *ExecutionEngine::newClass(const InternalClass &other)
InternalClass *ExecutionEngine::newInternalClass(const VTable *vtable, Object *prototype)
{
- return internalClasses[EngineBase::Class_Empty]->changeVTable(vtable)->changePrototype(prototype ? prototype->d() : 0);
+ return internalClasses[EngineBase::Class_Empty]->changeVTable(vtable)->changePrototype(prototype ? prototype->d() : nullptr);
}
Heap::Object *ExecutionEngine::newObject()
@@ -733,18 +733,18 @@ Heap::Object *ExecutionEngine::newForEachIteratorObject(Object *o)
Heap::QmlContext *ExecutionEngine::qmlContext() const
{
if (!currentStackFrame)
- return 0;
+ return nullptr;
Heap::ExecutionContext *ctx = currentContext()->d();
if (ctx->type != Heap::ExecutionContext::Type_QmlContext && !ctx->outer)
- return 0;
+ return nullptr;
while (ctx->outer && ctx->outer->type != Heap::ExecutionContext::Type_GlobalContext)
ctx = ctx->outer;
Q_ASSERT(ctx);
if (ctx->type != Heap::ExecutionContext::Type_QmlContext)
- return 0;
+ return nullptr;
return static_cast<Heap::QmlContext *>(ctx);
}
@@ -753,7 +753,7 @@ QObject *ExecutionEngine::qmlScopeObject() const
{
Heap::QmlContext *ctx = qmlContext();
if (!ctx)
- return 0;
+ return nullptr;
return ctx->qml()->scopeObject;
}
@@ -783,7 +783,7 @@ QQmlContextData *ExecutionEngine::callingQmlContext() const
{
Heap::QmlContext *ctx = qmlContext();
if (!ctx)
- return 0;
+ return nullptr;
return ctx->qml()->context->contextData();
}
@@ -1091,7 +1091,7 @@ QQmlError ExecutionEngine::catchExceptionAsQmlError()
typedef QSet<QV4::Heap::Object *> V4ObjectSet;
static QVariant toVariant(QV4::ExecutionEngine *e, const QV4::Value &value, int typeHint, bool createJSValueForObjects, V4ObjectSet *visitedObjects);
static QObject *qtObjectFromJS(QV4::ExecutionEngine *engine, const QV4::Value &value);
-static QVariant objectToVariant(QV4::ExecutionEngine *e, const QV4::Object *o, V4ObjectSet *visitedObjects = 0);
+static QVariant objectToVariant(QV4::ExecutionEngine *e, const QV4::Object *o, V4ObjectSet *visitedObjects = nullptr);
static bool convertToNativeQObject(QV4::ExecutionEngine *e, const QV4::Value &value,
const QByteArray &targetType,
void **result);
@@ -1105,7 +1105,7 @@ static QV4::ReturnedValue variantToJS(QV4::ExecutionEngine *v4, const QVariant &
QVariant ExecutionEngine::toVariant(const Value &value, int typeHint, bool createJSValueForObjects)
{
- return ::toVariant(this, value, typeHint, createJSValueForObjects, 0);
+ return ::toVariant(this, value, typeHint, createJSValueForObjects, nullptr);
}
@@ -1469,7 +1469,7 @@ static QV4::ReturnedValue variantMapToJS(QV4::ExecutionEngine *v4, const QVarian
// Returns the value if conversion succeeded, an empty handle otherwise.
QV4::ReturnedValue ExecutionEngine::metaTypeToJS(int type, const void *data)
{
- Q_ASSERT(data != 0);
+ Q_ASSERT(data != nullptr);
// check if it's one of the types we know
switch (QMetaType::Type(type)) {
@@ -1742,7 +1742,7 @@ bool ExecutionEngine::metaTypeFromJS(const Value *value, int type, void *data)
QByteArray className = name.left(name.size()-1);
QV4::ScopedObject p(scope, proto.getPointer());
if (QObject *qobject = qtObjectFromJS(this, p))
- canCast = qobject->qt_metacast(className) != 0;
+ canCast = qobject->qt_metacast(className) != nullptr;
}
if (canCast) {
QByteArray varTypeName = QMetaType::typeName(var.userType());
@@ -1756,7 +1756,7 @@ bool ExecutionEngine::metaTypeFromJS(const Value *value, int type, void *data)
}
}
} else if (value->isNull() && name.endsWith('*')) {
- *reinterpret_cast<void* *>(data) = 0;
+ *reinterpret_cast<void* *>(data) = nullptr;
return true;
} else if (type == qMetaTypeId<QJSValue>()) {
*reinterpret_cast<QJSValue*>(data) = QJSValue(this, value->asReturnedValue());
@@ -1784,7 +1784,7 @@ static bool convertToNativeQObject(QV4::ExecutionEngine *e, const QV4::Value &va
static QObject *qtObjectFromJS(QV4::ExecutionEngine *engine, const QV4::Value &value)
{
if (!value.isObject())
- return 0;
+ return nullptr;
QV4::Scope scope(engine);
QV4::Scoped<QV4::VariantObject> v(scope, value);
@@ -1797,7 +1797,7 @@ static QObject *qtObjectFromJS(QV4::ExecutionEngine *engine, const QV4::Value &v
}
QV4::Scoped<QV4::QObjectWrapper> wrapper(scope, value);
if (!wrapper)
- return 0;
+ return nullptr;
return wrapper->object();
}
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index a37c640431..5edf89f720 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -459,7 +459,7 @@ public:
StackTrace exceptionStackTrace;
ReturnedValue throwError(const Value &value);
- ReturnedValue catchException(StackTrace *trace = 0);
+ ReturnedValue catchException(StackTrace *trace = nullptr);
ReturnedValue throwError(const QString &message);
ReturnedValue throwSyntaxError(const QString &message);
diff --git a/src/qml/jsruntime/qv4errorobject_p.h b/src/qml/jsruntime/qv4errorobject_p.h
index a5ee0eb886..6b578e8c38 100644
--- a/src/qml/jsruntime/qv4errorobject_p.h
+++ b/src/qml/jsruntime/qv4errorobject_p.h
@@ -180,7 +180,7 @@ struct ErrorObject: Object {
template<>
inline const ErrorObject *Value::as() const {
- return isManaged() && m()->vtable()->isErrorObject ? reinterpret_cast<const ErrorObject *>(this) : 0;
+ return isManaged() && m()->vtable()->isErrorObject ? reinterpret_cast<const ErrorObject *>(this) : nullptr;
}
struct EvalErrorObject: ErrorObject {
@@ -322,7 +322,7 @@ struct URIErrorPrototype : ErrorObject
inline SyntaxErrorObject *ErrorObject::asSyntaxError()
{
- return d()->errorType == QV4::Heap::ErrorObject::SyntaxError ? static_cast<SyntaxErrorObject *>(this) : 0;
+ return d()->errorType == QV4::Heap::ErrorObject::SyntaxError ? static_cast<SyntaxErrorObject *>(this) : nullptr;
}
diff --git a/src/qml/jsruntime/qv4executableallocator.cpp b/src/qml/jsruntime/qv4executableallocator.cpp
index 64ac1267ce..6f04a712e6 100644
--- a/src/qml/jsruntime/qv4executableallocator.cpp
+++ b/src/qml/jsruntime/qv4executableallocator.cpp
@@ -159,7 +159,7 @@ ExecutableAllocator::~ExecutableAllocator()
ExecutableAllocator::Allocation *ExecutableAllocator::allocate(size_t size)
{
QMutexLocker locker(&mutex);
- Allocation *allocation = 0;
+ Allocation *allocation = nullptr;
// Code is best aligned to 16-byte boundaries.
size = WTF::roundUpToMultipleOf(16, size);
@@ -217,7 +217,7 @@ void ExecutableAllocator::free(Allocation *allocation)
if (!merged)
freeAllocations.insert(allocation->size, allocation);
- allocation = 0;
+ allocation = nullptr;
if (!chunk->firstAllocation->next) {
freeAllocations.remove(chunk->firstAllocation->size, chunk->firstAllocation);
@@ -235,7 +235,7 @@ ExecutableAllocator::ChunkOfPages *ExecutableAllocator::chunkForAllocation(Alloc
if (it != chunks.begin())
--it;
if (it == chunks.end())
- return 0;
+ return nullptr;
return *it;
}
diff --git a/src/qml/jsruntime/qv4executableallocator_p.h b/src/qml/jsruntime/qv4executableallocator_p.h
index 353a6eacff..2984a89df5 100644
--- a/src/qml/jsruntime/qv4executableallocator_p.h
+++ b/src/qml/jsruntime/qv4executableallocator_p.h
@@ -85,8 +85,8 @@ public:
: addr(0)
, size(0)
, free(true)
- , next(0)
- , prev(0)
+ , next(nullptr)
+ , prev(nullptr)
{}
void *start() const;
@@ -117,8 +117,8 @@ public:
struct ChunkOfPages
{
ChunkOfPages()
- : pages(0)
- , firstAllocation(0)
+ : pages(nullptr)
+ , firstAllocation(nullptr)
{}
~ChunkOfPages();
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 165f1801ea..a8c1640767 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -232,7 +232,7 @@ ReturnedValue FunctionCtor::callAsConstructor(const FunctionObject *f, const Val
if (!fe)
return scope.engine->throwSyntaxError(QLatin1String("Parse error"));
- Compiler::Module module(scope.engine->debugger() != 0);
+ Compiler::Module module(scope.engine->debugger() != nullptr);
Compiler::JSUnitGenerator jsGenerator(&module);
RuntimeCodegen cg(scope.engine, &jsGenerator, false);
@@ -351,7 +351,7 @@ ReturnedValue FunctionPrototype::method_bind(const FunctionObject *b, const Valu
return scope.engine->throwTypeError();
ScopedValue boundThis(scope, argc ? argv[0] : Primitive::undefinedValue());
- Scoped<MemberData> boundArgs(scope, (Heap::MemberData *)0);
+ Scoped<MemberData> boundArgs(scope, (Heap::MemberData *)nullptr);
if (argc > 1) {
boundArgs = MemberData::allocate(scope.engine, argc - 1);
boundArgs->d()->values.size = argc - 1;
@@ -440,7 +440,7 @@ void Heap::BoundFunction::init(QV4::ExecutionContext *scope, QV4::FunctionObject
Scope s(scope);
Heap::FunctionObject::init(scope, QStringLiteral("__bound function__"));
this->target.set(s.engine, target->d());
- this->boundArgs.set(s.engine, boundArgs ? boundArgs->d() : 0);
+ this->boundArgs.set(s.engine, boundArgs ? boundArgs->d() : nullptr);
this->boundThis.set(scope->engine(), boundThis);
ScopedObject f(s, this);
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h
index abd6f2dbcb..d6066ec648 100644
--- a/src/qml/jsruntime/qv4functionobject_p.h
+++ b/src/qml/jsruntime/qv4functionobject_p.h
@@ -84,7 +84,7 @@ DECLARE_HEAP_OBJECT(FunctionObject, Object) {
};
Q_QML_PRIVATE_EXPORT void init(QV4::ExecutionContext *scope, QV4::String *name, ReturnedValue (*code)(const QV4::FunctionObject *, const Value *thisObject, const Value *argv, int argc));
- void init(QV4::ExecutionContext *scope, QV4::String *name = 0, bool createProto = false);
+ void init(QV4::ExecutionContext *scope, QV4::String *name = nullptr, bool createProto = false);
void init(QV4::ExecutionContext *scope, QV4::Function *function, bool createProto = false);
void init(QV4::ExecutionContext *scope, const QString &name, bool createProto = false);
void init();
@@ -179,7 +179,7 @@ struct Q_QML_EXPORT FunctionObject: Object {
template<>
inline const FunctionObject *Value::as() const {
- return isManaged() && m()->vtable()->isFunctionObject ? reinterpret_cast<const FunctionObject *>(this) : 0;
+ return isManaged() && m()->vtable()->isFunctionObject ? reinterpret_cast<const FunctionObject *>(this) : nullptr;
}
diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp
index 3214a716e8..f419ab53fe 100644
--- a/src/qml/jsruntime/qv4globalobject.cpp
+++ b/src/qml/jsruntime/qv4globalobject.cpp
@@ -375,12 +375,12 @@ ReturnedValue EvalFunction::evalCall(const Value *, const Value *argv, int argc,
if (function->isStrict() || isStrict) {
ScopedFunctionObject e(scope, FunctionObject::createScriptFunction(ctx, function));
ScopedValue thisObject(scope, directCall ? scope.engine->currentStackFrame->thisObject() : scope.engine->globalObject->asReturnedValue());
- return e->call(thisObject, 0, 0);
+ return e->call(thisObject, nullptr, 0);
}
ScopedValue thisObject(scope, scope.engine->currentStackFrame->thisObject());
- return function->call(thisObject, 0, 0, ctx);
+ return function->call(thisObject, nullptr, 0, ctx);
}
@@ -507,7 +507,7 @@ ReturnedValue GlobalFunctions::method_parseFloat(const FunctionObject *b, const
QByteArray ba = trimmed.toLatin1();
bool ok;
const char *begin = ba.constData();
- const char *end = 0;
+ const char *end = nullptr;
double d = qstrtod(begin, &end, &ok);
if (end - begin == 0)
RETURN_RESULT(Encode(std::numeric_limits<double>::quiet_NaN())); // 3
diff --git a/src/qml/jsruntime/qv4identifier.cpp b/src/qml/jsruntime/qv4identifier.cpp
index 116d4ec201..c122bcb51a 100644
--- a/src/qml/jsruntime/qv4identifier.cpp
+++ b/src/qml/jsruntime/qv4identifier.cpp
@@ -132,13 +132,13 @@ IdentifierHashEntry *IdentifierHash::addEntry(const Identifier *identifier)
const IdentifierHashEntry *IdentifierHash::lookup(const Identifier *identifier) const
{
if (!d)
- return 0;
+ return nullptr;
Q_ASSERT(d->entries);
uint idx = identifier->hashValue % d->alloc;
while (1) {
if (!d->entries[idx].identifier)
- return 0;
+ return nullptr;
if (d->entries[idx].identifier == identifier)
return d->entries + idx;
++idx;
@@ -149,14 +149,14 @@ const IdentifierHashEntry *IdentifierHash::lookup(const Identifier *identifier)
const IdentifierHashEntry *IdentifierHash::lookup(const QString &str) const
{
if (!d)
- return 0;
+ return nullptr;
Q_ASSERT(d->entries);
uint hash = String::createHashValue(str.constData(), str.length(), nullptr);
uint idx = hash % d->alloc;
while (1) {
if (!d->entries[idx].identifier)
- return 0;
+ return nullptr;
if (d->entries[idx].identifier->string == str)
return d->entries + idx;
++idx;
@@ -167,7 +167,7 @@ const IdentifierHashEntry *IdentifierHash::lookup(const QString &str) const
const IdentifierHashEntry *IdentifierHash::lookup(String *str) const
{
if (!d)
- return 0;
+ return nullptr;
if (str->d()->identifier)
return lookup(str->d()->identifier);
return lookup(str->toQString());
diff --git a/src/qml/jsruntime/qv4identifier_p.h b/src/qml/jsruntime/qv4identifier_p.h
index f0ff987608..21e4e8ea66 100644
--- a/src/qml/jsruntime/qv4identifier_p.h
+++ b/src/qml/jsruntime/qv4identifier_p.h
@@ -97,7 +97,7 @@ struct IdentifierHash
IdentifierHashData *d;
- IdentifierHash() : d(0) {}
+ IdentifierHash() : d(nullptr) {}
IdentifierHash(ExecutionEngine *engine);
inline IdentifierHash(const IdentifierHash &other);
inline ~IdentifierHash();
diff --git a/src/qml/jsruntime/qv4identifiertable.cpp b/src/qml/jsruntime/qv4identifiertable.cpp
index 3def6defbf..b77f9478d3 100644
--- a/src/qml/jsruntime/qv4identifiertable.cpp
+++ b/src/qml/jsruntime/qv4identifiertable.cpp
@@ -142,7 +142,7 @@ Identifier *IdentifierTable::identifierImpl(const Heap::String *str)
return str->identifier;
uint hash = str->hashValue();
if (str->subtype == Heap::String::StringType_ArrayIndex)
- return 0;
+ return nullptr;
uint idx = hash % alloc;
while (Heap::String *e = entries[idx]) {
@@ -161,7 +161,7 @@ Identifier *IdentifierTable::identifierImpl(const Heap::String *str)
Heap::String *IdentifierTable::stringFromIdentifier(Identifier *i)
{
if (!i)
- return 0;
+ return nullptr;
uint idx = i->hashValue % alloc;
while (1) {
diff --git a/src/qml/jsruntime/qv4include.cpp b/src/qml/jsruntime/qv4include.cpp
index d1ceb0a892..aaf5e3b857 100644
--- a/src/qml/jsruntime/qv4include.cpp
+++ b/src/qml/jsruntime/qv4include.cpp
@@ -61,7 +61,7 @@ QV4Include::QV4Include(const QUrl &url, QV4::ExecutionEngine *engine,
QV4::QmlContext *qmlContext, const QV4::Value &callback)
: v4(engine), m_url(url)
#if QT_CONFIG(qml_network)
- , m_redirectCount(0), m_network(0) , m_reply(0)
+ , m_redirectCount(0), m_network(nullptr) , m_reply(nullptr)
#endif
{
if (qmlContext)
@@ -88,7 +88,7 @@ QV4Include::~QV4Include()
{
#if QT_CONFIG(qml_network)
delete m_reply;
- m_reply = 0;
+ m_reply = nullptr;
#endif
}
diff --git a/src/qml/jsruntime/qv4internalclass.cpp b/src/qml/jsruntime/qv4internalclass.cpp
index 4041052344..9da854e7d7 100644
--- a/src/qml/jsruntime/qv4internalclass.cpp
+++ b/src/qml/jsruntime/qv4internalclass.cpp
@@ -105,10 +105,10 @@ void PropertyHash::addEntry(const PropertyHash::Entry &entry, int classSize)
InternalClass::InternalClass(ExecutionEngine *engine)
: engine(engine)
- , vtable(0)
- , prototype(0)
- , m_sealed(0)
- , m_frozen(0)
+ , vtable(nullptr)
+ , prototype(nullptr)
+ , m_sealed(nullptr)
+ , m_frozen(nullptr)
, size(0)
, extensible(true)
{
@@ -124,8 +124,8 @@ InternalClass::InternalClass(const QV4::InternalClass &other)
, propertyTable(other.propertyTable)
, nameMap(other.nameMap)
, propertyData(other.propertyData)
- , m_sealed(0)
- , m_frozen(0)
+ , m_sealed(nullptr)
+ , m_frozen(nullptr)
, size(other.size)
, extensible(other.extensible)
, isUsedAsProto(other.isUsedAsProto)
@@ -223,7 +223,7 @@ InternalClass *InternalClass::changePrototypeImpl(Heap::Object *proto)
Q_ASSERT(prototype != proto);
Q_ASSERT(!proto || proto->internalClass->isUsedAsProto);
- Transition temp = { { nullptr }, 0, Transition::PrototypeChange };
+ Transition temp = { { nullptr }, nullptr, Transition::PrototypeChange };
temp.prototype = proto;
Transition &t = lookupOrInsertTransition(temp);
@@ -487,7 +487,7 @@ void InternalClass::destroy()
destroyStack.pop_back();
if (!next->engine)
continue;
- next->engine = 0;
+ next->engine = nullptr;
next->propertyTable.~PropertyHash();
next->nameMap.~SharedInternalClassData<Identifier *>();
next->propertyData.~SharedInternalClassData<PropertyAttributes>();
diff --git a/src/qml/jsruntime/qv4internalclass_p.h b/src/qml/jsruntime/qv4internalclass_p.h
index 546073dcf5..b689272006 100644
--- a/src/qml/jsruntime/qv4internalclass_p.h
+++ b/src/qml/jsruntime/qv4internalclass_p.h
@@ -277,10 +277,10 @@ struct InternalClass : public QQmlJS::Managed {
}
static void addMember(Object *object, String *string, PropertyAttributes data, uint *index);
- Q_REQUIRED_RESULT InternalClass *addMember(String *string, PropertyAttributes data, uint *index = 0);
- Q_REQUIRED_RESULT InternalClass *addMember(Identifier *identifier, PropertyAttributes data, uint *index = 0);
- Q_REQUIRED_RESULT InternalClass *changeMember(Identifier *identifier, PropertyAttributes data, uint *index = 0);
- static void changeMember(Object *object, String *string, PropertyAttributes data, uint *index = 0);
+ Q_REQUIRED_RESULT InternalClass *addMember(String *string, PropertyAttributes data, uint *index = nullptr);
+ Q_REQUIRED_RESULT InternalClass *addMember(Identifier *identifier, PropertyAttributes data, uint *index = nullptr);
+ Q_REQUIRED_RESULT InternalClass *changeMember(Identifier *identifier, PropertyAttributes data, uint *index = nullptr);
+ static void changeMember(Object *object, String *string, PropertyAttributes data, uint *index = nullptr);
static void removeMember(Object *object, Identifier *id);
uint find(const String *string);
uint find(const Identifier *id)
diff --git a/src/qml/jsruntime/qv4jscall_p.h b/src/qml/jsruntime/qv4jscall_p.h
index 6d641bf9c5..c676b57c51 100644
--- a/src/qml/jsruntime/qv4jscall_p.h
+++ b/src/qml/jsruntime/qv4jscall_p.h
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
namespace QV4 {
struct JSCallData {
- JSCallData(const Scope &scope, int argc = 0, const Value *argv = 0, const Value *thisObject = 0)
+ JSCallData(const Scope &scope, int argc = 0, const Value *argv = nullptr, const Value *thisObject = nullptr)
: scope(scope), argc(argc)
{
if (thisObject)
@@ -124,7 +124,7 @@ struct ScopedStackFrame {
return;
frame.jsFrame = reinterpret_cast<CallData *>(scope.alloc(sizeof(CallData)/sizeof(Value)));
frame.jsFrame->context = context;
- frame.v4Function = frame.parent ? frame.parent->v4Function : 0;
+ frame.v4Function = frame.parent ? frame.parent->v4Function : nullptr;
scope.engine->currentStackFrame = &frame;
}
~ScopedStackFrame() {
diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp
index 51802d895b..99666806be 100644
--- a/src/qml/jsruntime/qv4jsonobject.cpp
+++ b/src/qml/jsruntime/qv4jsonobject.cpp
@@ -634,7 +634,7 @@ struct Stringify
return false;
}
- Stringify(ExecutionEngine *e) : v4(e), replacerFunction(0), propertyList(0), propertyListSize(0) {}
+ Stringify(ExecutionEngine *e) : v4(e), replacerFunction(nullptr), propertyList(nullptr), propertyListSize(0) {}
QString Str(const QString &key, const Value &v);
QString JA(ArrayObject *a);
@@ -920,11 +920,11 @@ ReturnedValue JsonObject::method_stringify(const FunctionObject *b, const Value
if (v->as<NumberObject>() || v->as<StringObject>() || v->isNumber())
*v = v->toString(scope.engine);
if (!v->isString()) {
- v->setM(0);
+ v->setM(nullptr);
} else {
for (uint j = 0; j <i; ++j) {
if (stringify.propertyList[j].m() == v->m()) {
- v->setM(0);
+ v->setM(nullptr);
break;
}
}
diff --git a/src/qml/jsruntime/qv4managed.cpp b/src/qml/jsruntime/qv4managed.cpp
index 200380eda0..b50e5f0355 100644
--- a/src/qml/jsruntime/qv4managed.cpp
+++ b/src/qml/jsruntime/qv4managed.cpp
@@ -46,7 +46,7 @@ using namespace QV4;
const VTable Managed::static_vtbl =
{
- 0,
+ nullptr,
0,
0,
Managed::IsExecutionContext,
@@ -58,15 +58,15 @@ const VTable Managed::static_vtbl =
0,
Managed::MyType,
"Managed",
- 0,
- 0 /*markObjects*/,
+ nullptr,
+ nullptr /*markObjects*/,
isEqualTo
};
QString Managed::className() const
{
- const char *s = 0;
+ const char *s = nullptr;
switch (Type(d()->vtable()->type)) {
case Type_Invalid:
case Type_String:
diff --git a/src/qml/jsruntime/qv4memberdata_p.h b/src/qml/jsruntime/qv4memberdata_p.h
index 12eaf336b9..ac9671254d 100644
--- a/src/qml/jsruntime/qv4memberdata_p.h
+++ b/src/qml/jsruntime/qv4memberdata_p.h
@@ -93,7 +93,7 @@ struct MemberData : Managed
inline uint size() const { return d()->values.size; }
- static Heap::MemberData *allocate(QV4::ExecutionEngine *e, uint n, Heap::MemberData *old = 0);
+ static Heap::MemberData *allocate(QV4::ExecutionEngine *e, uint n, Heap::MemberData *old = nullptr);
};
}
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp
index aa8e850aed..8e9bf794a9 100644
--- a/src/qml/jsruntime/qv4object.cpp
+++ b/src/qml/jsruntime/qv4object.cpp
@@ -94,7 +94,7 @@ void Heap::Object::setUsedAsProto()
bool Object::setPrototype(Object *proto)
{
- Heap::Object *p = proto ? proto->d() : 0;
+ Heap::Object *p = proto ? proto->d() : nullptr;
Heap::Object *pp = p;
while (pp) {
if (pp == d())
@@ -193,8 +193,8 @@ void Object::defineAccessorProperty(String *name, ReturnedValue (*getter)(const
QV4::Scope scope(v4);
ScopedProperty p(scope);
ExecutionContext *global = v4->rootContext();
- p->setGetter(ScopedFunctionObject(scope, (getter ? FunctionObject::createBuiltinFunction(global, name, getter) : 0)));
- p->setSetter(ScopedFunctionObject(scope, (setter ? FunctionObject::createBuiltinFunction(global, name, setter) : 0)));
+ p->setGetter(ScopedFunctionObject(scope, (getter ? FunctionObject::createBuiltinFunction(global, name, getter) : nullptr)));
+ p->setSetter(ScopedFunctionObject(scope, (setter ? FunctionObject::createBuiltinFunction(global, name, setter) : nullptr)));
insertMember(name, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable);
}
@@ -321,7 +321,7 @@ MemberData::Index Object::getValueOrSetter(String *name, PropertyAttributes *att
o = o->prototype();
}
*attrs = Attr_Invalid;
- return { 0, 0 };
+ return { nullptr, nullptr };
}
ArrayData::Index Object::getValueOrSetter(uint index, PropertyAttributes *attrs)
@@ -346,7 +346,7 @@ ArrayData::Index Object::getValueOrSetter(uint index, PropertyAttributes *attrs)
o = o->prototype();
}
*attrs = Attr_Invalid;
- return { 0, 0 };
+ return { nullptr, 0 };
}
bool Object::hasProperty(String *name) const
@@ -484,7 +484,7 @@ bool Object::deleteIndexedProperty(Managed *m, uint index)
void Object::advanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *pd, PropertyAttributes *attrs)
{
Object *o = static_cast<Object *>(m);
- name->setM(0);
+ name->setM(nullptr);
*index = UINT_MAX;
if (o->arrayData()) {
@@ -508,7 +508,7 @@ void Object::advanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *
return;
}
}
- it->arrayNode = 0;
+ it->arrayNode = nullptr;
it->arrayIndex = UINT_MAX;
}
// dense arrays
@@ -628,7 +628,7 @@ bool Object::internalPut(String *name, const Value &value)
name->makeIdentifier();
Identifier *id = name->identifier();
- MemberData::Index memberIndex{0, 0};
+ MemberData::Index memberIndex{nullptr, nullptr};
uint member = internalClass()->find(id);
PropertyAttributes attrs;
if (member < UINT_MAX) {
@@ -704,7 +704,7 @@ bool Object::internalPutIndexed(uint index, const Value &value)
PropertyAttributes attrs;
- ArrayData::Index arrayIndex = arrayData() ? arrayData()->getValueOrSetter(index, &attrs) : ArrayData::Index{ 0, 0 };
+ ArrayData::Index arrayIndex = arrayData() ? arrayData()->getValueOrSetter(index, &attrs) : ArrayData::Index{ nullptr, 0 };
if (arrayIndex.isNull() && isStringObject()) {
if (index < static_cast<StringObject *>(this)->length())
@@ -898,7 +898,7 @@ bool Object::defineOwnProperty2(ExecutionEngine *engine, uint index, const Prope
return true;
}
- return __defineOwnProperty__(engine, index, 0, p, attrs);
+ return __defineOwnProperty__(engine, index, nullptr, p, attrs);
}
bool Object::__defineOwnProperty__(ExecutionEngine *engine, uint index, String *member, const Property *p, PropertyAttributes attrs)
@@ -949,8 +949,8 @@ bool Object::__defineOwnProperty__(ExecutionEngine *engine, uint index, String *
Q_ASSERT(arrayData());
setArrayAttributes(index, cattrs);
}
- current->setGetter(0);
- current->setSetter(0);
+ current->setGetter(nullptr);
+ current->setSetter(nullptr);
} else {
// 9c
cattrs.setType(PropertyAttributes::Data);
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h
index db57d1cf3f..1731ae3c76 100644
--- a/src/qml/jsruntime/qv4object_p.h
+++ b/src/qml/jsruntime/qv4object_p.h
@@ -236,8 +236,8 @@ struct Q_QML_EXPORT Object: Managed {
Heap::Object *prototype() const { return d()->prototype(); }
bool setPrototype(Object *proto);
- void getOwnProperty(String *name, PropertyAttributes *attrs, Property *p = 0);
- void getOwnProperty(uint index, PropertyAttributes *attrs, Property *p = 0);
+ void getOwnProperty(String *name, PropertyAttributes *attrs, Property *p = nullptr);
+ void getOwnProperty(uint index, PropertyAttributes *attrs, Property *p = nullptr);
MemberData::Index getValueOrSetter(String *name, PropertyAttributes *attrs);
ArrayData::Index getValueOrSetter(uint index, PropertyAttributes *attrs);
@@ -346,8 +346,8 @@ public:
}
void initSparseArray();
- SparseArrayNode *sparseBegin() { return arrayType() == Heap::ArrayData::Sparse ? d()->arrayData->sparse->begin() : 0; }
- SparseArrayNode *sparseEnd() { return arrayType() == Heap::ArrayData::Sparse ? d()->arrayData->sparse->end() : 0; }
+ SparseArrayNode *sparseBegin() { return arrayType() == Heap::ArrayData::Sparse ? d()->arrayData->sparse->begin() : nullptr; }
+ SparseArrayNode *sparseEnd() { return arrayType() == Heap::ArrayData::Sparse ? d()->arrayData->sparse->end() : nullptr; }
inline bool protoHasArray() {
Scope scope(engine());
@@ -360,9 +360,9 @@ public:
return false;
}
- inline ReturnedValue get(String *name, bool *hasProperty = 0) const
+ inline ReturnedValue get(String *name, bool *hasProperty = nullptr) const
{ return vtable()->get(this, name, hasProperty); }
- inline ReturnedValue getIndexed(uint idx, bool *hasProperty = 0) const
+ inline ReturnedValue getIndexed(uint idx, bool *hasProperty = nullptr) const
{ return vtable()->getIndexed(this, idx, hasProperty); }
// use the set variants instead, to customize throw behavior
@@ -551,7 +551,7 @@ inline void Object::arraySet(uint index, const Value &value)
template<>
inline const ArrayObject *Value::as() const {
- return isManaged() && m()->vtable()->type == Managed::Type_ArrayObject ? static_cast<const ArrayObject *>(this) : 0;
+ return isManaged() && m()->vtable()->type == Managed::Type_ArrayObject ? static_cast<const ArrayObject *>(this) : nullptr;
}
#ifndef V4_BOOTSTRAP
diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp
index 0394c704f9..7bf7e1aa04 100644
--- a/src/qml/jsruntime/qv4objectiterator.cpp
+++ b/src/qml/jsruntime/qv4objectiterator.cpp
@@ -47,8 +47,8 @@ using namespace QV4;
void ObjectIterator::init(const Object *o)
{
- object->setM(o ? o->m() : 0);
- current->setM(o ? o->m() : 0);
+ object->setM(o ? o->m() : nullptr);
+ current->setM(o ? o->m() : nullptr);
if (object->as<ArgumentsObject>()) {
Scope scope(engine);
@@ -58,7 +58,7 @@ void ObjectIterator::init(const Object *o)
void ObjectIterator::next(Value *name, uint *index, Property *pd, PropertyAttributes *attrs)
{
- name->setM(0);
+ name->setM(nullptr);
*index = UINT_MAX;
if (!object->as<Object>()) {
@@ -100,7 +100,7 @@ void ObjectIterator::next(Value *name, uint *index, Property *pd, PropertyAttrib
if (flags & WithProtoChain)
current->setM(co->prototype());
else
- current->setM(0);
+ current->setM(nullptr);
arrayIndex = 0;
memberIndex = 0;
diff --git a/src/qml/jsruntime/qv4objectiterator_p.h b/src/qml/jsruntime/qv4objectiterator_p.h
index 3e501f23ce..744d16301a 100644
--- a/src/qml/jsruntime/qv4objectiterator_p.h
+++ b/src/qml/jsruntime/qv4objectiterator_p.h
@@ -101,7 +101,7 @@ struct Q_QML_EXPORT ObjectIterator: ObjectIteratorData
init(o);
}
- void next(Value *name, uint *index, Property *pd, PropertyAttributes *attributes = 0);
+ void next(Value *name, uint *index, Property *pd, PropertyAttributes *attributes = nullptr);
ReturnedValue nextPropertyName(Value *value);
ReturnedValue nextPropertyNameAsString(Value *value);
ReturnedValue nextPropertyNameAsString();
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp
index a86352be40..b998b78520 100644
--- a/src/qml/jsruntime/qv4objectproto.cpp
+++ b/src/qml/jsruntime/qv4objectproto.cpp
@@ -638,7 +638,7 @@ ReturnedValue ObjectPrototype::method_set_proto(const FunctionObject *b, const V
THROW_TYPE_ERROR();
if (argv[0].isNull()) {
- o->setPrototype(0);
+ o->setPrototype(nullptr);
RETURN_UNDEFINED();
}
diff --git a/src/qml/jsruntime/qv4persistent.cpp b/src/qml/jsruntime/qv4persistent.cpp
index 973541553a..7fc74173e3 100644
--- a/src/qml/jsruntime/qv4persistent.cpp
+++ b/src/qml/jsruntime/qv4persistent.cpp
@@ -172,7 +172,7 @@ Value &PersistentValueStorage::Iterator::operator *()
PersistentValueStorage::PersistentValueStorage(ExecutionEngine *engine)
: engine(engine),
- firstPage(0)
+ firstPage(nullptr)
{
}
@@ -185,9 +185,9 @@ PersistentValueStorage::~PersistentValueStorage()
p->values[i] = Encode::undefined();
}
Page *n = p->header.next;
- p->header.engine = 0;
- p->header.prev = 0;
- p->header.next = 0;
+ p->header.engine = nullptr;
+ p->header.prev = nullptr;
+ p->header.next = nullptr;
Q_ASSERT(p->header.refCount);
p = n;
}
@@ -260,7 +260,7 @@ void PersistentValueStorage::freePage(void *page)
PersistentValue::PersistentValue(const PersistentValue &other)
- : val(0)
+ : val(nullptr)
{
if (other.val) {
val = other.engine()->memoryManager->m_persistentValues->allocate();
@@ -281,7 +281,7 @@ PersistentValue::PersistentValue(ExecutionEngine *engine, ReturnedValue value)
}
PersistentValue::PersistentValue(ExecutionEngine *engine, Object *object)
- : val(0)
+ : val(nullptr)
{
if (!object)
return;
@@ -358,7 +358,7 @@ void PersistentValue::set(ExecutionEngine *engine, Heap::Base *obj)
}
WeakValue::WeakValue(const WeakValue &other)
- : val(0)
+ : val(nullptr)
{
if (other.val) {
allocVal(other.engine());
@@ -418,6 +418,6 @@ void WeakValue::free()
PersistentValueStorage::free(val);
}
- val = 0;
+ val = nullptr;
}
diff --git a/src/qml/jsruntime/qv4persistent_p.h b/src/qml/jsruntime/qv4persistent_p.h
index 1f838f5531..5a0b2389e1 100644
--- a/src/qml/jsruntime/qv4persistent_p.h
+++ b/src/qml/jsruntime/qv4persistent_p.h
@@ -81,7 +81,7 @@ struct Q_QML_EXPORT PersistentValueStorage
Value &operator *();
};
Iterator begin() { return Iterator(firstPage, 0); }
- Iterator end() { return Iterator(0, 0); }
+ Iterator end() { return Iterator(nullptr, 0); }
static ExecutionEngine *getEngine(Value *v);
@@ -94,7 +94,7 @@ private:
class Q_QML_EXPORT PersistentValue
{
public:
- PersistentValue() : val(0) {}
+ PersistentValue() : val(nullptr) {}
PersistentValue(const PersistentValue &other);
PersistentValue &operator=(const PersistentValue &other);
PersistentValue &operator=(const WeakValue &other);
@@ -117,19 +117,19 @@ public:
}
Managed *asManaged() const {
if (!val)
- return 0;
+ return nullptr;
return val->managed();
}
template<typename T>
T *as() const {
if (!val)
- return 0;
+ return nullptr;
return val->as<T>();
}
ExecutionEngine *engine() const {
if (!val)
- return 0;
+ return nullptr;
return PersistentValueStorage::getEngine(val);
}
@@ -137,7 +137,7 @@ public:
bool isNullOrUndefined() const { return !val || val->isNullOrUndefined(); }
void clear() {
PersistentValueStorage::free(val);
- val = 0;
+ val = nullptr;
}
bool isEmpty() { return !val; }
@@ -148,7 +148,7 @@ private:
class Q_QML_EXPORT WeakValue
{
public:
- WeakValue() : val(0) {}
+ WeakValue() : val(nullptr) {}
WeakValue(const WeakValue &other);
WeakValue(ExecutionEngine *engine, const Value &value);
WeakValue &operator=(const WeakValue &other);
@@ -183,19 +183,19 @@ public:
}
Managed *asManaged() const {
if (!val)
- return 0;
+ return nullptr;
return val->managed();
}
template <typename T>
T *as() const {
if (!val)
- return 0;
+ return nullptr;
return val->as<T>();
}
ExecutionEngine *engine() const {
if (!val)
- return 0;
+ return nullptr;
return PersistentValueStorage::getEngine(val);
}
diff --git a/src/qml/jsruntime/qv4profiling_p.h b/src/qml/jsruntime/qv4profiling_p.h
index c69d1e4cf6..e8c154e4e7 100644
--- a/src/qml/jsruntime/qv4profiling_p.h
+++ b/src/qml/jsruntime/qv4profiling_p.h
@@ -139,7 +139,7 @@ struct MemoryAllocationProperties {
class FunctionCall {
public:
- FunctionCall() : m_function(0), m_start(0), m_end(0)
+ FunctionCall() : m_function(nullptr), m_start(0), m_end(0)
{ Q_ASSERT_X(false, Q_FUNC_INFO, "Cannot construct a function call without function"); }
FunctionCall(Function *function, qint64 start, qint64 end) :
@@ -276,7 +276,7 @@ public:
// It's enough to ref() the function in the destructor as it will probably not disappear while
// it's executing ...
FunctionCallProfiler(ExecutionEngine *engine, Function *f)
- : profiler(0)
+ : profiler(nullptr)
{
Profiler *p = engine->profiler();
if (Q_UNLIKELY(p) && (p->featuresEnabled & (1 << Profiling::FeatureFunctionCall))) {
diff --git a/src/qml/jsruntime/qv4property_p.h b/src/qml/jsruntime/qv4property_p.h
index 2a5b6f7f74..7cb106c424 100644
--- a/src/qml/jsruntime/qv4property_p.h
+++ b/src/qml/jsruntime/qv4property_p.h
@@ -84,7 +84,7 @@ struct Property {
inline Heap::FunctionObject *getter() const { return reinterpret_cast<Heap::FunctionObject *>(value.heapObject()); }
inline Heap::FunctionObject *setter() const { return reinterpret_cast<Heap::FunctionObject *>(set.heapObject()); }
inline void setGetter(FunctionObject *g) { value = reinterpret_cast<Managed *>(g); }
- inline void setSetter(FunctionObject *s) { set = (s ? reinterpret_cast<Managed *>(s) : 0); }
+ inline void setSetter(FunctionObject *s) { set = (s ? reinterpret_cast<Managed *>(s) : nullptr); }
void copy(const Property *other, PropertyAttributes attrs) {
value = other->value;
@@ -92,7 +92,7 @@ struct Property {
set = other->set;
}
- explicit Property() { value = Encode::undefined(); set = Value::fromHeapObject(0); }
+ explicit Property() { value = Encode::undefined(); set = Value::fromHeapObject(nullptr); }
Property(Heap::FunctionObject *getter, Heap::FunctionObject *setter) {
value.setM(reinterpret_cast<Heap::Base *>(getter));
set.setM(reinterpret_cast<Heap::Base *>(setter));
diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp
index cf4ef68bc0..040f060476 100644
--- a/src/qml/jsruntime/qv4qmlcontext.cpp
+++ b/src/qml/jsruntime/qv4qmlcontext.cpp
@@ -202,7 +202,7 @@ ReturnedValue QQmlContextWrapper::get(const Managed *m, String *name, bool *hasP
return result->asReturnedValue();
}
}
- scopeObject = 0;
+ scopeObject = nullptr;
// Search context object
@@ -272,7 +272,7 @@ bool QQmlContextWrapper::put(Managed *m, String *name, const Value &value)
if (scopeObject &&
QV4::QObjectWrapper::setQmlProperty(v4, context, scopeObject, name, QV4::QObjectWrapper::CheckRevision, value))
return true;
- scopeObject = 0;
+ scopeObject = nullptr;
// Search context object
if (context->contextObject &&
@@ -312,7 +312,7 @@ Heap::QmlContext *QmlContext::createWorkerContext(ExecutionContext *parent, cons
context->isInternal = true;
context->isJSContext = true;
- Scoped<QQmlContextWrapper> qml(scope, scope.engine->memoryManager->allocObject<QQmlContextWrapper>(context, (QObject*)0));
+ Scoped<QQmlContextWrapper> qml(scope, scope.engine->memoryManager->allocObject<QQmlContextWrapper>(context, (QObject*)nullptr));
qml->d()->isNullWrapper = true;
qml->setReadOnly(false);
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 9ee357eca5..5ebd385cfb 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -99,7 +99,7 @@ QPair<QObject *, int> QObjectMethod::extractQtMethod(const QV4::FunctionObject *
return qMakePair(method->object(), method->methodIndex());
}
- return qMakePair((QObject *)0, -1);
+ return qMakePair((QObject *)nullptr, -1);
}
static QPair<QObject *, int> extractQtSignal(const Value &value)
@@ -116,7 +116,7 @@ static QPair<QObject *, int> extractQtSignal(const Value &value)
return qMakePair(handler->object(), handler->signalIndex());
}
- return qMakePair((QObject *)0, -1);
+ return qMakePair((QObject *)nullptr, -1);
}
static QV4::ReturnedValue loadProperty(QV4::ExecutionEngine *v4, QObject *object,
@@ -126,7 +126,7 @@ static QV4::ReturnedValue loadProperty(QV4::ExecutionEngine *v4, QObject *object
QV4::Scope scope(v4);
if (property.isQObject()) {
- QObject *rv = 0;
+ QObject *rv = nullptr;
property.readProperty(object, &rv);
return QV4::QObjectWrapper::wrap(v4, rv);
} else if (property.isQList()) {
@@ -194,7 +194,7 @@ static QV4::ReturnedValue loadProperty(QV4::ExecutionEngine *v4, QObject *object
"'%s::%s'", p.typeName(), object->metaObject()->className(), p.name());
return QV4::Encode::undefined();
} else {
- QVariant v(property.propType(), (void *)0);
+ QVariant v(property.propType(), (void *)nullptr);
property.readProperty(object, v.data());
return scope.engine->fromVariant(v);
}
@@ -217,7 +217,7 @@ QQmlPropertyData *QObjectWrapper::findProperty(ExecutionEngine *engine, QObject
Q_UNUSED(revisionMode);
QQmlData *ddata = QQmlData::get(o, false);
- QQmlPropertyData *result = 0;
+ QQmlPropertyData *result = nullptr;
if (ddata && ddata->propertyCache)
result = ddata->propertyCache->property(name, o, qmlContext);
else
@@ -249,7 +249,7 @@ ReturnedValue QObjectWrapper::getProperty(ExecutionEngine *engine, QObject *obje
}
}
- QQmlEnginePrivate *ep = engine->qmlEngine() ? QQmlEnginePrivate::get(engine->qmlEngine()) : 0;
+ QQmlEnginePrivate *ep = engine->qmlEngine() ? QQmlEnginePrivate::get(engine->qmlEngine()) : nullptr;
if (captureRequired && ep && ep->propertyCapture && !property->isConstant())
ep->propertyCapture->captureProperty(object, property->coreIndex(), property->notifyIndex());
@@ -434,7 +434,7 @@ void QObjectWrapper::setProperty(ExecutionEngine *engine, QObject *object, QQmlP
return;
}
- QQmlBinding *newBinding = 0;
+ QQmlBinding *newBinding = nullptr;
QV4::Scope scope(engine);
QV4::ScopedFunctionObject f(scope, value);
if (f) {
@@ -496,9 +496,9 @@ void QObjectWrapper::setProperty(ExecutionEngine *engine, QObject *object, QQmlP
QMetaObject::metacall(object, QMetaObject::WriteProperty, property->coreIndex(), argv);
if (value.isNull() && property->isQObject()) {
- PROPERTY_STORE(QObject*, 0);
+ PROPERTY_STORE(QObject*, nullptr);
} else if (value.isUndefined() && property->isResettable()) {
- void *a[] = { 0 };
+ void *a[] = { nullptr };
QMetaObject::metacall(object, QMetaObject::ResetProperty, property->coreIndex(), a);
} else if (value.isUndefined() && property->propType() == qMetaTypeId<QVariant>()) {
PROPERTY_STORE(QVariant, QVariant());
@@ -531,7 +531,7 @@ void QObjectWrapper::setProperty(ExecutionEngine *engine, QObject *object, QQmlP
Q_ASSERT(vmemo);
vmemo->setVMEProperty(property->coreIndex(), value);
} else if (property->propType() == qMetaTypeId<QQmlScriptString>() && (value.isUndefined() || value.isPrimitive())) {
- QQmlScriptString ss(value.toQStringNoThrow(), 0 /* context */, object);
+ QQmlScriptString ss(value.toQStringNoThrow(), nullptr /* context */, object);
if (value.isNumber()) {
ss.d->numberValue = value.toNumber();
ss.d->isNumberLiteral = true;
@@ -549,7 +549,7 @@ void QObjectWrapper::setProperty(ExecutionEngine *engine, QObject *object, QQmlP
QQmlContextData *callingQmlContext = scope.engine->callingQmlContext();
if (!QQmlPropertyPrivate::write(object, *property, v, callingQmlContext)) {
- const char *valueType = 0;
+ const char *valueType = nullptr;
if (v.userType() == QVariant::Invalid) valueType = "null";
else valueType = QMetaType::typeName(v.userType());
@@ -590,7 +590,7 @@ ReturnedValue QObjectWrapper::wrap_slowPath(ExecutionEngine *engine, QObject *ob
} else {
// If this object is tainted, we have to check to see if it is in our
// tainted object list
- ScopedObject alternateWrapper(scope, (Object *)0);
+ ScopedObject alternateWrapper(scope, (Object *)nullptr);
if (engine->m_multiplyWrappedQObjects && ddata->hasTaintedV4Object)
alternateWrapper = engine->m_multiplyWrappedQObjects->value(object);
@@ -736,7 +736,7 @@ void QObjectWrapper::advanceIterator(Managed *m, ObjectIterator *it, Value *name
static const int destroyedIdx2 = QObject::staticMetaObject.indexOfSignal("destroyed()");
static const int deleteLaterIdx = QObject::staticMetaObject.indexOfSlot("deleteLater()");
- name->setM(0);
+ name->setM(nullptr);
*index = UINT_MAX;
QObjectWrapper *that = static_cast<QObjectWrapper*>(m);
@@ -813,7 +813,7 @@ struct QObjectSlotDispatcher : public QtPrivate::QSlotObjectBase
break;
QQmlMetaObject::ArgTypeStorage storage;
- int *argsTypes = QQmlMetaObject(r).methodParameterTypes(This->signalIndex, &storage, 0);
+ int *argsTypes = QQmlMetaObject(r).methodParameterTypes(This->signalIndex, &storage, nullptr);
int argCount = argsTypes ? argsTypes[0]:0;
@@ -842,7 +842,7 @@ struct QObjectSlotDispatcher : public QtPrivate::QSlotObjectBase
QQmlEnginePrivate::get(qmlEngine)->warning(error);
} else {
QMessageLogger(error.url().toString().toLatin1().constData(),
- error.line(), 0).warning().noquote()
+ error.line(), nullptr).warning().noquote()
<< error.toString();
}
}
@@ -1052,8 +1052,8 @@ void QObjectWrapper::destroyObject(bool lastCall)
if (ddata && ddata->ownContext) {
Q_ASSERT(ddata->ownContext == ddata->context);
ddata->ownContext->emitDestruction();
- ddata->ownContext = 0;
- ddata->context = 0;
+ ddata->ownContext = nullptr;
+ ddata->context = nullptr;
}
// This object is notionally destroyed now
ddata->isQueuedForDeletion = true;
@@ -1181,7 +1181,7 @@ static QV4::ReturnedValue CallMethod(const QQmlObjectOrGadget &object, int index
} else {
- void *args[] = { 0 };
+ void *args[] = { nullptr };
object.metacall(callType, index, args);
return Encode::undefined();
@@ -1354,7 +1354,7 @@ static const QQmlPropertyData * RelatedMethod(const QQmlObjectOrGadget &object,
const QQmlPropertyCache *propertyCache)
{
if (!current->isOverload())
- return 0;
+ return nullptr;
Q_ASSERT(!current->overrideIndexIsProperty());
@@ -1372,7 +1372,7 @@ static const QQmlPropertyData * RelatedMethod(const QQmlObjectOrGadget &object,
// If we've been called before with the same override index, then
// we can't go any further...
if (&dummy == current && dummy.coreIndex() == current->overrideIndex())
- return 0;
+ return nullptr;
QMetaMethod method = mo->method(current->overrideIndex());
dummy.load(method);
@@ -1407,7 +1407,7 @@ static QV4::ReturnedValue CallPrecise(const QQmlObjectOrGadget &object, const QQ
if (data.hasArguments()) {
- int *args = 0;
+ int *args = nullptr;
QQmlMetaObject::ArgTypeStorage storage;
if (data.isConstructor())
@@ -1430,7 +1430,7 @@ static QV4::ReturnedValue CallPrecise(const QQmlObjectOrGadget &object, const QQ
} else {
- return CallMethod(object, data.coreIndex(), returnType, 0, 0, engine, callArgs, callType);
+ return CallMethod(object, data.coreIndex(), returnType, 0, nullptr, engine, callArgs, callType);
}
}
@@ -1467,9 +1467,9 @@ static QV4::ReturnedValue CallOverloaded(const QQmlObjectOrGadget &object, const
do {
QQmlMetaObject::ArgTypeStorage storage;
int methodArgumentCount = 0;
- int *methodArgTypes = 0;
+ int *methodArgTypes = nullptr;
if (attempt->hasArguments()) {
- int *args = object.methodParameterTypes(attempt->coreIndex(), &storage, 0);
+ int *args = object.methodParameterTypes(attempt->coreIndex(), &storage, nullptr);
if (!args) // Must be an unknown argument
continue;
@@ -1497,7 +1497,7 @@ static QV4::ReturnedValue CallOverloaded(const QQmlObjectOrGadget &object, const
if (bestParameterScore == 0 && bestMatchScore == 0)
break; // We can't get better than that
- } while ((attempt = RelatedMethod(object, attempt, dummy, propertyCache)) != 0);
+ } while ((attempt = RelatedMethod(object, attempt, dummy, propertyCache)) != nullptr);
if (best.isValid()) {
return CallPrecise(object, best, engine, callArgs, callType);
@@ -1564,7 +1564,7 @@ void *CallArgument::dataPtr()
return stdVectorQModelIndexPtr;
else if (type != 0)
return (void *)&allocData;
- return 0;
+ return nullptr;
}
void CallArgument::initAsType(int callType)
@@ -1582,7 +1582,7 @@ void CallArgument::initAsType(int callType)
callType == QMetaType::Float) {
type = callType;
} else if (callType == QMetaType::QObjectStar) {
- qobjectPtr = 0;
+ qobjectPtr = nullptr;
type = callType;
} else if (callType == QMetaType::QString) {
qstringPtr = new (&allocData) QString();
@@ -1607,7 +1607,7 @@ void CallArgument::initAsType(int callType)
jsonValuePtr = new (&allocData) QJsonValue();
} else {
type = -1;
- qvariantPtr = new (&allocData) QVariant(callType, (void *)0);
+ qvariantPtr = new (&allocData) QVariant(callType, (void *)nullptr);
}
}
@@ -1659,7 +1659,7 @@ void CallArgument::fromValue(int callType, QV4::ExecutionEngine *engine, const Q
qstringPtr = new (&allocData) QString(value.toQStringNoThrow());
type = callType;
} else if (callType == QMetaType::QObjectStar) {
- qobjectPtr = 0;
+ qobjectPtr = nullptr;
if (const QV4::QObjectWrapper *qobjectWrapper = value.as<QV4::QObjectWrapper>())
qobjectPtr = qobjectWrapper->object();
else if (const QV4::QQmlTypeWrapper *qmlTypeWrapper = value.as<QV4::QQmlTypeWrapper>())
@@ -1676,14 +1676,14 @@ void CallArgument::fromValue(int callType, QV4::ExecutionEngine *engine, const Q
uint length = array->getLength();
for (uint ii = 0; ii < length; ++ii) {
- QObject *o = 0;
+ QObject *o = nullptr;
qobjectWrapper = array->getIndexed(ii);
if (!!qobjectWrapper)
o = qobjectWrapper->object();
qlistPtr->append(o);
}
} else {
- QObject *o = 0;
+ QObject *o = nullptr;
if (const QV4::QObjectWrapper *qobjectWrapper = value.as<QV4::QObjectWrapper>())
o = qobjectWrapper->object();
qlistPtr->append(o);
@@ -1740,7 +1740,7 @@ void CallArgument::fromValue(int callType, QV4::ExecutionEngine *engine, const Q
qvariantPtr = new (&allocData) QVariant();
type = -1;
- QQmlEnginePrivate *ep = engine->qmlEngine() ? QQmlEnginePrivate::get(engine->qmlEngine()) : 0;
+ QQmlEnginePrivate *ep = engine->qmlEngine() ? QQmlEnginePrivate::get(engine->qmlEngine()) : nullptr;
QVariant v = scope.engine->toVariant(value, callType);
if (v.userType() == callType) {
@@ -1753,12 +1753,12 @@ void CallArgument::fromValue(int callType, QV4::ExecutionEngine *engine, const Q
if (!mo.isNull()) {
QObject *obj = ep->toQObject(v);
- if (obj != 0 && !QQmlMetaObject::canConvert(obj, mo))
- obj = 0;
+ if (obj != nullptr && !QQmlMetaObject::canConvert(obj, mo))
+ obj = nullptr;
*qvariantPtr = QVariant(callType, &obj);
} else {
- *qvariantPtr = QVariant(callType, (void *)0);
+ *qvariantPtr = QVariant(callType, (void *)nullptr);
}
}
}
@@ -1957,7 +1957,7 @@ ReturnedValue QObjectMethod::callInternal(const Value *thisObject, const Value *
QQmlV4Function func(callData, rv, v4);
QQmlV4Function *funcptr = &func;
- void *args[] = { 0, &funcptr };
+ void *args[] = { nullptr, &funcptr };
object.metacall(QMetaObject::InvokeMetaMethod, method.coreIndex(), args);
return rv->asReturnedValue();
@@ -2089,9 +2089,9 @@ ReturnedValue QMetaObjectWrapper::callOverloadedConstructor(QV4::ExecutionEngine
const QQmlPropertyData & attempt = d()->constructors[i];
QQmlMetaObject::ArgTypeStorage storage;
int methodArgumentCount = 0;
- int *methodArgTypes = 0;
+ int *methodArgTypes = nullptr;
if (attempt.hasArguments()) {
- int *args = object.constructorParameterTypes(attempt.coreIndex(), &storage, 0);
+ int *args = object.constructorParameterTypes(attempt.coreIndex(), &storage, nullptr);
if (!args) // Must be an unknown argument
continue;
diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h
index 28717b5d80..1455acc1b3 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper_p.h
+++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h
@@ -166,8 +166,8 @@ struct Q_QML_EXPORT QObjectWrapper : public Object
QObject *object() const { return d()->object(); }
- ReturnedValue getQmlProperty(QQmlContextData *qmlContext, String *name, RevisionMode revisionMode, bool *hasProperty = 0, bool includeImports = false) const;
- static ReturnedValue getQmlProperty(ExecutionEngine *engine, QQmlContextData *qmlContext, QObject *object, String *name, RevisionMode revisionMode, bool *hasProperty = 0);
+ ReturnedValue getQmlProperty(QQmlContextData *qmlContext, String *name, RevisionMode revisionMode, bool *hasProperty = nullptr, bool includeImports = false) const;
+ static ReturnedValue getQmlProperty(ExecutionEngine *engine, QQmlContextData *qmlContext, QObject *object, String *name, RevisionMode revisionMode, bool *hasProperty = nullptr);
static bool setQmlProperty(ExecutionEngine *engine, QQmlContextData *qmlContext, QObject *object, String *name, RevisionMode revisionMode, const Value &value);
diff --git a/src/qml/jsruntime/qv4regexp.cpp b/src/qml/jsruntime/qv4regexp.cpp
index 36616bc024..d99536829b 100644
--- a/src/qml/jsruntime/qv4regexp.cpp
+++ b/src/qml/jsruntime/qv4regexp.cpp
@@ -48,7 +48,7 @@ RegExpCache::~RegExpCache()
{
for (RegExpCache::Iterator it = begin(), e = end(); it != e; ++it) {
if (RegExp *re = it.value().as<RegExp>())
- re->d()->cache = 0;
+ re->d()->cache = nullptr;
}
}
@@ -100,7 +100,7 @@ void Heap::RegExp::init(ExecutionEngine *engine, const QString &pattern, bool ig
valid = false;
- const char* error = 0;
+ const char* error = nullptr;
JSC::Yarr::YarrPattern yarrPattern(WTF::String(pattern), ignoreCase, multiLine, &error);
if (error)
return;
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp
index 9a5afdf308..000e2c3a7e 100644
--- a/src/qml/jsruntime/qv4regexpobject.cpp
+++ b/src/qml/jsruntime/qv4regexpobject.cpp
@@ -283,25 +283,25 @@ void RegExpPrototype::init(ExecutionEngine *engine, Object *constructor)
ctor->defineReadonlyProperty(engine->id_length(), Primitive::fromInt32(2));
// Properties deprecated in the spec but required by "the web" :(
- ctor->defineAccessorProperty(QStringLiteral("lastMatch"), method_get_lastMatch_n<0>, 0);
- ctor->defineAccessorProperty(QStringLiteral("$&"), method_get_lastMatch_n<0>, 0);
- ctor->defineAccessorProperty(QStringLiteral("$1"), method_get_lastMatch_n<1>, 0);
- ctor->defineAccessorProperty(QStringLiteral("$2"), method_get_lastMatch_n<2>, 0);
- ctor->defineAccessorProperty(QStringLiteral("$3"), method_get_lastMatch_n<3>, 0);
- ctor->defineAccessorProperty(QStringLiteral("$4"), method_get_lastMatch_n<4>, 0);
- ctor->defineAccessorProperty(QStringLiteral("$5"), method_get_lastMatch_n<5>, 0);
- ctor->defineAccessorProperty(QStringLiteral("$6"), method_get_lastMatch_n<6>, 0);
- ctor->defineAccessorProperty(QStringLiteral("$7"), method_get_lastMatch_n<7>, 0);
- ctor->defineAccessorProperty(QStringLiteral("$8"), method_get_lastMatch_n<8>, 0);
- ctor->defineAccessorProperty(QStringLiteral("$9"), method_get_lastMatch_n<9>, 0);
- ctor->defineAccessorProperty(QStringLiteral("lastParen"), method_get_lastParen, 0);
- ctor->defineAccessorProperty(QStringLiteral("$+"), method_get_lastParen, 0);
- ctor->defineAccessorProperty(QStringLiteral("input"), method_get_input, 0);
- ctor->defineAccessorProperty(QStringLiteral("$_"), method_get_input, 0);
- ctor->defineAccessorProperty(QStringLiteral("leftContext"), method_get_leftContext, 0);
- ctor->defineAccessorProperty(QStringLiteral("$`"), method_get_leftContext, 0);
- ctor->defineAccessorProperty(QStringLiteral("rightContext"), method_get_rightContext, 0);
- ctor->defineAccessorProperty(QStringLiteral("$'"), method_get_rightContext, 0);
+ ctor->defineAccessorProperty(QStringLiteral("lastMatch"), method_get_lastMatch_n<0>, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("$&"), method_get_lastMatch_n<0>, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("$1"), method_get_lastMatch_n<1>, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("$2"), method_get_lastMatch_n<2>, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("$3"), method_get_lastMatch_n<3>, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("$4"), method_get_lastMatch_n<4>, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("$5"), method_get_lastMatch_n<5>, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("$6"), method_get_lastMatch_n<6>, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("$7"), method_get_lastMatch_n<7>, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("$8"), method_get_lastMatch_n<8>, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("$9"), method_get_lastMatch_n<9>, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("lastParen"), method_get_lastParen, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("$+"), method_get_lastParen, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("input"), method_get_input, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("$_"), method_get_input, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("leftContext"), method_get_leftContext, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("$`"), method_get_leftContext, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("rightContext"), method_get_rightContext, nullptr);
+ ctor->defineAccessorProperty(QStringLiteral("$'"), method_get_rightContext, nullptr);
defineDefaultProperty(QStringLiteral("constructor"), (o = ctor));
defineDefaultProperty(QStringLiteral("exec"), method_exec, 1);
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index eb4f6a21fc..04cad8ddb7 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -382,11 +382,11 @@ double RuntimeHelpers::stringToNumber(const QString &string)
{
const QStringRef s = QStringRef(&string).trimmed();
if (s.startsWith(QLatin1String("0x")) || s.startsWith(QLatin1String("0X")))
- return s.toLong(0, 16);
+ return s.toLong(nullptr, 16);
bool ok;
QByteArray ba = s.toLatin1();
const char *begin = ba.constData();
- const char *end = 0;
+ const char *end = nullptr;
double d = qstrtod(begin, &end, &ok);
if (end - begin != ba.size()) {
if (ba == "Infinity" || ba == "+Infinity")
@@ -457,7 +457,7 @@ Heap::Object *RuntimeHelpers::convertToObject(ExecutionEngine *engine, const Val
case Value::Undefined_Type:
case Value::Null_Type:
engine->throwTypeError();
- return 0;
+ return nullptr;
case Value::Boolean_Type:
return engine->newBooleanObject(value.booleanValue());
case Value::Managed_Type:
@@ -680,7 +680,7 @@ bool Runtime::method_storeElement(ExecutionEngine *engine, const Value &object,
ReturnedValue Runtime::method_foreachIterator(ExecutionEngine *engine, const Value &in)
{
Scope scope(engine);
- ScopedObject o(scope, (Object *)0);
+ ScopedObject o(scope, (Object *)nullptr);
if (!in.isNullOrUndefined())
o = in.toObject(engine);
return engine->newForEachIteratorObject(o)->asReturnedValue();
@@ -1199,7 +1199,7 @@ ReturnedValue Runtime::method_createCatchContext(ExecutionContext *parent, int e
{
ExecutionEngine *e = parent->engine();
return parent->newCatchContext(e->currentStackFrame->v4Function->compilationUnit->runtimeStrings[exceptionVarNameIndex],
- e->catchException(0))->asReturnedValue();
+ e->catchException(nullptr))->asReturnedValue();
}
void Runtime::method_declareVar(ExecutionEngine *engine, bool deletable, int nameIndex)
@@ -1299,7 +1299,7 @@ ReturnedValue Runtime::method_loadQmlIdObject(ExecutionEngine *engine, const Val
if (!context || index >= (uint)context->idValueCount)
return Encode::undefined();
- QQmlEnginePrivate *ep = engine->qmlEngine() ? QQmlEnginePrivate::get(engine->qmlEngine()) : 0;
+ QQmlEnginePrivate *ep = engine->qmlEngine() ? QQmlEnginePrivate::get(engine->qmlEngine()) : nullptr;
if (ep && ep->propertyCapture)
ep->propertyCapture->captureProperty(&context->idValues[index].bindings);
diff --git a/src/qml/jsruntime/qv4runtimecodegen.cpp b/src/qml/jsruntime/qv4runtimecodegen.cpp
index 662a780e71..fe18ddf9ed 100644
--- a/src/qml/jsruntime/qv4runtimecodegen.cpp
+++ b/src/qml/jsruntime/qv4runtimecodegen.cpp
@@ -50,15 +50,15 @@ void RuntimeCodegen::generateFromFunctionExpression(const QString &fileName,
_module = module;
_module->fileName = fileName;
_module->finalUrl = fileName;
- _context = 0;
+ _context = nullptr;
Compiler::ScanFunctions scan(this, sourceCode, Compiler::GlobalCode);
// fake a global environment
- scan.enterEnvironment(0, Compiler::FunctionCode);
+ scan.enterEnvironment(nullptr, Compiler::FunctionCode);
scan(ast);
scan.leaveEnvironment();
- int index = defineFunction(ast->name.toString(), ast, ast->formals, ast->body ? ast->body->elements : 0);
+ int index = defineFunction(ast->name.toString(), ast, ast->formals, ast->body ? ast->body->elements : nullptr);
_module->rootContext = _module->functions.at(index);
}
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index afb5c21d36..bb20f384b3 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -209,7 +209,7 @@ struct Scoped
enum ConvertType { Convert };
QML_NEARLY_ALWAYS_INLINE void setPointer(const Managed *p) {
- ptr->setM(p ? p->m() : 0);
+ ptr->setM(p ? p->m() : nullptr);
}
QML_NEARLY_ALWAYS_INLINE Scoped(const Scope &scope)
@@ -244,7 +244,7 @@ struct Scoped
QML_NEARLY_ALWAYS_INLINE Scoped(const Scope &scope, const Value *v)
{
ptr = scope.engine->jsAlloca(1);
- setPointer(v ? v->as<T>() : 0);
+ setPointer(v ? v->as<T>() : nullptr);
}
QML_NEARLY_ALWAYS_INLINE Scoped(const Scope &scope, T *t)
@@ -290,7 +290,7 @@ struct Scoped
return *this;
}
Scoped<T> &operator=(Value *v) {
- setPointer(v ? v->as<T>() : 0);
+ setPointer(v ? v->as<T>() : nullptr);
return *this;
}
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp
index 0c5f02bcfc..bb6608bec0 100644
--- a/src/qml/jsruntime/qv4script.cpp
+++ b/src/qml/jsruntime/qv4script.cpp
@@ -62,14 +62,14 @@ using namespace QV4;
Script::Script(ExecutionEngine *v4, QmlContext *qml, CompiledData::CompilationUnit *compilationUnit)
: line(1), column(0), context(v4->rootContext()), strictMode(false), inheritContext(true), parsed(false)
- , compilationUnit(compilationUnit), vmFunction(0), parseAsBinding(true)
+ , compilationUnit(compilationUnit), vmFunction(nullptr), parseAsBinding(true)
{
if (qml)
qmlContext.set(v4, *qml);
parsed = true;
- vmFunction = compilationUnit ? compilationUnit->linkToEngine(v4) : 0;
+ vmFunction = compilationUnit ? compilationUnit->linkToEngine(v4) : nullptr;
}
Script::~Script()
@@ -88,7 +88,7 @@ void Script::parse()
ExecutionEngine *v4 = context->engine();
Scope valueScope(v4);
- Module module(v4->debugger() != 0);
+ Module module(v4->debugger() != nullptr);
Engine ee, *engine = &ee;
Lexer lexer(engine);
@@ -149,10 +149,10 @@ ReturnedValue Script::run()
if (qmlContext.isUndefined()) {
TemporaryAssignment<Function*> savedGlobalCode(engine->globalCode, vmFunction);
- return vmFunction->call(engine->globalObject, 0, 0, context);
+ return vmFunction->call(engine->globalObject, nullptr, 0, context);
} else {
Scoped<QmlContext> qml(valueScope, qmlContext.value());
- return vmFunction->call(0, 0, 0, qml);
+ return vmFunction->call(nullptr, nullptr, 0, qml);
}
}
@@ -199,14 +199,14 @@ QQmlRefPointer<QV4::CompiledData::CompilationUnit> Script::precompile(QV4::Compi
if (!errors.isEmpty()) {
if (reportedErrors)
*reportedErrors << errors;
- return 0;
+ return nullptr;
}
Program *program = AST::cast<Program *>(parser.rootNode());
if (!program) {
// if parsing was successful, and we have no program, then
// we're done...:
- return 0;
+ return nullptr;
}
Codegen cg(unitGenerator, /*strict mode*/false);
@@ -216,7 +216,7 @@ QQmlRefPointer<QV4::CompiledData::CompilationUnit> Script::precompile(QV4::Compi
if (!errors.isEmpty()) {
if (reportedErrors)
*reportedErrors << errors;
- return 0;
+ return nullptr;
}
return cg.generateCompilationUnit(/*generate unit data*/false);
diff --git a/src/qml/jsruntime/qv4script_p.h b/src/qml/jsruntime/qv4script_p.h
index 6ba405f828..24291b9aa6 100644
--- a/src/qml/jsruntime/qv4script_p.h
+++ b/src/qml/jsruntime/qv4script_p.h
@@ -68,11 +68,11 @@ struct Q_QML_EXPORT Script {
Script(ExecutionContext *scope, QV4::Compiler::CompilationMode mode, const QString &sourceCode, const QString &source = QString(), int line = 1, int column = 0)
: sourceFile(source), line(line), column(column), sourceCode(sourceCode)
, context(scope), strictMode(false), inheritContext(false), parsed(false), compilationMode(mode)
- , vmFunction(0), parseAsBinding(false) {}
+ , vmFunction(nullptr), parseAsBinding(false) {}
Script(ExecutionEngine *engine, QmlContext *qml, const QString &sourceCode, const QString &source = QString(), int line = 1, int column = 0)
: sourceFile(source), line(line), column(column), sourceCode(sourceCode)
, context(engine->rootContext()), strictMode(false), inheritContext(true), parsed(false)
- , vmFunction(0), parseAsBinding(true) {
+ , vmFunction(nullptr), parseAsBinding(true) {
if (qml)
qmlContext.set(engine, *qml);
}
@@ -100,7 +100,7 @@ struct Q_QML_EXPORT Script {
static QQmlRefPointer<CompiledData::CompilationUnit> precompile(
QV4::Compiler::Module *module, Compiler::JSUnitGenerator *unitGenerator,
const QString &fileName, const QString &finalUrl, const QString &source,
- QList<QQmlError> *reportedErrors = 0, QQmlJS::Directives *directivesCollector = 0);
+ QList<QQmlError> *reportedErrors = nullptr, QQmlJS::Directives *directivesCollector = nullptr);
static Script *createFromFileOrCache(ExecutionEngine *engine, QmlContext *qmlContext, const QString &fileName, const QUrl &originalUrl);
static ReturnedValue evaluate(ExecutionEngine *engine, const QString &script, QmlContext *qmlContext);
diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp
index 78413f1b0e..7d29d0b517 100644
--- a/src/qml/jsruntime/qv4sequenceobject.cpp
+++ b/src/qml/jsruntime/qv4sequenceobject.cpp
@@ -340,7 +340,7 @@ public:
void containerAdvanceIterator(ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attrs)
{
- name->setM(0);
+ name->setM(nullptr);
*index = UINT_MAX;
if (d()->isReference) {
@@ -535,7 +535,7 @@ public:
{
Q_ASSERT(d()->object);
Q_ASSERT(d()->isReference);
- void *a[] = { d()->container, 0 };
+ void *a[] = { d()->container, nullptr };
QMetaObject::metacall(d()->object, QMetaObject::ReadProperty, d()->propertyIndex, a);
}
@@ -545,7 +545,7 @@ public:
Q_ASSERT(d()->isReference);
int status = -1;
QQmlPropertyData::WriteFlags flags = QQmlPropertyData::DontRemoveBinding;
- void *a[] = { d()->container, 0, &status, &flags };
+ void *a[] = { d()->container, nullptr, &status, &flags };
QMetaObject::metacall(d()->object, QMetaObject::WriteProperty, d()->propertyIndex, a);
}
diff --git a/src/qml/jsruntime/qv4sparsearray.cpp b/src/qml/jsruntime/qv4sparsearray.cpp
index f295e74adc..2a3e28bf63 100644
--- a/src/qml/jsruntime/qv4sparsearray.cpp
+++ b/src/qml/jsruntime/qv4sparsearray.cpp
@@ -89,20 +89,20 @@ const SparseArrayNode *SparseArrayNode::previousNode() const
SparseArrayNode *SparseArrayNode::copy(SparseArray *d) const
{
- SparseArrayNode *n = d->createNode(size_left, 0, false);
+ SparseArrayNode *n = d->createNode(size_left, nullptr, false);
n->value = value;
n->setColor(color());
if (left) {
n->left = left->copy(d);
n->left->setParent(n);
} else {
- n->left = 0;
+ n->left = nullptr;
}
if (right) {
n->right = right->copy(d);
n->right->setParent(n);
} else {
- n->right = 0;
+ n->right = nullptr;
}
return n;
}
@@ -119,7 +119,7 @@ void SparseArray::rotateLeft(SparseArrayNode *x)
SparseArrayNode *&root = header.left;
SparseArrayNode *y = x->right;
x->right = y->left;
- if (y->left != 0)
+ if (y->left != nullptr)
y->left->setParent(x);
y->setParent(x->parent());
if (x == root)
@@ -146,7 +146,7 @@ void SparseArray::rotateRight(SparseArrayNode *x)
SparseArrayNode *&root = header.left;
SparseArrayNode *y = x->left;
x->left = y->right;
- if (y->right != 0)
+ if (y->right != nullptr)
y->right->setParent(x);
y->setParent(x->parent());
if (x == root)
@@ -209,7 +209,7 @@ void SparseArray::deleteNode(SparseArrayNode *z)
SparseArrayNode *y = z;
SparseArrayNode *x;
SparseArrayNode *x_parent;
- if (y->left == 0) {
+ if (y->left == nullptr) {
x = y->right;
if (y == mostLeftNode) {
if (x)
@@ -217,11 +217,11 @@ void SparseArray::deleteNode(SparseArrayNode *z)
else
mostLeftNode = y->parent();
}
- } else if (y->right == 0) {
+ } else if (y->right == nullptr) {
x = y->left;
} else {
y = y->right;
- while (y->left != 0)
+ while (y->left != nullptr)
y = y->left;
x = y->right;
}
@@ -261,7 +261,7 @@ void SparseArray::deleteNode(SparseArrayNode *z)
y->size_left = 0;
}
if (y->color() != SparseArrayNode::Red) {
- while (x != root && (x == 0 || x->color() == SparseArrayNode::Black)) {
+ while (x != root && (x == nullptr || x->color() == SparseArrayNode::Black)) {
if (x == x_parent->left) {
SparseArrayNode *w = x_parent->right;
if (w->color() == SparseArrayNode::Red) {
@@ -270,13 +270,13 @@ void SparseArray::deleteNode(SparseArrayNode *z)
rotateLeft(x_parent);
w = x_parent->right;
}
- if ((w->left == 0 || w->left->color() == SparseArrayNode::Black) &&
- (w->right == 0 || w->right->color() == SparseArrayNode::Black)) {
+ if ((w->left == nullptr || w->left->color() == SparseArrayNode::Black) &&
+ (w->right == nullptr || w->right->color() == SparseArrayNode::Black)) {
w->setColor(SparseArrayNode::Red);
x = x_parent;
x_parent = x_parent->parent();
} else {
- if (w->right == 0 || w->right->color() == SparseArrayNode::Black) {
+ if (w->right == nullptr || w->right->color() == SparseArrayNode::Black) {
if (w->left)
w->left->setColor(SparseArrayNode::Black);
w->setColor(SparseArrayNode::Red);
@@ -298,13 +298,13 @@ void SparseArray::deleteNode(SparseArrayNode *z)
rotateRight(x_parent);
w = x_parent->left;
}
- if ((w->right == 0 || w->right->color() == SparseArrayNode::Black) &&
- (w->left == 0 || w->left->color() == SparseArrayNode::Black)) {
+ if ((w->right == nullptr || w->right->color() == SparseArrayNode::Black) &&
+ (w->left == nullptr || w->left->color() == SparseArrayNode::Black)) {
w->setColor(SparseArrayNode::Red);
x = x_parent;
x_parent = x_parent->parent();
} else {
- if (w->left == 0 || w->left->color() == SparseArrayNode::Black) {
+ if (w->left == nullptr || w->left->color() == SparseArrayNode::Black) {
if (w->right)
w->right->setColor(SparseArrayNode::Black);
w->setColor(SparseArrayNode::Red);
@@ -363,8 +363,8 @@ SparseArrayNode *SparseArray::createNode(uint sl, SparseArrayNode *parent, bool
Q_CHECK_PTR(node);
node->p = (quintptr)parent;
- node->left = 0;
- node->right = 0;
+ node->left = nullptr;
+ node->right = nullptr;
node->size_left = sl;
node->value = UINT_MAX;
++numEntries;
@@ -397,15 +397,15 @@ SparseArray::SparseArray()
{
freeList = Primitive::emptyValue(UINT_MAX).asReturnedValue();
header.p = 0;
- header.left = 0;
- header.right = 0;
+ header.left = nullptr;
+ header.right = nullptr;
mostLeftNode = &header;
}
SparseArray::SparseArray(const SparseArray &other)
{
header.p = 0;
- header.right = 0;
+ header.right = nullptr;
if (other.header.left) {
header.left = other.header.left->copy(this);
header.left->setParent(&header);
diff --git a/src/qml/jsruntime/qv4sparsearray_p.h b/src/qml/jsruntime/qv4sparsearray_p.h
index ca6abcda89..51869b259f 100644
--- a/src/qml/jsruntime/qv4sparsearray_p.h
+++ b/src/qml/jsruntime/qv4sparsearray_p.h
@@ -109,7 +109,7 @@ struct SparseArrayNode
inline SparseArrayNode *SparseArrayNode::lowerBound(uint akey)
{
SparseArrayNode *n = this;
- SparseArrayNode *last = 0;
+ SparseArrayNode *last = nullptr;
while (n) {
if (akey <= n->size_left) {
last = n;
@@ -126,7 +126,7 @@ inline SparseArrayNode *SparseArrayNode::lowerBound(uint akey)
inline SparseArrayNode *SparseArrayNode::upperBound(uint akey)
{
SparseArrayNode *n = this;
- SparseArrayNode *last = 0;
+ SparseArrayNode *last = nullptr;
while (n) {
if (akey < n->size_left) {
last = n;
@@ -223,7 +223,7 @@ inline SparseArrayNode *SparseArray::findNode(uint akey) const
}
}
- return 0;
+ return nullptr;
}
inline uint SparseArray::pop_front()
diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp
index 40280534c4..8f6f50338e 100644
--- a/src/qml/jsruntime/qv4string.cpp
+++ b/src/qml/jsruntime/qv4string.cpp
@@ -174,7 +174,7 @@ void Heap::String::simplifyString() const
text = result.data_ptr();
text->ref.ref();
const ComplexString *cs = static_cast<const ComplexString *>(this);
- identifier = 0;
+ identifier = nullptr;
cs->left = cs->right = nullptr;
internalClass->engine->memoryManager->changeUnmanagedHeapSizeUsage(qptrdiff(text->size) * (qptrdiff)sizeof(QChar));
diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h
index 679cb7329c..5466cc274d 100644
--- a/src/qml/jsruntime/qv4string_p.h
+++ b/src/qml/jsruntime/qv4string_p.h
@@ -282,7 +282,7 @@ struct ComplexString : String {
template<>
inline const String *Value::as() const {
- return isManaged() && m()->vtable()->isString ? static_cast<const String *>(this) : 0;
+ return isManaged() && m()->vtable()->isString ? static_cast<const String *>(this) : nullptr;
}
template<>
diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp
index 8125aa53b2..e5a02fdc22 100644
--- a/src/qml/jsruntime/qv4stringobject.cpp
+++ b/src/qml/jsruntime/qv4stringobject.cpp
@@ -86,7 +86,7 @@ Heap::String *Heap::StringObject::getIndex(uint index) const
{
QString str = string->toQString();
if (index >= (uint)str.length())
- return 0;
+ return nullptr;
return internalClass->engine->newString(str.mid(index, 1));
}
@@ -109,7 +109,7 @@ bool StringObject::deleteIndexedProperty(Managed *m, uint index)
void StringObject::advanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attrs)
{
- name->setM(0);
+ name->setM(nullptr);
StringObject *s = static_cast<StringObject *>(m);
uint slen = s->d()->string->toQString().length();
if (it->arrayIndex <= slen) {
@@ -717,7 +717,7 @@ ReturnedValue StringPrototype::method_split(const FunctionObject *b, const Value
Scoped<RegExpObject> re(scope, separatorValue);
if (re) {
if (re->value()->pattern->isEmpty()) {
- re = (RegExpObject *)0;
+ re = (RegExpObject *)nullptr;
separatorValue = scope.engine->newString();
}
}
diff --git a/src/qml/jsruntime/qv4typedarray.cpp b/src/qml/jsruntime/qv4typedarray.cpp
index 4ba31f9b6e..ea1532b8ce 100644
--- a/src/qml/jsruntime/qv4typedarray.cpp
+++ b/src/qml/jsruntime/qv4typedarray.cpp
@@ -399,10 +399,10 @@ void TypedArrayPrototype::init(ExecutionEngine *engine, TypedArrayCtor *ctor)
ctor->defineReadonlyProperty(engine->id_prototype(), (o = this));
ctor->defineReadonlyProperty(QStringLiteral("BYTES_PER_ELEMENT"), Primitive::fromInt32(operations[ctor->d()->type].bytesPerElement));
defineDefaultProperty(engine->id_constructor(), (o = ctor));
- defineAccessorProperty(QStringLiteral("buffer"), method_get_buffer, 0);
- defineAccessorProperty(QStringLiteral("byteLength"), method_get_byteLength, 0);
- defineAccessorProperty(QStringLiteral("byteOffset"), method_get_byteOffset, 0);
- defineAccessorProperty(QStringLiteral("length"), method_get_length, 0);
+ defineAccessorProperty(QStringLiteral("buffer"), method_get_buffer, nullptr);
+ defineAccessorProperty(QStringLiteral("byteLength"), method_get_byteLength, nullptr);
+ defineAccessorProperty(QStringLiteral("byteOffset"), method_get_byteOffset, nullptr);
+ defineAccessorProperty(QStringLiteral("length"), method_get_length, nullptr);
defineReadonlyProperty(QStringLiteral("BYTES_PER_ELEMENT"), Primitive::fromInt32(operations[ctor->d()->type].bytesPerElement));
defineDefaultProperty(QStringLiteral("set"), method_set, 1);
@@ -514,7 +514,7 @@ ReturnedValue TypedArrayPrototype::method_set(const FunctionObject *b, const Val
RETURN_UNDEFINED();
}
- char *srcCopy = 0;
+ char *srcCopy = nullptr;
if (buffer->d() == srcBuffer->d()) {
// same buffer, need to take a temporary copy, to not run into problems
srcCopy = new char[srcTypedArray->d()->byteLength];
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index b3f04d69be..97ed13cd91 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -426,7 +426,7 @@ public:
template <typename T>
const T *as() const {
if (!isManaged())
- return 0;
+ return nullptr;
Q_ASSERT(m()->vtable());
#if !defined(QT_NO_QOBJECT_CHECK)
@@ -438,7 +438,7 @@ public:
return static_cast<const T *>(this);
vt = vt->parent;
}
- return 0;
+ return nullptr;
}
template <typename T>
T *as() {
@@ -474,7 +474,7 @@ public:
Value &operator=(ReturnedValue v) { _val = v; return *this; }
Value &operator=(Managed *m) {
if (!m) {
- setM(0);
+ setM(nullptr);
} else {
_val = reinterpret_cast<Value *>(m)->_val;
}
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index d44c219d18..feeeee527a 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -553,7 +553,7 @@ QV4::ReturnedValue VME::exec(const FunctionObject *fo, const Value *thisObject,
Profiling::FunctionCallProfiler profiler(engine, function); // start execution profiling
QV4::Debugging::Debugger *debugger = engine->debugger();
- const uchar *exceptionHandler = 0;
+ const uchar *exceptionHandler = nullptr;
QV4::Value &accumulator = frame.jsFrame->accumulator;
QV4::ReturnedValue acc = Encode::undefined();
diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp
index 9c51013317..cdda0bf7ef 100644
--- a/src/qml/memory/qv4mm.cpp
+++ b/src/qml/memory/qv4mm.cpp
@@ -186,7 +186,7 @@ struct MemorySegment {
}
PageReservation pageReservation;
- Chunk *base = 0;
+ Chunk *base = nullptr;
quint64 allocatedMap = 0;
size_t availableBytes = 0;
uint nChunks = 0;
@@ -203,14 +203,14 @@ Chunk *MemorySegment::allocate(size_t size)
}
size_t requiredChunks = (size + sizeof(Chunk) - 1)/sizeof(Chunk);
uint sequence = 0;
- Chunk *candidate = 0;
+ Chunk *candidate = nullptr;
for (uint i = 0; i < nChunks; ++i) {
if (!testBit(i)) {
if (!candidate)
candidate = base + i;
++sequence;
} else {
- candidate = 0;
+ candidate = nullptr;
sequence = 0;
}
if (sequence == requiredChunks) {
@@ -221,7 +221,7 @@ Chunk *MemorySegment::allocate(size_t size)
return candidate;
}
}
- return 0;
+ return nullptr;
}
struct ChunkAllocator {
@@ -594,7 +594,7 @@ HeapItem *BlockAllocator::allocate(size_t size, bool forceAllocation) {
if (!m) {
if (!forceAllocation)
- return 0;
+ return nullptr;
Chunk *newChunk = chunkAllocator->allocate();
Q_V4_PROFILE_ALLOC(engine, Chunk::DataSize, Profiling::HeapPage);
chunks.push_back(newChunk);
@@ -617,7 +617,7 @@ done:
void BlockAllocator::sweep()
{
- nextFree = 0;
+ nextFree = nullptr;
nFree = 0;
memset(freeBins, 0, sizeof(freeBins));
diff --git a/src/qml/memory/qv4mm_p.h b/src/qml/memory/qv4mm_p.h
index 7dc73bdacc..1ef54ffcc6 100644
--- a/src/qml/memory/qv4mm_p.h
+++ b/src/qml/memory/qv4mm_p.h
@@ -105,7 +105,7 @@ struct BlockAllocator {
void collectGrayItems(MarkStack *markStack);
// bump allocations
- HeapItem *nextFree = 0;
+ HeapItem *nextFree = nullptr;
size_t nFree = 0;
size_t usedSlotsAfterLastSweep = 0;
HeapItem *freeBins[NumBins];
@@ -229,7 +229,7 @@ public:
{
Scope scope(engine);
Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic));
- Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0));
+ Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : nullptr));
Q_UNUSED(prototype);
t->d_unchecked()->init();
return t->d();
@@ -240,7 +240,7 @@ public:
{
Scope scope(engine);
Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic));
- Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0));
+ Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : nullptr));
Q_UNUSED(prototype);
t->d_unchecked()->init(arg1);
return t->d();
@@ -251,7 +251,7 @@ public:
{
Scope scope(engine);
Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic));
- Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0));
+ Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : nullptr));
Q_UNUSED(prototype);
t->d_unchecked()->init(arg1, arg2);
return t->d();
@@ -262,7 +262,7 @@ public:
{
Scope scope(engine);
Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic));
- Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0));
+ Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : nullptr));
Q_UNUSED(prototype);
t->d_unchecked()->init(arg1, arg2, arg3);
return t->d();
@@ -273,7 +273,7 @@ public:
{
Scope scope(engine);
Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic));
- Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0));
+ Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : nullptr));
Q_UNUSED(prototype);
t->d_unchecked()->init(arg1, arg2, arg3, arg4);
return t->d();
diff --git a/src/qml/memory/qv4mmdefs_p.h b/src/qml/memory/qv4mmdefs_p.h
index 4e64ba8118..3e2bae46c2 100644
--- a/src/qml/memory/qv4mmdefs_p.h
+++ b/src/qml/memory/qv4mmdefs_p.h
@@ -272,9 +272,9 @@ Q_STATIC_ASSERT((1 << Chunk::BitShift) == Chunk::Bits);
struct MarkStack {
MarkStack(ExecutionEngine *engine);
- Heap::Base **top = 0;
- Heap::Base **base = 0;
- Heap::Base **limit = 0;
+ Heap::Base **top = nullptr;
+ Heap::Base **base = nullptr;
+ Heap::Base **limit = nullptr;
ExecutionEngine *engine;
void push(Heap::Base *m) {
*top = m;
diff --git a/src/qml/parser/qqmljsast.cpp b/src/qml/parser/qqmljsast.cpp
index 2433522f42..34657a7d48 100644
--- a/src/qml/parser/qqmljsast.cpp
+++ b/src/qml/parser/qqmljsast.cpp
@@ -61,22 +61,22 @@ void Node::accept(Node *node, Visitor *visitor)
ExpressionNode *Node::expressionCast()
{
- return 0;
+ return nullptr;
}
BinaryExpression *Node::binaryExpressionCast()
{
- return 0;
+ return nullptr;
}
Statement *Node::statementCast()
{
- return 0;
+ return nullptr;
}
UiObjectMember *Node::uiObjectMemberCast()
{
- return 0;
+ return nullptr;
}
ExpressionNode *ExpressionNode::expressionCast()
diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h
index 7291cf0d3d..acbd88d466 100644
--- a/src/qml/parser/qqmljsast_p.h
+++ b/src/qml/parser/qqmljsast_p.h
@@ -457,11 +457,11 @@ public:
QQMLJS_DECLARE_AST_NODE(ArrayLiteral)
ArrayLiteral(Elision *e):
- elements (0), elision (e)
+ elements (nullptr), elision (e)
{ kind = K; }
ArrayLiteral(ElementList *elts):
- elements (elts), elision (0)
+ elements (elts), elision (nullptr)
{ kind = K; }
ArrayLiteral(ElementList *elts, Elision *e):
@@ -490,7 +490,7 @@ public:
QQMLJS_DECLARE_AST_NODE(ObjectLiteral)
ObjectLiteral():
- properties (0) { kind = K; }
+ properties (nullptr) { kind = K; }
ObjectLiteral(PropertyAssignmentList *plist):
properties (plist) { kind = K; }
@@ -535,7 +535,7 @@ public:
inline Elision *finish ()
{
Elision *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -564,7 +564,7 @@ public:
inline ElementList *finish ()
{
ElementList *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -641,7 +641,7 @@ public:
inline PropertyAssignmentList *finish ()
{
PropertyAssignmentList *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -693,7 +693,7 @@ public:
};
PropertyGetterSetter(PropertyName *n, FunctionBody *b)
- : PropertyAssignment(n), type(Getter), formals(0), functionBody (b)
+ : PropertyAssignment(n), type(Getter), formals(nullptr), functionBody (b)
{ kind = K; }
PropertyGetterSetter(PropertyName *n, FormalParameterList *f, FunctionBody *b)
@@ -917,7 +917,7 @@ public:
inline ArgumentList *finish ()
{
ArgumentList *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -1281,7 +1281,7 @@ public:
inline StatementList *finish ()
{
StatementList *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -1377,9 +1377,9 @@ public:
inline VariableDeclarationList *finish(VariableDeclaration::VariableScope s)
{
VariableDeclarationList *front = next;
- next = 0;
+ next = nullptr;
VariableDeclarationList *vdl;
- for (vdl = front; vdl != 0; vdl = vdl->next) {
+ for (vdl = front; vdl != nullptr; vdl = vdl->next) {
vdl->declaration->scope = s;
}
return front;
@@ -1436,7 +1436,7 @@ class QML_PARSER_EXPORT IfStatement: public Statement
public:
QQMLJS_DECLARE_AST_NODE(IfStatement)
- IfStatement(ExpressionNode *e, Statement *t, Statement *f = 0):
+ IfStatement(ExpressionNode *e, Statement *t, Statement *f = nullptr):
expression (e), ok (t), ko (f)
{ kind = K; }
@@ -1727,7 +1727,7 @@ class QML_PARSER_EXPORT CaseBlock: public Node
public:
QQMLJS_DECLARE_AST_NODE(CaseBlock)
- CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0):
+ CaseBlock(CaseClauses *c, DefaultClause *d = nullptr, CaseClauses *r = nullptr):
clauses (c), defaultClause (d), moreClauses (r)
{ kind = K; }
@@ -1824,7 +1824,7 @@ public:
inline CaseClauses *finish ()
{
CaseClauses *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -1960,11 +1960,11 @@ public:
{ kind = K; }
TryStatement(Statement *stmt, Finally *f):
- statement (stmt), catchExpression (0), finallyExpression (f)
+ statement (stmt), catchExpression (nullptr), finallyExpression (f)
{ kind = K; }
TryStatement(Statement *stmt, Catch *c):
- statement (stmt), catchExpression (c), finallyExpression (0)
+ statement (stmt), catchExpression (c), finallyExpression (nullptr)
{ kind = K; }
void accept0(Visitor *visitor) override;
@@ -2058,7 +2058,7 @@ public:
inline FormalParameterList *finish ()
{
FormalParameterList *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -2106,7 +2106,7 @@ public:
inline SourceElements *finish ()
{
SourceElements *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -2240,7 +2240,7 @@ public:
UiQualifiedId *finish()
{
UiQualifiedId *head = next;
- next = 0;
+ next = nullptr;
return head;
}
@@ -2264,7 +2264,7 @@ public:
QQMLJS_DECLARE_AST_NODE(UiImport)
UiImport(const QStringRef &fileName)
- : fileName(fileName), importUri(0)
+ : fileName(fileName), importUri(nullptr)
{ kind = K; }
UiImport(UiQualifiedId *uri)
@@ -2328,7 +2328,7 @@ public:
UiObjectMemberList *finish()
{
UiObjectMemberList *head = next;
- next = 0;
+ next = nullptr;
return head;
}
@@ -2357,7 +2357,7 @@ public:
UiQualifiedPragmaId *finish()
{
UiQualifiedPragmaId *head = next;
- next = 0;
+ next = nullptr;
return head;
}
@@ -2430,7 +2430,7 @@ public:
UiHeaderItemList *finish()
{
UiHeaderItemList *head = next;
- next = 0;
+ next = nullptr;
return head;
}
@@ -2509,7 +2509,7 @@ public:
UiArrayMemberList *finish()
{
UiArrayMemberList *head = next;
- next = 0;
+ next = nullptr;
return head;
}
@@ -2570,7 +2570,7 @@ public:
inline UiParameterList *finish ()
{
UiParameterList *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -2590,13 +2590,13 @@ public:
UiPublicMember(UiQualifiedId *memberType,
const QStringRef &name)
- : type(Property), memberType(memberType), name(name), statement(0), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
+ : type(Property), memberType(memberType), name(name), statement(nullptr), binding(nullptr), isDefaultMember(false), isReadonlyMember(false), parameters(nullptr)
{ kind = K; }
UiPublicMember(UiQualifiedId *memberType,
const QStringRef &name,
Statement *statement)
- : type(Property), memberType(memberType), name(name), statement(statement), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
+ : type(Property), memberType(memberType), name(name), statement(statement), binding(nullptr), isDefaultMember(false), isReadonlyMember(false), parameters(nullptr)
{ kind = K; }
void accept0(Visitor *visitor) override;
@@ -2825,7 +2825,7 @@ public:
UiEnumMemberList *finish()
{
UiEnumMemberList *head = next;
- next = 0;
+ next = nullptr;
return head;
}
diff --git a/src/qml/parser/qqmljsengine_p.cpp b/src/qml/parser/qqmljsengine_p.cpp
index 7a6d9c3826..b4f0debf85 100644
--- a/src/qml/parser/qqmljsengine_p.cpp
+++ b/src/qml/parser/qqmljsengine_p.cpp
@@ -120,7 +120,7 @@ double integerFromString(const QString &str, int radix)
Engine::Engine()
- : _lexer(0), _directives(0)
+ : _lexer(nullptr), _directives(nullptr)
{ }
Engine::~Engine()
diff --git a/src/qml/parser/qqmljsgrammar.cpp b/src/qml/parser/qqmljsgrammar.cpp
index f345990ff9..2aaeb385e3 100644
--- a/src/qml/parser/qqmljsgrammar.cpp
+++ b/src/qml/parser/qqmljsgrammar.cpp
@@ -49,11 +49,11 @@ const char *const QQmlJSGrammar::spell [] = {
"if", "in", "instanceof", "{", "[", "<=", "(", "<", "<<", "<<=",
"-", "-=", "--", "new", "!", "!=", "!==", "numeric literal", "|", "|=",
"||", "+", "+=", "++", "?", "}", "]", "%", "%=", "return",
- ")", ";", 0, "*", "*=", "string literal", "property", "signal", "readonly", "switch",
+ ")", ";", nullptr, "*", "*=", "string literal", "property", "signal", "readonly", "switch",
"this", "throw", "~", "try", "typeof", "var", "void", "while", "with", "^",
"^=", "null", "true", "false", "const", "let", "debugger", "reserved word", "multiline string literal", "comment",
- 0, "enum", "public", "import", "pragma", "as", "on", "get", "set", 0,
- 0, 0, 0, 0, 0, 0, 0, 0
+ nullptr, "enum", "public", "import", "pragma", "as", "on", "get", "set", nullptr,
+ nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr
};
const short QQmlJSGrammar::lhs [] = {
diff --git a/src/qml/parser/qqmljslexer.cpp b/src/qml/parser/qqmljslexer.cpp
index bf56307e39..aab9025a08 100644
--- a/src/qml/parser/qqmljslexer.cpp
+++ b/src/qml/parser/qqmljslexer.cpp
@@ -85,11 +85,11 @@ static inline QChar convertUnicode(QChar c1, QChar c2, QChar c3, QChar c4)
Lexer::Lexer(Engine *engine)
: _engine(engine)
- , _codePtr(0)
- , _endPtr(0)
- , _lastLinePtr(0)
- , _tokenLinePtr(0)
- , _tokenStartPtr(0)
+ , _codePtr(nullptr)
+ , _endPtr(nullptr)
+ , _lastLinePtr(nullptr)
+ , _tokenLinePtr(nullptr)
+ , _tokenStartPtr(nullptr)
, _char(QLatin1Char('\n'))
, _errorCode(NoError)
, _currentLineNumber(0)
@@ -589,7 +589,7 @@ again:
chars.append('\0');
const char *begin = chars.constData();
- const char *end = 0;
+ const char *end = nullptr;
bool ok = false;
_tokenValue = qstrtod(begin, &end, &ok);
@@ -915,7 +915,7 @@ int Lexer::scanNumber(QChar ch)
scanChar();
}
buf.append('\0');
- _tokenValue = strtod(buf.constData(), 0);
+ _tokenValue = strtod(buf.constData(), nullptr);
return T_NUMERIC_LITERAL;
}
} else if (_char.isDigit() && !qmlMode()) {
@@ -1010,7 +1010,7 @@ int Lexer::scanNumber(QChar ch)
chars.append('\0');
const char *begin = chars.constData();
- const char *end = 0;
+ const char *end = nullptr;
bool ok = false;
_tokenValue = qstrtod(begin, &end, &ok);
diff --git a/src/qml/parser/qqmljsmemorypool_p.h b/src/qml/parser/qqmljsmemorypool_p.h
index 536f5d4239..5682d66f45 100644
--- a/src/qml/parser/qqmljsmemorypool_p.h
+++ b/src/qml/parser/qqmljsmemorypool_p.h
@@ -72,11 +72,11 @@ class QML_PARSER_EXPORT MemoryPool : public QSharedData
public:
MemoryPool()
- : _blocks(0),
+ : _blocks(nullptr),
_allocatedBlocks(0),
_blockCount(-1),
- _ptr(0),
- _end(0)
+ _ptr(nullptr),
+ _end(nullptr)
{ }
~MemoryPool()
@@ -105,7 +105,7 @@ public:
void reset()
{
_blockCount = -1;
- _ptr = _end = 0;
+ _ptr = _end = nullptr;
}
template <typename Tp> Tp *New() { return new (this->allocate(sizeof(Tp))) Tp(); }
@@ -125,7 +125,7 @@ private:
Q_CHECK_PTR(_blocks);
for (int index = _blockCount; index < _allocatedBlocks; ++index)
- _blocks[index] = 0;
+ _blocks[index] = nullptr;
}
char *&block = _blocks[_blockCount];
diff --git a/src/qml/parser/qqmljsparser.cpp b/src/qml/parser/qqmljsparser.cpp
index df16a24bcc..f1beec6387 100644
--- a/src/qml/parser/qqmljsparser.cpp
+++ b/src/qml/parser/qqmljsparser.cpp
@@ -87,14 +87,14 @@ Parser::Parser(Engine *engine):
pool(engine->pool()),
tos(0),
stack_size(0),
- sym_stack(0),
- state_stack(0),
- location_stack(0),
- string_stack(0),
- program(0),
+ sym_stack(nullptr),
+ state_stack(nullptr),
+ location_stack(nullptr),
+ string_stack(nullptr),
+ program(nullptr),
yylval(0),
- first_token(0),
- last_token(0)
+ first_token(nullptr),
+ last_token(nullptr)
{
}
@@ -143,7 +143,7 @@ AST::UiQualifiedId *Parser::reparseAsQualifiedId(AST::ExpressionNode *expr)
return currentId->finish();
}
- return 0;
+ return nullptr;
}
AST::UiQualifiedPragmaId *Parser::reparseAsQualifiedPragmaId(AST::ExpressionNode *expr)
@@ -155,7 +155,7 @@ AST::UiQualifiedPragmaId *Parser::reparseAsQualifiedPragmaId(AST::ExpressionNode
return q->finish();
}
- return 0;
+ return nullptr;
}
@@ -188,7 +188,7 @@ bool Parser::parse(int startToken)
}
tos = -1;
- program = 0;
+ program = nullptr;
do {
if (++tos == stack_size)
@@ -315,7 +315,7 @@ case 24: {
} break;
case 25: {
- AST::UiPragma *node = 0;
+ AST::UiPragma *node = nullptr;
if (AST::UiQualifiedPragmaId *qualifiedId = reparseAsQualifiedPragmaId(sym(2).Expression)) {
node = new (pool) AST::UiPragma(qualifiedId);
@@ -334,7 +334,7 @@ case 25: {
} break;
case 26: {
- AST::UiImport *node = 0;
+ AST::UiImport *node = nullptr;
if (AST::StringLiteral *importIdLiteral = AST::cast<AST::StringLiteral *>(sym(2).Expression)) {
node = new (pool) AST::UiImport(importIdLiteral->value);
@@ -357,7 +357,7 @@ case 26: {
} break;
case 27: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 28: {
@@ -386,7 +386,7 @@ case 32: {
} break;
case 33: {
- AST::UiObjectInitializer *node = new (pool) AST::UiObjectInitializer((AST::UiObjectMemberList*)0);
+ AST::UiObjectInitializer *node = new (pool) AST::UiObjectInitializer((AST::UiObjectMemberList*)nullptr);
node->lbraceToken = loc(1);
node->rbraceToken = loc(2);
sym(1).Node = node;
@@ -462,7 +462,7 @@ case 51: {
} break;
case 52: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 53: {
@@ -594,7 +594,7 @@ case 71: {
AST::UiQualifiedId *propertyName = new (pool) AST::UiQualifiedId(stringRef(6));
propertyName->identifierToken = loc(6);
- propertyName->next = 0;
+ propertyName->next = nullptr;
AST::UiArrayBinding *binding = new (pool) AST::UiArrayBinding(
propertyName, sym(9).UiArrayMemberList->finish());
@@ -616,7 +616,7 @@ case 72: {
AST::UiQualifiedId *propertyName = new (pool) AST::UiQualifiedId(stringRef(3));
propertyName->identifierToken = loc(3);
- propertyName->next = 0;
+ propertyName->next = nullptr;
AST::UiObjectBinding *binding = new (pool) AST::UiObjectBinding(
propertyName, sym(5).UiQualifiedId, sym(6).UiObjectInitializer);
@@ -638,7 +638,7 @@ case 73: {
AST::UiQualifiedId *propertyName = new (pool) AST::UiQualifiedId(stringRef(4));
propertyName->identifierToken = loc(4);
- propertyName->next = 0;
+ propertyName->next = nullptr;
AST::UiObjectBinding *binding = new (pool) AST::UiObjectBinding(
propertyName, sym(6).UiQualifiedId, sym(7).UiObjectInitializer);
@@ -770,7 +770,7 @@ case 97: {
} break;
case 98: {
- AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral((AST::Elision *) 0);
+ AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral((AST::Elision *) nullptr);
node->lbracketToken = loc(1);
node->rbracketToken = loc(2);
sym(1).Node = node;
@@ -792,7 +792,7 @@ case 100: {
case 101: {
AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish (),
- (AST::Elision *) 0);
+ (AST::Elision *) nullptr);
node->lbracketToken = loc(1);
node->commaToken = loc(3);
node->rbracketToken = loc(4);
@@ -809,7 +809,7 @@ case 102: {
} break;
case 103: {
- AST::ObjectLiteral *node = 0;
+ AST::ObjectLiteral *node = nullptr;
if (sym(2).Node)
node = new (pool) AST::ObjectLiteral(
sym(2).PropertyAssignmentList->finish ());
@@ -846,7 +846,7 @@ case 106: {
if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(1).Expression)) {
sym(1).UiQualifiedId = qualifiedId;
} else {
- sym(1).UiQualifiedId = 0;
+ sym(1).UiQualifiedId = nullptr;
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
QLatin1String("Expected a qualified name id")));
@@ -856,7 +856,7 @@ case 106: {
} break;
case 107: {
- sym(1).Node = new (pool) AST::ElementList((AST::Elision *) 0, sym(1).Expression);
+ sym(1).Node = new (pool) AST::ElementList((AST::Elision *) nullptr, sym(1).Expression);
} break;
case 108: {
@@ -865,7 +865,7 @@ case 108: {
case 109: {
AST::ElementList *node = new (pool) AST::ElementList(sym(1).ElementList,
- (AST::Elision *) 0, sym(3).Expression);
+ (AST::Elision *) nullptr, sym(3).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
@@ -1010,7 +1010,7 @@ case 167: {
} break;
case 168: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 169: {
@@ -1437,7 +1437,7 @@ case 262: {
} break;
case 263: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 266: {
@@ -1447,7 +1447,7 @@ case 266: {
} break;
case 267: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 284: {
@@ -1466,7 +1466,7 @@ case 286: {
} break;
case 287: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 288: {
@@ -1537,7 +1537,7 @@ case 300: {
} break;
case 301: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 303: {
@@ -1546,7 +1546,7 @@ case 303: {
} break;
case 304: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 306: {
@@ -1718,7 +1718,7 @@ case 334: {
} break;
case 335: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 336: {
@@ -1840,7 +1840,7 @@ case 354: {
} break;
case 355: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 356: {
@@ -1848,7 +1848,7 @@ case 356: {
} break;
case 357: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 359: {
@@ -1876,7 +1876,7 @@ case 365: {
} break;
case 366: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
} // switch
diff --git a/src/qml/parser/qqmljsparser_p.h b/src/qml/parser/qqmljsparser_p.h
index 9dfee70f3a..b4aecd2f08 100644
--- a/src/qml/parser/qqmljsparser_p.h
+++ b/src/qml/parser/qqmljsparser_p.h
@@ -146,7 +146,7 @@ public:
AST::Statement *statement() const
{
if (! program)
- return 0;
+ return nullptr;
return program->statementCast();
}
@@ -154,7 +154,7 @@ public:
AST::ExpressionNode *expression() const
{
if (! program)
- return 0;
+ return nullptr;
return program->expressionCast();
}
@@ -162,7 +162,7 @@ public:
AST::UiObjectMember *uiObjectMember() const
{
if (! program)
- return 0;
+ return nullptr;
return program->uiObjectMemberCast();
}
diff --git a/src/qml/qml/ftw/qbitfield_p.h b/src/qml/qml/ftw/qbitfield_p.h
index 8f35842249..92017580d6 100644
--- a/src/qml/qml/ftw/qbitfield_p.h
+++ b/src/qml/qml/ftw/qbitfield_p.h
@@ -77,12 +77,12 @@ private:
};
QBitField::QBitField()
-: bits(0), ownData(0), data(0)
+: bits(0), ownData(nullptr), data(nullptr)
{
}
QBitField::QBitField(const quint32 *bitData, int bitCount)
-: bits((quint32)bitCount), ownData(0), data(bitData)
+: bits((quint32)bitCount), ownData(nullptr), data(bitData)
{
}
diff --git a/src/qml/qml/ftw/qfieldlist_p.h b/src/qml/qml/ftw/qfieldlist_p.h
index d83d708b5e..2bf07fb20d 100644
--- a/src/qml/qml/ftw/qfieldlist_p.h
+++ b/src/qml/qml/ftw/qfieldlist_p.h
@@ -141,7 +141,7 @@ N *QForwardFieldList<N, nextMember>::takeFirst()
N *value = *_first;
if (value) {
_first = next(value);
- value->*nextMember = 0;
+ value->*nextMember = nullptr;
}
return value;
}
@@ -149,7 +149,7 @@ N *QForwardFieldList<N, nextMember>::takeFirst()
template<class N, N *N::*nextMember>
void QForwardFieldList<N, nextMember>::prepend(N *v)
{
- Q_ASSERT(v->*nextMember == 0);
+ Q_ASSERT(v->*nextMember == nullptr);
v->*nextMember = *_first;
_first = v;
}
@@ -229,7 +229,7 @@ void QForwardFieldList<N, nextMember>::setFlag2Value(bool v)
template<class N, N *N::*nextMember>
QFieldList<N, nextMember>::QFieldList()
-: _first(0), _last(0), _flag(0), _count(0)
+: _first(nullptr), _last(nullptr), _flag(0), _count(0)
{
}
@@ -246,10 +246,10 @@ N *QFieldList<N, nextMember>::takeFirst()
if (value) {
_first = next(value);
if (_last == value) {
- Q_ASSERT(_first == 0);
- _last = 0;
+ Q_ASSERT(_first == nullptr);
+ _last = nullptr;
}
- value->*nextMember = 0;
+ value->*nextMember = nullptr;
--_count;
}
return value;
@@ -258,7 +258,7 @@ N *QFieldList<N, nextMember>::takeFirst()
template<class N, N *N::*nextMember>
void QFieldList<N, nextMember>::append(N *v)
{
- Q_ASSERT(v->*nextMember == 0);
+ Q_ASSERT(v->*nextMember == nullptr);
if (isEmpty()) {
_first = v;
_last = v;
@@ -272,7 +272,7 @@ void QFieldList<N, nextMember>::append(N *v)
template<class N, N *N::*nextMember>
void QFieldList<N, nextMember>::prepend(N *v)
{
- Q_ASSERT(v->*nextMember == 0);
+ Q_ASSERT(v->*nextMember == nullptr);
if (isEmpty()) {
_first = v;
_last = v;
@@ -375,7 +375,7 @@ void QFieldList<N, nextMember>::copyAndClear(QFieldList<N, nextMember> &o)
_first = o._first;
_last = o._last;
_count = o._count;
- o._first = o._last = 0;
+ o._first = o._last = nullptr;
o._count = 0;
}
@@ -391,8 +391,8 @@ void QFieldList<N, nextMember>::copyAndClearAppend(QForwardFieldList<N, nextMemb
template<class N, N *N::*nextMember>
void QFieldList<N, nextMember>::copyAndClearPrepend(QForwardFieldList<N, nextMember> &o)
{
- _first = 0;
- _last = 0;
+ _first = nullptr;
+ _last = nullptr;
_count = 0;
while (N *n = o.takeFirst()) prepend(n);
}
diff --git a/src/qml/qml/ftw/qfinitestack_p.h b/src/qml/qml/ftw/qfinitestack_p.h
index f1f1a551d5..9a74199137 100644
--- a/src/qml/qml/ftw/qfinitestack_p.h
+++ b/src/qml/qml/ftw/qfinitestack_p.h
@@ -81,7 +81,7 @@ private:
template<typename T>
QFiniteStack<T>::QFiniteStack()
-: _array(0), _alloc(0), _size(0)
+: _array(nullptr), _alloc(0), _size(0)
{
}
@@ -156,7 +156,7 @@ T &QFiniteStack<T>::operator[](int index)
template<typename T>
void QFiniteStack<T>::allocate(int size)
{
- Q_ASSERT(_array == 0);
+ Q_ASSERT(_array == nullptr);
Q_ASSERT(_alloc == 0);
Q_ASSERT(_size == 0);
@@ -177,7 +177,7 @@ void QFiniteStack<T>::deallocate()
free(_array);
- _array = 0;
+ _array = nullptr;
_alloc = 0;
_size = 0;
}
diff --git a/src/qml/qml/ftw/qhashedstring_p.h b/src/qml/qml/ftw/qhashedstring_p.h
index 956805d696..bd2c9fbdb7 100644
--- a/src/qml/qml/ftw/qhashedstring_p.h
+++ b/src/qml/qml/ftw/qhashedstring_p.h
@@ -179,7 +179,7 @@ class Q_AUTOTEST_EXPORT QStringHashNode
{
public:
QStringHashNode()
- : length(0), hash(0), symbolId(0), ckey(0)
+ : length(0), hash(0), symbolId(0), ckey(nullptr)
{
}
@@ -277,7 +277,7 @@ class Q_AUTOTEST_EXPORT QStringHashData
{
public:
QStringHashData()
- : buckets(0), numBuckets(0), size(0), numBits(0)
+ : buckets(nullptr), numBuckets(0), size(0), numBits(0)
#ifdef QSTRINGHASH_LINK_DEBUG
, linkCount(0)
#endif
@@ -292,7 +292,7 @@ public:
#endif
struct IteratorData {
- IteratorData() : n(0), p(0) {}
+ IteratorData() : n(nullptr), p(nullptr) {}
QStringHashNode *n;
void *p;
};
@@ -362,14 +362,14 @@ public:
T value;
};
struct NewedNode : public Node {
- NewedNode(const QHashedString &key, const T &value) : Node(key, value), nextNewed(0) {}
- NewedNode(const QHashedCStringRef &key, const T &value) : Node(key, value), nextNewed(0) {}
- NewedNode(const Node &o) : Node(o), nextNewed(0) {}
+ NewedNode(const QHashedString &key, const T &value) : Node(key, value), nextNewed(nullptr) {}
+ NewedNode(const QHashedCStringRef &key, const T &value) : Node(key, value), nextNewed(nullptr) {}
+ NewedNode(const Node &o) : Node(o), nextNewed(nullptr) {}
NewedNode *nextNewed;
};
struct ReservedNodePool
{
- ReservedNodePool() : count(0), used(0), nodes(0) {}
+ ReservedNodePool() : count(0), used(0), nodes(nullptr) {}
~ReservedNodePool() { delete [] nodes; }
int count;
int used;
@@ -475,13 +475,13 @@ public:
template<class T>
QStringHash<T>::QStringHash()
-: newedNodes(0), nodePool(0), link(0)
+: newedNodes(nullptr), nodePool(nullptr), link(nullptr)
{
}
template<class T>
QStringHash<T>::QStringHash(const QStringHash<T> &other)
-: newedNodes(0), nodePool(0), link(0)
+: newedNodes(nullptr), nodePool(nullptr), link(nullptr)
{
data.numBits = other.data.numBits;
data.size = other.data.size;
@@ -579,14 +579,14 @@ void QStringHash<T>::clear()
if (nodePool) delete nodePool;
delete [] data.buckets;
- data.buckets = 0;
+ data.buckets = nullptr;
data.numBuckets = 0;
data.numBits = 0;
data.size = 0;
- newedNodes = 0;
- nodePool = 0;
- link = 0;
+ newedNodes = nullptr;
+ nodePool = nullptr;
+ link = nullptr;
}
template<class T>
@@ -716,16 +716,16 @@ QStringHash<T>::iterateNext(const QStringHashData::IteratorData &d)
node < (This->nodePool->nodes + This->nodePool->used)) {
node--;
if (node < This->nodePool->nodes)
- node = 0;
+ node = nullptr;
} else {
NewedNode *nn = (NewedNode *)node;
node = nn->nextNewed;
- if (node == 0 && This->nodePool && This->nodePool->used)
+ if (node == nullptr && This->nodePool && This->nodePool->used)
node = This->nodePool->nodes + This->nodePool->used - 1;
}
- if (node == 0 && This->link)
+ if (node == nullptr && This->link)
return This->link->iterateFirst();
QStringHashData::IteratorData rv;
@@ -737,13 +737,13 @@ QStringHash<T>::iterateNext(const QStringHashData::IteratorData &d)
template<class T>
QStringHashData::IteratorData QStringHash<T>::iterateFirst() const
{
- Node *n = 0;
+ Node *n = nullptr;
if (newedNodes)
n = newedNodes;
else if (nodePool && nodePool->used)
n = nodePool->nodes + nodePool->used - 1;
- if (n == 0 && link)
+ if (n == nullptr && link)
return link->iterateFirst();
QStringHashData::IteratorData rv;
@@ -822,7 +822,7 @@ void QStringHash<T>::insert(const K &key, const T &value)
{
// If this is a linked hash, we can't rely on owning the node, so we always
// create a new one.
- Node *n = link?0:findNode(key);
+ Node *n = link?nullptr:findNode(key);
if (n) n->value = value;
else createNode(key, value);
}
@@ -837,7 +837,7 @@ template<class T>
template<class K>
typename QStringHash<T>::Node *QStringHash<T>::findNode(const K &key) const
{
- QStringHashNode *node = data.numBuckets?data.buckets[hashOf(key) % data.numBuckets]:0;
+ QStringHashNode *node = data.numBuckets?data.buckets[hashOf(key) % data.numBuckets]:nullptr;
typename HashedForm<K>::Type hashedKey(hashedString(key));
while (node && !node->equals(hashedKey))
@@ -851,7 +851,7 @@ template<class K>
T *QStringHash<T>::value(const K &key) const
{
Node *n = findNode(key);
- return n?&n->value:0;
+ return n?&n->value:nullptr;
}
template<class T>
@@ -865,14 +865,14 @@ template<class T>
T *QStringHash<T>::value(const QV4::String *string) const
{
Node *n = findNode(string);
- return n?&n->value:0;
+ return n?&n->value:nullptr;
}
template<class T>
template<class K>
bool QStringHash<T>::contains(const K &key) const
{
- return 0 != value(key);
+ return nullptr != value(key);
}
template<class T>
@@ -1089,7 +1089,7 @@ quint32 QHashedString::existingHash() const
}
QHashedStringRef::QHashedStringRef()
-: m_data(0), m_length(0), m_hash(0)
+: m_data(nullptr), m_length(0), m_hash(0)
{
}
@@ -1236,7 +1236,7 @@ quint32 QHashedStringRef::hash() const
}
QHashedCStringRef::QHashedCStringRef()
-: m_data(0), m_length(0), m_hash(0)
+: m_data(nullptr), m_length(0), m_hash(0)
{
}
diff --git a/src/qml/qml/ftw/qintrusivelist_p.h b/src/qml/qml/ftw/qintrusivelist_p.h
index 3d749e697e..c3b16f5b8c 100644
--- a/src/qml/qml/ftw/qintrusivelist_p.h
+++ b/src/qml/qml/ftw/qintrusivelist_p.h
@@ -113,7 +113,7 @@ public:
template<class N, QIntrusiveListNode N::*member>
QIntrusiveList<N, member>::iterator::iterator()
-: _value(0)
+: _value(nullptr)
{
}
@@ -165,7 +165,7 @@ typename QIntrusiveList<N, member>::iterator &QIntrusiveList<N, member>::iterato
template<class N, QIntrusiveListNode N::*member>
QIntrusiveList<N, member>::QIntrusiveList()
-: __first(0)
+: __first(nullptr)
{
}
@@ -178,7 +178,7 @@ QIntrusiveList<N, member>::~QIntrusiveList()
template<class N, QIntrusiveListNode N::*member>
bool QIntrusiveList<N, member>::isEmpty() const
{
- return __first == 0;
+ return __first == nullptr;
}
template<class N, QIntrusiveListNode N::*member>
@@ -215,14 +215,14 @@ bool QIntrusiveList<N, member>::contains(N *n) const
template<class N, QIntrusiveListNode N::*member>
N *QIntrusiveList<N, member>::first() const
{
- return __first?nodeToN(__first):0;
+ return __first?nodeToN(__first):nullptr;
}
template<class N, QIntrusiveListNode N::*member>
N *QIntrusiveList<N, member>::next(N *current)
{
QIntrusiveListNode *nextnode = (current->*member)._next;
- N *nextstruct = nextnode?nodeToN(nextnode):0;
+ N *nextstruct = nextnode?nodeToN(nextnode):nullptr;
return nextstruct;
}
@@ -241,11 +241,11 @@ typename QIntrusiveList<N, member>::iterator QIntrusiveList<N, member>::end()
template<class N, QIntrusiveListNode N::*member>
N *QIntrusiveList<N, member>::nodeToN(QIntrusiveListNode *node)
{
- return (N *)((char *)node - ((char *)&(((N *)0)->*member) - (char *)0));
+ return (N *)((char *)node - ((char *)&(((N *)nullptr)->*member) - (char *)nullptr));
}
QIntrusiveListNode::QIntrusiveListNode()
-: _next(0), _prev(0)
+: _next(nullptr), _prev(nullptr)
{
}
@@ -258,13 +258,13 @@ void QIntrusiveListNode::remove()
{
if (_prev) *_prev = _next;
if (_next) _next->_prev = _prev;
- _prev = 0;
- _next = 0;
+ _prev = nullptr;
+ _next = nullptr;
}
bool QIntrusiveListNode::isInList() const
{
- return _prev != 0;
+ return _prev != nullptr;
}
QT_END_NAMESPACE
diff --git a/src/qml/qml/ftw/qpodvector_p.h b/src/qml/qml/ftw/qpodvector_p.h
index cafe3367de..d0e4f89741 100644
--- a/src/qml/qml/ftw/qpodvector_p.h
+++ b/src/qml/qml/ftw/qpodvector_p.h
@@ -61,7 +61,7 @@ class QPODVector
{
public:
QPODVector()
- : m_count(0), m_capacity(0), m_data(0) {}
+ : m_count(0), m_capacity(0), m_data(nullptr) {}
~QPODVector() { if (m_data) ::free(m_data); }
const T &at(int idx) const {
@@ -154,7 +154,7 @@ public:
other.m_data = m_data;
m_count = 0;
m_capacity = 0;
- m_data = 0;
+ m_data = nullptr;
}
QPODVector<T,Increment> &operator<<(const T &v) { append(v); return *this; }
diff --git a/src/qml/qml/ftw/qqmlrefcount_p.h b/src/qml/qml/ftw/qqmlrefcount_p.h
index 225e18156c..3cfb345b30 100644
--- a/src/qml/qml/ftw/qqmlrefcount_p.h
+++ b/src/qml/qml/ftw/qqmlrefcount_p.h
@@ -137,7 +137,7 @@ void QQmlRefCount::destroy()
template<class T>
QQmlRefPointer<T>::QQmlRefPointer()
-: o(0)
+: o(nullptr)
{
}
diff --git a/src/qml/qml/ftw/qqmlthread.cpp b/src/qml/qml/ftw/qqmlthread.cpp
index cae7088840..78b477b472 100644
--- a/src/qml/qml/ftw/qqmlthread.cpp
+++ b/src/qml/qml/ftw/qqmlthread.cpp
@@ -123,7 +123,7 @@ bool QQmlThreadPrivate::MainObject::event(QEvent *e)
QQmlThreadPrivate::QQmlThreadPrivate(QQmlThread *q)
: q(q), m_threadProcessing(false), m_mainProcessing(false), m_shutdown(false),
- m_mainThreadWaiting(false), mainSync(0), m_mainObject(this)
+ m_mainThreadWaiting(false), mainSync(nullptr), m_mainObject(this)
{
setObjectName(QStringLiteral("QQmlThread"));
}
@@ -155,7 +155,7 @@ void QQmlThreadPrivate::mainEvent()
m_mainProcessing = true;
while (!mainList.isEmpty() || mainSync) {
- bool isSync = mainSync != 0;
+ bool isSync = mainSync != nullptr;
QQmlThread::Message *message = isSync?mainSync:mainList.takeFirst();
unlock();
@@ -165,7 +165,7 @@ void QQmlThreadPrivate::mainEvent()
lock();
if (isSync) {
- mainSync = 0;
+ mainSync = nullptr;
wakeOne();
}
}
@@ -328,7 +328,7 @@ void QQmlThread::internalCallMethodInThread(Message *message)
message->call(this);
delete message;
lock();
- d->mainSync = 0;
+ d->mainSync = nullptr;
wakeOne();
} else {
d->wait();
@@ -345,7 +345,7 @@ void QQmlThread::internalCallMethodInMain(Message *message)
d->lock();
- Q_ASSERT(d->mainSync == 0);
+ Q_ASSERT(d->mainSync == nullptr);
d->mainSync = message;
if (d->m_mainThreadWaiting) {
@@ -359,7 +359,7 @@ void QQmlThread::internalCallMethodInMain(Message *message)
while (d->mainSync) {
if (d->m_shutdown) {
delete d->mainSync;
- d->mainSync = 0;
+ d->mainSync = nullptr;
break;
}
d->wait();
@@ -405,7 +405,7 @@ void QQmlThread::waitForNextMessage()
message->call(this);
delete message;
lock();
- d->mainSync = 0;
+ d->mainSync = nullptr;
wakeOne();
} else {
d->wait();
diff --git a/src/qml/qml/ftw/qqmlthread_p.h b/src/qml/qml/ftw/qqmlthread_p.h
index 295235e255..0ed12a2972 100644
--- a/src/qml/qml/ftw/qqmlthread_p.h
+++ b/src/qml/qml/ftw/qqmlthread_p.h
@@ -124,7 +124,7 @@ private:
friend class QQmlThreadPrivate;
struct Message {
- Message() : next(0) {}
+ Message() : next(nullptr) {}
virtual ~Message() {}
Message *next;
virtual void call(QQmlThread *) = 0;
diff --git a/src/qml/qml/ftw/qrecursionwatcher_p.h b/src/qml/qml/ftw/qrecursionwatcher_p.h
index 99228b9583..56b714f922 100644
--- a/src/qml/qml/ftw/qrecursionwatcher_p.h
+++ b/src/qml/qml/ftw/qrecursionwatcher_p.h
@@ -74,7 +74,7 @@ private:
};
QRecursionNode::QRecursionNode()
-: _r(0)
+: _r(nullptr)
{
}
@@ -89,7 +89,7 @@ QRecursionWatcher<T, Node>::QRecursionWatcher(T *t)
template<class T, QRecursionNode T::*Node>
QRecursionWatcher<T, Node>::~QRecursionWatcher()
{
- if ((_t->*Node)._r == &_r) (_t->*Node)._r = 0;
+ if ((_t->*Node)._r == &_r) (_t->*Node)._r = nullptr;
}
template<class T, QRecursionNode T::*Node>
diff --git a/src/qml/qml/ftw/qrecyclepool_p.h b/src/qml/qml/ftw/qrecyclepool_p.h
index 42a2f13729..39f4f88512 100644
--- a/src/qml/qml/ftw/qrecyclepool_p.h
+++ b/src/qml/qml/ftw/qrecyclepool_p.h
@@ -61,7 +61,7 @@ class QRecyclePoolPrivate
public:
QRecyclePoolPrivate()
: recyclePoolHold(true), outstandingItems(0), cookie(QRECYCLEPOOLCOOKIE),
- currentPage(0), nextAllocated(0)
+ currentPage(nullptr), nextAllocated(nullptr)
{
}
@@ -178,7 +178,7 @@ void QRecyclePoolPrivate<T, Step>::releaseIfPossible()
template<typename T, int Step>
T *QRecyclePoolPrivate<T, Step>::allocate()
{
- PoolType *rv = 0;
+ PoolType *rv = nullptr;
if (nextAllocated) {
rv = nextAllocated;
nextAllocated = rv->nextAllocated;
diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h
index 219df264be..213f23cd98 100644
--- a/src/qml/qml/qqml.h
+++ b/src/qml/qml/qqml.h
@@ -354,7 +354,7 @@ int qmlRegisterRevision(const char *uri, int versionMajor, int versionMinor)
sizeof(T), QQmlPrivate::createInto<T>,
QString(),
- uri, versionMajor, versionMinor, 0, &T::staticMetaObject,
+ uri, versionMajor, versionMinor, nullptr, &T::staticMetaObject,
QQmlPrivate::attachedPropertiesFunc<T>(),
QQmlPrivate::attachedPropertiesMetaObject<T>(),
diff --git a/src/qml/qml/qqmlabstractbinding.cpp b/src/qml/qml/qqmlabstractbinding.cpp
index b1c320afd4..42891c1a8e 100644
--- a/src/qml/qml/qqmlabstractbinding.cpp
+++ b/src/qml/qml/qqmlabstractbinding.cpp
@@ -83,7 +83,7 @@ void QQmlAbstractBinding::addToObject()
// Value type
// Find the value type proxy (if there is one)
- QQmlValueTypeProxyBinding *proxy = 0;
+ QQmlValueTypeProxyBinding *proxy = nullptr;
if (data->hasBindingBit(coreIndex)) {
QQmlAbstractBinding *b = data->bindings;
while (b && (b->targetPropertyIndex().coreIndex() != coreIndex ||
@@ -137,7 +137,7 @@ void QQmlAbstractBinding::removeFromObject()
QQmlAbstractBinding::Ptr next;
next = nextBinding();
- setNextBinding(0);
+ setNextBinding(nullptr);
int coreIndex = targetPropertyIndex().coreIndex();
if (targetPropertyIndex().hasValueTypeIndex()) {
diff --git a/src/qml/qml/qqmlapplicationengine.cpp b/src/qml/qml/qqmlapplicationengine.cpp
index faab8bf926..a0517e4558 100644
--- a/src/qml/qml/qqmlapplicationengine.cpp
+++ b/src/qml/qml/qqmlapplicationengine.cpp
@@ -128,7 +128,7 @@ void QQmlApplicationEnginePrivate::finishLoad(QQmlComponent *c)
case QQmlComponent::Error:
qWarning() << "QQmlApplicationEngine failed to load component";
qWarning() << qPrintable(c->errorString());
- q->objectCreated(0, c->url());
+ q->objectCreated(nullptr, c->url());
break;
case QQmlComponent::Ready: {
auto newObj = c->create();
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp
index a968aa908d..ca3bff43a4 100644
--- a/src/qml/qml/qqmlbinding.cpp
+++ b/src/qml/qml/qqmlbinding.cpp
@@ -70,7 +70,7 @@ QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, const QQmlScr
return b;
QString url;
- QV4::Function *runtimeFunction = 0;
+ QV4::Function *runtimeFunction = nullptr;
QQmlContextData *ctxtdata = QQmlContextData::get(scriptPrivate->context);
QQmlEnginePrivate *engine = QQmlEnginePrivate::get(scriptPrivate->context->engine());
@@ -150,7 +150,7 @@ void QQmlBinding::update(QQmlPropertyData::WriteFlags flags)
QQmlPropertyData vtd;
getPropertyData(&d, &vtd);
Q_ASSERT(d);
- QQmlProperty p = QQmlPropertyPrivate::restore(targetObject(), *d, &vtd, 0);
+ QQmlProperty p = QQmlPropertyPrivate::restore(targetObject(), *d, &vtd, nullptr);
QQmlAbstractBinding::printBindingLoopError(p);
return;
}
@@ -364,7 +364,7 @@ Q_NEVER_INLINE bool QQmlBinding::slowWrite(const QQmlPropertyData &core,
} else if (core.isQList()) {
value = v4engine->toVariant(result, qMetaTypeId<QList<QObject *> >());
} else if (result.isNull() && core.isQObject()) {
- value = QVariant::fromValue((QObject *)0);
+ value = QVariant::fromValue((QObject *)nullptr);
} else if (core.propType() == qMetaTypeId<QList<QUrl> >()) {
value = QQmlPropertyPrivate::resolvedUrlSequence(v4engine->toVariant(result, qMetaTypeId<QList<QUrl> >()), context());
} else if (!isVarProperty && type != qMetaTypeId<QJSValue>()) {
@@ -386,7 +386,7 @@ Q_NEVER_INLINE bool QQmlBinding::slowWrite(const QQmlPropertyData &core,
Q_ASSERT(vmemo);
vmemo->setVMEProperty(core.coreIndex(), result);
} else if (isUndefined && core.isResettable()) {
- void *args[] = { 0 };
+ void *args[] = { nullptr };
QMetaObject::metacall(m_target.data(), QMetaObject::ResetProperty, core.coreIndex(), args);
} else if (isUndefined && type == qMetaTypeId<QVariant>()) {
QQmlPropertyPrivate::writeValueProperty(m_target.data(), core, valueTypeData, QVariant(), context(), flags);
@@ -417,8 +417,8 @@ Q_NEVER_INLINE bool QQmlBinding::slowWrite(const QQmlPropertyData &core,
if (watcher.wasDeleted())
return true;
- const char *valueType = 0;
- const char *propertyType = 0;
+ const char *valueType = nullptr;
+ const char *propertyType = nullptr;
const int userType = value.userType();
if (userType == QMetaType::QObjectStar) {
@@ -530,7 +530,7 @@ void QQmlBinding::setTarget(QObject *object, const QQmlPropertyData &core, const
int aValueTypeIndex;
if (!vme->aliasTarget(coreIndex, &object, &coreIndex, &aValueTypeIndex)) {
- m_target = 0;
+ m_target = nullptr;
m_targetIndex = QQmlPropertyIndex();
return;
}
@@ -539,7 +539,7 @@ void QQmlBinding::setTarget(QObject *object, const QQmlPropertyData &core, const
QQmlData *data = QQmlData::get(object, false);
if (!data || !data->propertyCache) {
- m_target = 0;
+ m_target = nullptr;
m_targetIndex = QQmlPropertyIndex();
return;
}
diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp
index 501184b630..060706ac50 100644
--- a/src/qml/qml/qqmlboundsignal.cpp
+++ b/src/qml/qml/qqmlboundsignal.cpp
@@ -191,7 +191,7 @@ void QQmlBoundSignalExpression::evaluate(void **a)
QQmlMetaObject::ArgTypeStorage storage;
//TODO: lookup via signal index rather than method index as an optimization
int methodIndex = QMetaObjectPrivate::signal(m_target->metaObject(), m_index).methodIndex();
- int *argsTypes = QQmlMetaObject(m_target).methodParameterTypes(methodIndex, &storage, 0);
+ int *argsTypes = QQmlMetaObject(m_target).methodParameterTypes(methodIndex, &storage, nullptr);
int argCount = argsTypes ? *argsTypes : 0;
QV4::JSCallData jsCall(scope, argCount);
@@ -222,7 +222,7 @@ void QQmlBoundSignalExpression::evaluate(void **a)
}
}
- QQmlJavaScriptExpression::evaluate(jsCall.callData(), 0);
+ QQmlJavaScriptExpression::evaluate(jsCall.callData(), nullptr);
ep->dereferenceScarceResources(); // "release" scarce resources if top-level expression evaluation is complete.
}
@@ -245,7 +245,7 @@ void QQmlBoundSignalExpression::evaluate(const QList<QVariant> &args)
jsCall->args[ii] = scope.engine->fromVariant(args[ii]);
}
- QQmlJavaScriptExpression::evaluate(jsCall.callData(), 0);
+ QQmlJavaScriptExpression::evaluate(jsCall.callData(), nullptr);
ep->dereferenceScarceResources(); // "release" scarce resources if top-level expression evaluation is complete.
}
@@ -260,8 +260,8 @@ void QQmlBoundSignalExpression::evaluate(const QList<QVariant> &args)
QQmlBoundSignal::QQmlBoundSignal(QObject *target, int signal, QObject *owner,
QQmlEngine *engine)
: QQmlNotifierEndpoint(QQmlNotifierEndpoint::QQmlBoundSignal),
- m_prevSignal(0), m_nextSignal(0),
- m_enabled(true), m_expression(0)
+ m_prevSignal(nullptr), m_nextSignal(nullptr),
+ m_enabled(true), m_expression(nullptr)
{
addToObject(owner);
@@ -298,8 +298,8 @@ void QQmlBoundSignal::removeFromObject()
if (m_prevSignal) {
*m_prevSignal = m_nextSignal;
if (m_nextSignal) m_nextSignal->m_prevSignal = m_prevSignal;
- m_prevSignal = 0;
- m_nextSignal = 0;
+ m_prevSignal = nullptr;
+ m_nextSignal = nullptr;
}
}
diff --git a/src/qml/qml/qqmlboundsignal_p.h b/src/qml/qml/qqmlboundsignal_p.h
index 3a0b8aed59..d3e584fd13 100644
--- a/src/qml/qml/qqmlboundsignal_p.h
+++ b/src/qml/qml/qqmlboundsignal_p.h
@@ -89,14 +89,14 @@ public:
QString expression() const;
QObject *target() const { return m_target; }
- QQmlEngine *engine() const { return context() ? context()->engine : 0; }
+ QQmlEngine *engine() const { return context() ? context()->engine : nullptr; }
private:
~QQmlBoundSignalExpression();
void init(QQmlContextData *ctxt, QObject *scope);
- bool expressionFunctionValid() const { return function() != 0; }
+ bool expressionFunctionValid() const { return function() != nullptr; }
int m_index;
QObject *m_target;
diff --git a/src/qml/qml/qqmlboundsignalexpressionpointer_p.h b/src/qml/qml/qqmlboundsignalexpressionpointer_p.h
index de651315f8..685e0160a3 100644
--- a/src/qml/qml/qqmlboundsignalexpressionpointer_p.h
+++ b/src/qml/qml/qqmlboundsignalexpressionpointer_p.h
@@ -58,7 +58,7 @@ class QQmlBoundSignalExpression;
class Q_QML_PRIVATE_EXPORT QQmlBoundSignalExpressionPointer
{
public:
- inline QQmlBoundSignalExpressionPointer() : o(0) {}
+ inline QQmlBoundSignalExpressionPointer() : o(nullptr) {}
QQmlBoundSignalExpressionPointer(QQmlBoundSignalExpression *);
QQmlBoundSignalExpressionPointer(const QQmlBoundSignalExpressionPointer &);
~QQmlBoundSignalExpressionPointer();
diff --git a/src/qml/qml/qqmlcleanup.cpp b/src/qml/qml/qqmlcleanup.cpp
index 708537a303..0d57ef5fe8 100644
--- a/src/qml/qml/qqmlcleanup.cpp
+++ b/src/qml/qml/qqmlcleanup.cpp
@@ -58,7 +58,7 @@ called by QQmlEngine just before it destroys the context.
Create a QQmlCleanup that is not associated with any engine.
*/
QQmlCleanup::QQmlCleanup()
-: prev(0), next(0), engine(0)
+: prev(nullptr), next(nullptr), engine(nullptr)
{
}
@@ -66,7 +66,7 @@ QQmlCleanup::QQmlCleanup()
Create a QQmlCleanup for \a engine
*/
QQmlCleanup::QQmlCleanup(QQmlEngine *engine)
-: prev(0), next(0), engine(0)
+: prev(nullptr), next(nullptr), engine(nullptr)
{
if (!engine)
return;
@@ -109,8 +109,8 @@ QQmlCleanup::~QQmlCleanup()
if (prev) *prev = next;
if (next) next->prev = prev;
- prev = 0;
- next = 0;
+ prev = nullptr;
+ next = nullptr;
}
QT_END_NAMESPACE
diff --git a/src/qml/qml/qqmlcleanup_p.h b/src/qml/qml/qqmlcleanup_p.h
index a1db656477..0e15c28b9d 100644
--- a/src/qml/qml/qqmlcleanup_p.h
+++ b/src/qml/qml/qqmlcleanup_p.h
@@ -64,7 +64,7 @@ public:
QQmlCleanup(QQmlEngine *);
virtual ~QQmlCleanup();
- bool hasEngine() const { return prev != 0; }
+ bool hasEngine() const { return prev != nullptr; }
void addToEngine(QQmlEngine *);
protected:
virtual void clear() = 0;
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index 481507946d..061f3b54a5 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -315,7 +315,7 @@ void QQmlComponentPrivate::typeDataReady(QQmlTypeData *)
Q_ASSERT(typeData);
fromTypeData(typeData);
- typeData = 0;
+ typeData = nullptr;
progress = 1.0;
emit q->statusChanged(q->status());
@@ -349,7 +349,7 @@ void QQmlComponentPrivate::clear()
if (typeData) {
typeData->unregisterCallback(this);
typeData->release();
- typeData = 0;
+ typeData = nullptr;
}
compilationUnit = nullptr;
@@ -820,27 +820,27 @@ QQmlComponentPrivate::beginCreate(QQmlContextData *context)
Q_Q(QQmlComponent);
if (!context) {
qWarning("QQmlComponent: Cannot create a component in a null context");
- return 0;
+ return nullptr;
}
if (!context->isValid()) {
qWarning("QQmlComponent: Cannot create a component in an invalid context");
- return 0;
+ return nullptr;
}
if (context->engine != engine) {
qWarning("QQmlComponent: Must create component in context from the same QQmlEngine");
- return 0;
+ return nullptr;
}
if (state.completePending) {
qWarning("QQmlComponent: Cannot create new component instance before completing the previous");
- return 0;
+ return nullptr;
}
if (!q->isReady()) {
qWarning("QQmlComponent: Component is not ready");
- return 0;
+ return nullptr;
}
// Do not create infinite recursion in object creation
@@ -848,7 +848,7 @@ QQmlComponentPrivate::beginCreate(QQmlContextData *context)
if (++creationDepth.localData() >= maxCreationDepth) {
qWarning("QQmlComponent: Component creation is recursing - aborting");
--creationDepth.localData();
- return 0;
+ return nullptr;
}
Q_ASSERT(creationDepth.localData() >= 1);
depthIncreased = true;
@@ -860,7 +860,7 @@ QQmlComponentPrivate::beginCreate(QQmlContextData *context)
state.completePending = true;
enginePriv->referenceScarceResources();
- QObject *rv = 0;
+ QObject *rv = nullptr;
state.creator.reset(new QQmlObjectCreator(context, compilationUnit, creationContext));
rv = state.creator->create(start);
if (!rv)
@@ -965,7 +965,7 @@ void QQmlComponentPrivate::completeCreate()
}
QQmlComponentAttached::QQmlComponentAttached(QObject *parent)
-: QObject(parent), prev(0), next(0)
+: QObject(parent), prev(nullptr), next(nullptr)
{
}
@@ -973,8 +973,8 @@ QQmlComponentAttached::~QQmlComponentAttached()
{
if (prev) *prev = next;
if (next) next->prev = prev;
- prev = 0;
- next = 0;
+ prev = nullptr;
+ next = nullptr;
}
/*!
@@ -1269,7 +1269,7 @@ void QQmlComponent::createObject(QQmlV4Function *args)
Q_ASSERT(d->engine);
Q_ASSERT(args);
- QObject *parent = 0;
+ QObject *parent = nullptr;
QV4::ExecutionEngine *v4 = args->v4engine();
QV4::Scope scope(v4);
QV4::ScopedValue valuemap(scope, QV4::Primitive::undefinedValue());
@@ -1386,7 +1386,7 @@ void QQmlComponent::incubateObject(QQmlV4Function *args)
QV4::ExecutionEngine *v4 = args->v4engine();
QV4::Scope scope(v4);
- QObject *parent = 0;
+ QObject *parent = nullptr;
QV4::ScopedValue valuemap(scope, QV4::Primitive::undefinedValue());
QQmlIncubator::IncubationMode mode = QQmlIncubator::Asynchronous;
@@ -1457,8 +1457,8 @@ QQmlComponentExtension::QQmlComponentExtension(QV4::ExecutionEngine *v4)
QV4::ScopedObject proto(scope, v4->newObject());
proto->defineAccessorProperty(QStringLiteral("onStatusChanged"),
QV4::QmlIncubatorObject::method_get_statusChanged, QV4::QmlIncubatorObject::method_set_statusChanged);
- proto->defineAccessorProperty(QStringLiteral("status"), QV4::QmlIncubatorObject::method_get_status, 0);
- proto->defineAccessorProperty(QStringLiteral("object"), QV4::QmlIncubatorObject::method_get_object, 0);
+ proto->defineAccessorProperty(QStringLiteral("status"), QV4::QmlIncubatorObject::method_get_status, nullptr);
+ proto->defineAccessorProperty(QStringLiteral("object"), QV4::QmlIncubatorObject::method_get_object, nullptr);
proto->defineDefaultProperty(QStringLiteral("forceCompletion"), QV4::QmlIncubatorObject::method_forceCompletion);
incubationProto.set(v4, proto);
diff --git a/src/qml/qml/qqmlcomponent_p.h b/src/qml/qml/qqmlcomponent_p.h
index 8a58a1ada0..2a8d36f317 100644
--- a/src/qml/qml/qqmlcomponent_p.h
+++ b/src/qml/qml/qqmlcomponent_p.h
@@ -79,7 +79,7 @@ class Q_QML_PRIVATE_EXPORT QQmlComponentPrivate : public QObjectPrivate, public
public:
QQmlComponentPrivate()
- : typeData(0), progress(0.), start(-1), engine(0), creationContext(0), depthIncreased(false) {}
+ : typeData(nullptr), progress(0.), start(-1), engine(nullptr), creationContext(nullptr), depthIncreased(false) {}
void loadUrl(const QUrl &newUrl, QQmlComponent::CompilationMode mode = QQmlComponent::PreferSynchronous);
diff --git a/src/qml/qml/qqmlcomponentattached_p.h b/src/qml/qml/qqmlcomponentattached_p.h
index 8236aac1af..e3bca18857 100644
--- a/src/qml/qml/qqmlcomponentattached_p.h
+++ b/src/qml/qml/qqmlcomponentattached_p.h
@@ -62,7 +62,7 @@ class Q_QML_PRIVATE_EXPORT QQmlComponentAttached : public QObject
{
Q_OBJECT
public:
- QQmlComponentAttached(QObject *parent = 0);
+ QQmlComponentAttached(QObject *parent = nullptr);
~QQmlComponentAttached();
void add(QQmlComponentAttached **a) {
@@ -72,7 +72,7 @@ public:
void rem() {
if (next) next->prev = prev;
*prev = next;
- next = 0; prev = 0;
+ next = nullptr; prev = nullptr;
}
QQmlComponentAttached **prev;
QQmlComponentAttached *next;
diff --git a/src/qml/qml/qqmlcontext.cpp b/src/qml/qml/qqmlcontext.cpp
index 82b8d06dc4..6e43bc735f 100644
--- a/src/qml/qml/qqmlcontext.cpp
+++ b/src/qml/qml/qqmlcontext.cpp
@@ -56,7 +56,7 @@
QT_BEGIN_NAMESPACE
QQmlContextPrivate::QQmlContextPrivate()
-: data(0), notifyIndex(-1)
+: data(nullptr), notifyIndex(-1)
{
}
@@ -177,7 +177,7 @@ QQmlContext::QQmlContext(QQmlEngine *engine, QObject *parent)
d->data = new QQmlContextData(this);
++d->data->refCount;
- d->data->setParent(engine?QQmlContextData::get(engine->rootContext()):0);
+ d->data->setParent(engine?QQmlContextData::get(engine->rootContext()):nullptr);
}
/*!
@@ -191,14 +191,14 @@ QQmlContext::QQmlContext(QQmlContext *parentContext, QObject *parent)
d->data = new QQmlContextData(this);
++d->data->refCount;
- d->data->setParent(parentContext?QQmlContextData::get(parentContext):0);
+ d->data->setParent(parentContext?QQmlContextData::get(parentContext):nullptr);
}
/*!
\internal
*/
QQmlContext::QQmlContext(QQmlContextData *data)
-: QObject(*(new QQmlContextPrivate), 0)
+: QObject(*(new QQmlContextPrivate), nullptr)
{
Q_D(QQmlContext);
d->data = data;
@@ -216,7 +216,7 @@ QQmlContext::~QQmlContext()
{
Q_D(QQmlContext);
- d->data->publicContext = 0;
+ d->data->publicContext = nullptr;
if (!--d->data->refCount)
d->data->destroy();
}
@@ -250,7 +250,7 @@ QQmlEngine *QQmlContext::engine() const
QQmlContext *QQmlContext::parentContext() const
{
Q_D(const QQmlContext);
- return d->data->parent?d->data->parent->asQQmlContext():0;
+ return d->data->parent?d->data->parent->asQQmlContext():nullptr;
}
/*!
@@ -315,7 +315,7 @@ void QQmlContext::setContextProperty(const QString &name, const QVariant &value)
data->refreshExpressions();
} else {
d->propertyValues[idx] = value;
- QMetaObject::activate(this, d->notifyIndex, idx, 0);
+ QMetaObject::activate(this, d->notifyIndex, idx, nullptr);
}
}
@@ -349,8 +349,8 @@ void QQmlContext::setContextProperties(const QVector<PropertyPair> &properties)
QQmlJavaScriptExpression *expressions = data->expressions;
QQmlContextData *childContexts = data->childContexts;
- data->expressions = 0;
- data->childContexts = 0;
+ data->expressions = nullptr;
+ data->childContexts = nullptr;
for (auto property : properties)
setContextProperty(property.name, property.value);
@@ -521,7 +521,7 @@ QObject *QQmlContextPrivate::context_at(QQmlListProperty<QObject> *prop, int ind
int contextProperty = (int)(quintptr)prop->data;
if (d->propertyValues.at(contextProperty).userType() != qMetaTypeId<QList<QObject*> >()) {
- return 0;
+ return nullptr;
} else {
return ((const QList<QObject*> *)d->propertyValues.at(contextProperty).constData())->at(index);
}
@@ -534,12 +534,12 @@ QQmlContextData::QQmlContextData()
}
QQmlContextData::QQmlContextData(QQmlContext *ctxt)
- : engine(0), isInternal(false), isJSContext(false),
+ : engine(nullptr), isInternal(false), isJSContext(false),
isPragmaLibraryContext(false), unresolvedNames(false), hasEmittedDestruction(false), isRootObjectInCreation(false),
- publicContext(ctxt), incubator(0), componentObjectIndex(-1),
- contextObject(0), nextChild(0), prevChild(0),
- expressions(0), contextObjects(0), idValues(0), idValueCount(0),
- componentAttached(0)
+ publicContext(ctxt), incubator(nullptr), componentObjectIndex(-1),
+ contextObject(nullptr), nextChild(nullptr), prevChild(nullptr),
+ expressions(nullptr), contextObjects(nullptr), idValues(nullptr), idValueCount(0),
+ componentAttached(nullptr)
{
}
@@ -556,8 +556,8 @@ void QQmlContextData::emitDestruction()
componentAttached = a->next;
if (componentAttached) componentAttached->prev = &componentAttached;
- a->next = 0;
- a->prev = 0;
+ a->next = nullptr;
+ a->prev = nullptr;
emit a->destruction();
}
@@ -583,14 +583,14 @@ void QQmlContextData::invalidate()
if (prevChild) {
*prevChild = nextChild;
if (nextChild) nextChild->prevChild = prevChild;
- nextChild = 0;
- prevChild = 0;
+ nextChild = nullptr;
+ prevChild = nullptr;
}
importedScripts.clear();
- engine = 0;
- parent = 0;
+ engine = nullptr;
+ parent = nullptr;
}
void QQmlContextData::clearContext()
@@ -601,20 +601,20 @@ void QQmlContextData::clearContext()
while (expression) {
QQmlJavaScriptExpression *nextExpression = expression->m_nextExpression;
- expression->m_prevExpression = 0;
- expression->m_nextExpression = 0;
+ expression->m_prevExpression = nullptr;
+ expression->m_nextExpression = nullptr;
- expression->setContext(0);
+ expression->setContext(nullptr);
expression = nextExpression;
}
- expressions = 0;
+ expressions = nullptr;
}
void QQmlContextData::destroy()
{
Q_ASSERT(refCount == 0);
- linkedContext = 0;
+ linkedContext = nullptr;
// avoid recursion
++refCount;
@@ -629,26 +629,26 @@ void QQmlContextData::destroy()
QQmlData *co = contextObjects;
contextObjects = contextObjects->nextContextObject;
- co->context = 0;
- co->outerContext = 0;
- co->nextContextObject = 0;
- co->prevContextObject = 0;
+ co->context = nullptr;
+ co->outerContext = nullptr;
+ co->nextContextObject = nullptr;
+ co->prevContextObject = nullptr;
}
Q_ASSERT(refCount == 1);
QQmlGuardedContextData *contextGuard = contextGuards;
while (contextGuard) {
QQmlGuardedContextData *next = contextGuard->m_next;
- contextGuard->m_next = 0;
- contextGuard->m_prev = 0;
- contextGuard->m_contextData = 0;
+ contextGuard->m_next = nullptr;
+ contextGuard->m_prev = nullptr;
+ contextGuard->m_contextData = nullptr;
contextGuard = next;
}
- contextGuards = 0;
+ contextGuards = nullptr;
Q_ASSERT(refCount == 1);
delete [] idValues;
- idValues = 0;
+ idValues = nullptr;
Q_ASSERT(refCount == 1);
if (publicContext) {
@@ -746,7 +746,7 @@ void QQmlContextData::refreshExpressionsRecursive(bool isGlobal)
// *structure* (not values) changes.
void QQmlContextData::refreshExpressions()
{
- bool isGlobal = (parent == 0);
+ bool isGlobal = (parent == nullptr);
// For efficiency, we try and minimize the number of guards we have to create
if (expressions_to_run(this, isGlobal) && childContexts) {
@@ -772,7 +772,7 @@ void QQmlContextData::addObject(QObject *o)
{
QQmlData *data = QQmlData::get(o, true);
- Q_ASSERT(data->context == 0);
+ Q_ASSERT(data->context == nullptr);
data->context = this;
data->outerContext = this;
diff --git a/src/qml/qml/qqmlcontext_p.h b/src/qml/qml/qqmlcontext_p.h
index 8939c810fe..ff36d6c9a8 100644
--- a/src/qml/qml/qqmlcontext_p.h
+++ b/src/qml/qml/qqmlcontext_p.h
@@ -178,7 +178,7 @@ public:
QQmlRefPointer<QQmlTypeNameCache> imports;
// My children
- QQmlContextData *childContexts = 0;
+ QQmlContextData *childContexts = nullptr;
// My peers in parent's childContexts list
QQmlContextData *nextChild;
@@ -191,7 +191,7 @@ public:
QQmlData *contextObjects;
// Doubly-linked list of context guards (XXX merge with contextObjects)
- QQmlGuardedContextData *contextGuards = 0;
+ QQmlGuardedContextData *contextGuards = nullptr;
// id guards
struct ContextGuard : public QQmlGuard<QObject>
@@ -261,9 +261,9 @@ private:
inline void clear();
- QQmlContextData *m_contextData = 0;
- QQmlGuardedContextData *m_next = 0;
- QQmlGuardedContextData **m_prev = 0;
+ QQmlContextData *m_contextData = nullptr;
+ QQmlGuardedContextData *m_next = nullptr;
+ QQmlGuardedContextData **m_prev = nullptr;
};
@@ -287,14 +287,14 @@ void QQmlGuardedContextData::clear()
if (m_prev) {
*m_prev = m_next;
if (m_next) m_next->m_prev = m_prev;
- m_contextData = 0;
- m_next = 0;
- m_prev = 0;
+ m_contextData = nullptr;
+ m_next = nullptr;
+ m_prev = nullptr;
}
}
QQmlContextDataRef::QQmlContextDataRef()
- : m_contextData(0)
+ : m_contextData(nullptr)
{
}
@@ -338,7 +338,7 @@ void QQmlContextDataRef::clear()
{
if (m_contextData && !--m_contextData->refCount)
m_contextData->destroy();
- m_contextData = 0;
+ m_contextData = nullptr;
}
QQmlContextDataRef &
@@ -356,7 +356,7 @@ QQmlContextDataRef::operator=(const QQmlContextDataRef &other)
}
QQmlContextData::ContextGuard::ContextGuard()
-: context(0)
+: context(nullptr)
{
}
diff --git a/src/qml/qml/qqmlcustomparser.cpp b/src/qml/qml/qqmlcustomparser.cpp
index cc6e75a39c..5cf87f5264 100644
--- a/src/qml/qml/qqmlcustomparser.cpp
+++ b/src/qml/qml/qqmlcustomparser.cpp
@@ -138,7 +138,7 @@ int QQmlCustomParser::evaluateEnum(const QByteArray& script, bool *ok) const
QQmlType type;
if (imports.isT1()) {
- imports.asT1()->resolveType(scope, &type, 0, 0, 0);
+ imports.asT1()->resolveType(scope, &type, nullptr, nullptr, nullptr);
} else {
QQmlTypeNameCache::Result result = imports.asT2()->query(scope);
if (result.isValid())
@@ -178,7 +178,7 @@ const QMetaObject *QQmlCustomParser::resolveType(const QString& name) const
if (!imports.isT1())
return nullptr;
QQmlType qmltype;
- if (!imports.asT1()->resolveType(name, &qmltype, 0, 0, 0))
+ if (!imports.asT1()->resolveType(name, &qmltype, nullptr, nullptr, nullptr))
return nullptr;
return qmltype.metaObject();
}
diff --git a/src/qml/qml/qqmlcustomparser_p.h b/src/qml/qml/qqmlcustomparser_p.h
index 5eb409990d..2a0f805014 100644
--- a/src/qml/qml/qqmlcustomparser_p.h
+++ b/src/qml/qml/qqmlcustomparser_p.h
@@ -74,8 +74,8 @@ public:
};
Q_DECLARE_FLAGS(Flags, Flag)
- QQmlCustomParser() : engine(0), validator(0), m_flags(NoFlag) {}
- QQmlCustomParser(Flags f) : engine(0), validator(0), m_flags(f) {}
+ QQmlCustomParser() : engine(nullptr), validator(nullptr), m_flags(NoFlag) {}
+ QQmlCustomParser(Flags f) : engine(nullptr), validator(nullptr), m_flags(f) {}
virtual ~QQmlCustomParser() {}
void clearErrors();
diff --git a/src/qml/qml/qqmldata_p.h b/src/qml/qml/qqmldata_p.h
index 17d145f939..20b96d2c4b 100644
--- a/src/qml/qml/qqmldata_p.h
+++ b/src/qml/qml/qqmldata_p.h
@@ -195,9 +195,9 @@ public:
void disconnectNotifiers();
// The context that created the C++ object
- QQmlContextData *context = 0;
+ QQmlContextData *context = nullptr;
// The outermost context in which this object lives
- QQmlContextData *outerContext = 0;
+ QQmlContextData *outerContext = nullptr;
QQmlContextDataRef ownContext;
QQmlAbstractBinding *bindings;
@@ -247,13 +247,13 @@ public:
// to be avoided because QObjectPrivate::currentChildBeingDeleted is in use.
if (priv->isDeletingChildren || priv->wasDeleted) {
Q_ASSERT(!create);
- return 0;
+ return nullptr;
} else if (priv->declarativeData) {
return static_cast<QQmlData *>(priv->declarativeData);
} else if (create) {
return createQQmlData(priv);
} else {
- return 0;
+ return nullptr;
}
}
@@ -264,7 +264,7 @@ public:
return false;
}
- bool hasExtendedData() const { return extendedData != 0; }
+ bool hasExtendedData() const { return extendedData != nullptr; }
QHash<int, QObject *> *attachedProperties() const;
static inline bool wasDeleted(const QObject *);
@@ -325,7 +325,7 @@ QQmlNotifierEndpoint *QQmlData::notify(int index)
Q_ASSERT(index <= 0xFFFF);
if (!notifyList || !(notifyList->connectionMask & (1ULL << quint64(index % 64)))) {
- return 0;
+ return nullptr;
} else if (index < notifyList->notifiesSize) {
return notifyList->notifies[index];
} else if (index <= notifyList->maximumTodoIndex) {
@@ -335,7 +335,7 @@ QQmlNotifierEndpoint *QQmlData::notify(int index)
if (index < notifyList->notifiesSize) {
return notifyList->notifies[index];
} else {
- return 0;
+ return nullptr;
}
}
diff --git a/src/qml/qml/qqmldelayedcallqueue.cpp b/src/qml/qml/qqmldelayedcallqueue.cpp
index 268f91c8ba..5bcf5cd586 100644
--- a/src/qml/qml/qqmldelayedcallqueue.cpp
+++ b/src/qml/qml/qqmldelayedcallqueue.cpp
@@ -89,7 +89,7 @@ void QQmlDelayedCallQueue::DelayedFunctionCall::execute(QV4::ExecutionEngine *en
//
QQmlDelayedCallQueue::QQmlDelayedCallQueue()
- : QObject(0), m_engine(0), m_callbackOutstanding(false)
+ : QObject(nullptr), m_engine(nullptr), m_callbackOutstanding(false)
{
}
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 02e206284b..4054d2f0be 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -669,19 +669,19 @@ the same object as is returned from the Qt.include() call.
// Qt.include() is implemented in qv4include.cpp
QQmlEnginePrivate::QQmlEnginePrivate(QQmlEngine *e)
-: propertyCapture(0), rootContext(0),
+: propertyCapture(nullptr), rootContext(nullptr),
#if QT_CONFIG(qml_debug)
- profiler(0),
+ profiler(nullptr),
#endif
outputWarningsToMsgLog(true),
- cleanup(0), erroredBindings(0), inProgressCreations(0),
- workerScriptEngine(0),
- activeObjectCreator(0),
+ cleanup(nullptr), erroredBindings(nullptr), inProgressCreations(0),
+ workerScriptEngine(nullptr),
+ activeObjectCreator(nullptr),
#if QT_CONFIG(qml_network)
- networkAccessManager(0), networkAccessManagerFactory(0),
+ networkAccessManager(nullptr), networkAccessManagerFactory(nullptr),
#endif
- urlInterceptor(0), scarceResourcesRefCount(0), importDatabase(e), typeLoader(e),
- uniqueId(1), incubatorCount(0), incubationController(0)
+ urlInterceptor(nullptr), scarceResourcesRefCount(0), importDatabase(e), typeLoader(e),
+ uniqueId(1), incubatorCount(0), incubationController(nullptr)
{
}
@@ -694,15 +694,15 @@ QQmlEnginePrivate::~QQmlEnginePrivate()
QQmlCleanup *c = cleanup;
cleanup = c->next;
if (cleanup) cleanup->prev = &cleanup;
- c->next = 0;
- c->prev = 0;
+ c->next = nullptr;
+ c->prev = nullptr;
c->clear();
}
doDeleteInEngineThread();
- if (incubationController) incubationController->d = 0;
- incubationController = 0;
+ if (incubationController) incubationController->d = nullptr;
+ incubationController = nullptr;
QQmlMetaType::freeUnusedTypesAndCaches();
@@ -731,8 +731,8 @@ void QQmlPrivate::qdeclarativeelement_destructor(QObject *o)
d->ownContext->invalidate();
if (d->ownContext->contextObject == o)
d->ownContext->contextObject = nullptr;
- d->ownContext = 0;
- d->context = 0;
+ d->ownContext = nullptr;
+ d->context = nullptr;
}
// Mark this object as in the process of deletion to
@@ -750,10 +750,10 @@ QQmlData::QQmlData()
: ownedByQml1(false), ownMemory(true), indestructible(true), explicitIndestructibleSet(false),
hasTaintedV4Object(false), isQueuedForDeletion(false), rootObjectInCreation(false),
hasInterceptorMetaObject(false), hasVMEMetaObject(false), parentFrozen(false),
- bindingBitsArraySize(InlineBindingArraySize), notifyList(0),
- bindings(0), signalHandlers(0), nextContextObject(0), prevContextObject(0),
+ bindingBitsArraySize(InlineBindingArraySize), notifyList(nullptr),
+ bindings(nullptr), signalHandlers(nullptr), nextContextObject(nullptr), prevContextObject(nullptr),
lineNumber(0), columnNumber(0), jsEngineId(0),
- propertyCache(0), guards(0), extendedData(0)
+ propertyCache(nullptr), guards(nullptr), extendedData(nullptr)
{
memset(bindingBitsValue, 0, sizeof(bindingBitsValue));
init();
@@ -826,7 +826,7 @@ void QQmlData::signalEmitted(QAbstractDeclarativeData *, QObject *object, int in
void **args = (void **) malloc((parameterTypes.count() + 1) *sizeof(void *));
types[0] = 0; // return type
- args[0] = 0; // return value
+ args[0] = nullptr; // return value
for (int ii = 0; ii < parameterTypes.count(); ++ii) {
const QByteArray &typeName = parameterTypes.at(ii);
@@ -847,7 +847,7 @@ void QQmlData::signalEmitted(QAbstractDeclarativeData *, QObject *object, int in
args[ii + 1] = QMetaType::create(types[ii + 1], a[ii + 1]);
}
- QMetaCallEvent *ev = new QMetaCallEvent(m.methodIndex(), 0, 0, object, index,
+ QMetaCallEvent *ev = new QMetaCallEvent(m.methodIndex(), 0, nullptr, object, index,
parameterTypes.count() + 1, types, args);
QQmlThreadNotifierProxyObject *mpo = new QQmlThreadNotifierProxyObject;
@@ -910,8 +910,8 @@ void QQmlData::setQueuedForDeletion(QObject *object)
ddata->context->emitDestruction();
if (ddata->ownContext->contextObject == object)
ddata->ownContext->contextObject = nullptr;
- ddata->ownContext = 0;
- ddata->context = 0;
+ ddata->ownContext = nullptr;
+ ddata->context = nullptr;
}
ddata->isQueuedForDeletion = true;
}
@@ -1062,7 +1062,7 @@ QQmlEngine::~QQmlEngine()
currType.singletonInstanceInfo()->destroy(this);
delete d->rootContext;
- d->rootContext = 0;
+ d->rootContext = nullptr;
}
/*! \fn void QQmlEngine::quit()
@@ -1175,7 +1175,7 @@ void QQmlEnginePrivate::registerFinalizeCallback(QObject *obj, int index)
if (activeObjectCreator) {
activeObjectCreator->finalizeCallbacks()->append(qMakePair(QPointer<QObject>(obj), index));
} else {
- void *args[] = { 0 };
+ void *args[] = { nullptr };
QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, index, args);
}
}
@@ -1392,13 +1392,13 @@ void QQmlEngine::retranslate()
QQmlContext *QQmlEngine::contextForObject(const QObject *object)
{
if(!object)
- return 0;
+ return nullptr;
QQmlData *data = QQmlData::get(object);
if (data && data->outerContext)
return data->outerContext->asQQmlContext();
- return 0;
+ return nullptr;
}
/*!
@@ -1546,7 +1546,7 @@ QQmlEngine *qmlEngine(const QObject *obj)
{
QQmlData *data = QQmlData::get(obj, false);
if (!data || !data->context)
- return 0;
+ return nullptr;
return data->context->engine;
}
@@ -1554,7 +1554,7 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre
{
QQmlData *data = QQmlData::get(object, create);
if (!data)
- return 0; // Attached properties are only on objects created by QML, unless explicitly requested (create==true)
+ return nullptr; // Attached properties are only on objects created by QML, unless explicitly requested (create==true)
QObject *rv = data->hasExtendedData()?data->attachedProperties()->value(id):0;
if (rv || !create)
@@ -1563,7 +1563,7 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre
QQmlEnginePrivate *engine = QQmlEnginePrivate::get(data->context);
QQmlAttachedPropertiesFunc pf = QQmlMetaType::attachedPropertiesFuncById(engine, id);
if (!pf)
- return 0;
+ return nullptr;
rv = pf(const_cast<QObject *>(object));
@@ -1577,12 +1577,12 @@ QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object,
const QMetaObject *attachedMetaObject, bool create)
{
if (*idCache == -1) {
- QQmlEngine *engine = object ? qmlEngine(object) : 0;
- *idCache = QQmlMetaType::attachedPropertiesFuncId(engine ? QQmlEnginePrivate::get(engine) : 0, attachedMetaObject);
+ QQmlEngine *engine = object ? qmlEngine(object) : nullptr;
+ *idCache = QQmlMetaType::attachedPropertiesFuncId(engine ? QQmlEnginePrivate::get(engine) : nullptr, attachedMetaObject);
}
if (*idCache == -1 || !object)
- return 0;
+ return nullptr;
return qmlAttachedPropertiesObjectById(*idCache, object, create);
}
@@ -1642,7 +1642,7 @@ void QQmlData::NotifyList::layout(QQmlNotifierEndpoint *endpoint)
{
// Add a temporary sentinel at beginning of list. This will be overwritten
// when the end point is inserted into the notifies further down.
- endpoint->prev = 0;
+ endpoint->prev = nullptr;
while (endpoint->next) {
Q_ASSERT(reinterpret_cast<QQmlNotifierEndpoint *>(endpoint->next->prev) == endpoint);
@@ -1688,7 +1688,7 @@ void QQmlData::NotifyList::layout()
}
maximumTodoIndex = 0;
- todo = 0;
+ todo = nullptr;
}
void QQmlData::deferData(int objectIndex, QV4::CompiledData::CompilationUnit *compilationUnit, QQmlContextData *context)
@@ -1732,8 +1732,8 @@ void QQmlData::addNotify(int index, QQmlNotifierEndpoint *endpoint)
notifyList->connectionMask = 0;
notifyList->maximumTodoIndex = 0;
notifyList->notifiesSize = 0;
- notifyList->todo = 0;
- notifyList->notifies = 0;
+ notifyList->todo = nullptr;
+ notifyList->notifies = nullptr;
}
Q_ASSERT(!endpoint->isConnected());
@@ -1769,7 +1769,7 @@ void QQmlData::disconnectNotifiers()
}
free(notifyList->notifies);
free(notifyList);
- notifyList = 0;
+ notifyList = nullptr;
}
}
@@ -1831,8 +1831,8 @@ void QQmlData::destroyed(QObject *object)
}
QQmlBoundSignal *next = signalHandler->m_nextSignal;
- signalHandler->m_prevSignal = 0;
- signalHandler->m_nextSignal = 0;
+ signalHandler->m_prevSignal = nullptr;
+ signalHandler->m_nextSignal = nullptr;
delete signalHandler;
signalHandler = next;
}
@@ -1843,11 +1843,11 @@ void QQmlData::destroyed(QObject *object)
if (propertyCache)
propertyCache->release();
- ownContext = 0;
+ ownContext = nullptr;
while (guards) {
QQmlGuard<QObject> *guard = static_cast<QQmlGuard<QObject> *>(guards);
- *guard = (QObject *)0;
+ *guard = (QObject *)nullptr;
guard->objectDestroyed(object);
}
@@ -1985,23 +1985,23 @@ static void dumpwarning(const QQmlError &error)
switch (error.messageType()) {
case QtDebugMsg:
QMessageLogger(error.url().toString().toLatin1().constData(),
- error.line(), 0).debug().nospace()
+ error.line(), nullptr).debug().nospace()
<< qPrintable(error.toString());
break;
case QtInfoMsg:
QMessageLogger(error.url().toString().toLatin1().constData(),
- error.line(), 0).info().nospace()
+ error.line(), nullptr).info().nospace()
<< qPrintable(error.toString());
break;
case QtWarningMsg:
case QtFatalMsg: // fatal does not support streaming, and furthermore, is actually fatal. Probably not desirable for QML.
QMessageLogger(error.url().toString().toLatin1().constData(),
- error.line(), 0).warning().nospace()
+ error.line(), nullptr).warning().nospace()
<< qPrintable(error.toString());
break;
case QtCriticalMsg:
QMessageLogger(error.url().toString().toLatin1().constData(),
- error.line(), 0).critical().nospace()
+ error.line(), nullptr).critical().nospace()
<< qPrintable(error.toString());
break;
}
@@ -2338,7 +2338,7 @@ QQmlPropertyCache *QQmlEnginePrivate::propertyCacheForType(int t)
} else {
QQmlType type = QQmlMetaType::qmlType(t);
locker.unlock();
- return type.isValid() ? cache(type.metaObject()) : 0;
+ return type.isValid() ? cache(type.metaObject()) : nullptr;
}
}
@@ -2353,9 +2353,9 @@ QQmlPropertyCache *QQmlEnginePrivate::rawPropertyCacheForType(int t, int minorVe
locker.unlock();
if (minorVersion >= 0)
- return type.isValid() ? cache(type, minorVersion) : 0;
+ return type.isValid() ? cache(type, minorVersion) : nullptr;
else
- return type.isValid() ? cache(type.baseMetaObject()) : 0;
+ return type.isValid() ? cache(type.baseMetaObject()) : nullptr;
}
}
diff --git a/src/qml/qml/qqmlengine_p.h b/src/qml/qml/qqmlengine_p.h
index f12409ed9a..2dfbd42e57 100644
--- a/src/qml/qml/qqmlengine_p.h
+++ b/src/qml/qml/qqmlengine_p.h
@@ -213,7 +213,7 @@ public:
// These methods may be called from the loader thread
bool isQObject(int);
- QObject *toQObject(const QVariant &, bool *ok = 0) const;
+ QObject *toQObject(const QVariant &, bool *ok = nullptr) const;
QQmlMetaType::TypeCategory typeCategory(int) const;
bool isList(int) const;
int listType(int) const;
@@ -265,7 +265,7 @@ private:
static bool s_designerMode;
// These members is protected by the full QQmlEnginePrivate::mutex mutex
- struct Deletable { Deletable():next(0) {} virtual ~Deletable() {} Deletable *next; };
+ struct Deletable { Deletable():next(nullptr) {} virtual ~Deletable() {} Deletable *next; };
QFieldList<Deletable, &Deletable::next> toDeleteInEngineThread;
void doDeleteInEngineThread();
@@ -411,12 +411,12 @@ const QQmlEnginePrivate *QQmlEnginePrivate::get(const QQmlEngine *e)
QQmlEnginePrivate *QQmlEnginePrivate::get(QQmlContext *c)
{
- return (c && c->engine()) ? QQmlEnginePrivate::get(c->engine()) : 0;
+ return (c && c->engine()) ? QQmlEnginePrivate::get(c->engine()) : nullptr;
}
QQmlEnginePrivate *QQmlEnginePrivate::get(QQmlContextData *c)
{
- return (c && c->engine) ? QQmlEnginePrivate::get(c->engine) : 0;
+ return (c && c->engine) ? QQmlEnginePrivate::get(c->engine) : nullptr;
}
QQmlEngine *QQmlEnginePrivate::get(QQmlEnginePrivate *p)
@@ -430,7 +430,7 @@ QQmlEnginePrivate *QQmlEnginePrivate::get(QV4::ExecutionEngine *e)
{
QQmlEngine *qmlEngine = e->qmlEngine();
if (!qmlEngine)
- return 0;
+ return nullptr;
return get(qmlEngine);
}
diff --git a/src/qml/qml/qqmlerror.cpp b/src/qml/qml/qqmlerror.cpp
index 1b264b025c..fc5b186b29 100644
--- a/src/qml/qml/qqmlerror.cpp
+++ b/src/qml/qml/qqmlerror.cpp
@@ -99,7 +99,7 @@ QQmlErrorPrivate::QQmlErrorPrivate()
Creates an empty error object.
*/
QQmlError::QQmlError()
-: d(0)
+: d(nullptr)
{
}
@@ -107,7 +107,7 @@ QQmlError::QQmlError()
Creates a copy of \a other.
*/
QQmlError::QQmlError(const QQmlError &other)
-: d(0)
+: d(nullptr)
{
*this = other;
}
@@ -119,7 +119,7 @@ QQmlError &QQmlError::operator=(const QQmlError &other)
{
if (!other.d) {
delete d;
- d = 0;
+ d = nullptr;
} else {
if (!d)
d = new QQmlErrorPrivate;
@@ -138,7 +138,7 @@ QQmlError &QQmlError::operator=(const QQmlError &other)
*/
QQmlError::~QQmlError()
{
- delete d; d = 0;
+ delete d; d = nullptr;
}
/*!
@@ -146,7 +146,7 @@ QQmlError::~QQmlError()
*/
bool QQmlError::isValid() const
{
- return d != 0;
+ return d != nullptr;
}
/*!
@@ -239,7 +239,7 @@ QObject *QQmlError::object() const
{
if (d)
return d->object;
- return 0;
+ return nullptr;
}
/*!
diff --git a/src/qml/qml/qqmlexpression.cpp b/src/qml/qml/qqmlexpression.cpp
index 3ba0afc7bd..59cc9bb09f 100644
--- a/src/qml/qml/qqmlexpression.cpp
+++ b/src/qml/qml/qqmlexpression.cpp
@@ -121,7 +121,7 @@ void QQmlExpressionPrivate::init(QQmlContextData *ctxt, QV4::Function *runtimeFu
null expression object and its value will always be an invalid QVariant.
*/
QQmlExpression::QQmlExpression()
-: QObject(*new QQmlExpressionPrivate, 0)
+: QObject(*new QQmlExpressionPrivate, nullptr)
{
}
@@ -147,7 +147,7 @@ QQmlExpression::QQmlExpression(const QQmlScriptString &script, QQmlContext *ctxt
QQmlContextData *evalCtxtData = QQmlContextData::get(ctxt ? ctxt : scriptPrivate->context);
QObject *scopeObject = scope ? scope : scriptPrivate->scope;
- QV4::Function *runtimeFunction = 0;
+ QV4::Function *runtimeFunction = nullptr;
if (scriptPrivate->context) {
QQmlContextData *ctxtdata = QQmlContextData::get(scriptPrivate->context);
@@ -191,7 +191,7 @@ QQmlExpression::QQmlExpression(QQmlContext *ctxt,
*/
QQmlExpression::QQmlExpression(QQmlContextData *ctxt, QObject *scope,
const QString &expression)
-: QObject(*new QQmlExpressionPrivate, 0)
+: QObject(*new QQmlExpressionPrivate, nullptr)
{
Q_D(QQmlExpression);
d->init(ctxt, expression, scope);
@@ -211,7 +211,7 @@ QQmlExpression::~QQmlExpression()
QQmlEngine *QQmlExpression::engine() const
{
Q_D(const QQmlExpression);
- return d->context()?d->context()->engine:0;
+ return d->context()?d->context()->engine:nullptr;
}
/*!
@@ -222,7 +222,7 @@ QQmlContext *QQmlExpression::context() const
{
Q_D(const QQmlExpression);
QQmlContextData *data = d->context();
- return data?data->asQQmlContext():0;
+ return data?data->asQQmlContext():nullptr;
}
/*!
diff --git a/src/qml/qml/qqmlexpression_p.h b/src/qml/qml/qqmlexpression_p.h
index a94ca0fc2d..55059575e1 100644
--- a/src/qml/qml/qqmlexpression_p.h
+++ b/src/qml/qml/qqmlexpression_p.h
@@ -73,9 +73,9 @@ public:
void init(QQmlContextData *, const QString &, QObject *);
void init(QQmlContextData *, QV4::Function *runtimeFunction, QObject *);
- QVariant value(bool *isUndefined = 0);
+ QVariant value(bool *isUndefined = nullptr);
- QV4::ReturnedValue v4value(bool *isUndefined = 0);
+ QV4::ReturnedValue v4value(bool *isUndefined = nullptr);
static inline QQmlExpressionPrivate *get(QQmlExpression *expr);
static inline QQmlExpression *get(QQmlExpressionPrivate *expr);
diff --git a/src/qml/qml/qqmlfile.cpp b/src/qml/qml/qqmlfile.cpp
index 93c3e8e00c..99031e1e74 100644
--- a/src/qml/qml/qqmlfile.cpp
+++ b/src/qml/qml/qqmlfile.cpp
@@ -131,7 +131,7 @@ int QQmlFileNetworkReply::replyFinishedIndex = -1;
int QQmlFileNetworkReply::replyDownloadProgressIndex = -1;
QQmlFileNetworkReply::QQmlFileNetworkReply(QQmlEngine *e, QQmlFilePrivate *p, const QUrl &url)
-: m_engine(e), m_p(p), m_redirectCount(0), m_reply(0)
+: m_engine(e), m_p(p), m_redirectCount(0), m_reply(nullptr)
{
if (finishedIndex == -1) {
finishedIndex = QMetaMethod::fromSignal(&QQmlFileNetworkReply::finished).methodIndex();
@@ -194,9 +194,9 @@ void QQmlFileNetworkReply::networkFinished()
}
m_reply->deleteLater();
- m_reply = 0;
+ m_reply = nullptr;
- m_p->reply = 0;
+ m_p->reply = nullptr;
emit finished();
delete this;
}
@@ -210,7 +210,7 @@ void QQmlFileNetworkReply::networkDownloadProgress(qint64 a, qint64 b)
QQmlFilePrivate::QQmlFilePrivate()
: error(None)
#if QT_CONFIG(qml_network)
-, reply(0)
+, reply(nullptr)
#endif
{
}
@@ -237,7 +237,7 @@ QQmlFile::~QQmlFile()
delete d->reply;
#endif
delete d;
- d = 0;
+ d = nullptr;
}
bool QQmlFile::isNull() const
diff --git a/src/qml/qml/qqmlfileselector.cpp b/src/qml/qml/qqmlfileselector.cpp
index be6216d3ff..8666144096 100644
--- a/src/qml/qml/qqmlfileselector.cpp
+++ b/src/qml/qml/qqmlfileselector.cpp
@@ -115,8 +115,8 @@ QQmlFileSelector::~QQmlFileSelector()
{
Q_D(QQmlFileSelector);
if (d->engine && QQmlFileSelector::get(d->engine) == this) {
- d->engine->setUrlInterceptor(0);
- d->engine = 0;
+ d->engine->setUrlInterceptor(nullptr);
+ d->engine = nullptr;
}
interceptorInstances()->remove(d->myInstance.data());
}
@@ -200,7 +200,7 @@ QQmlFileSelector* QQmlFileSelector::get(QQmlEngine* engine)
QQmlAbstractUrlInterceptor* current = engine->urlInterceptor();
if (current && interceptorInstances()->contains(current))
return interceptorInstances()->value(current);
- return 0;
+ return nullptr;
}
/*!
diff --git a/src/qml/qml/qqmlglobal.cpp b/src/qml/qml/qqmlglobal.cpp
index 6418812bae..1d60c518c4 100644
--- a/src/qml/qml/qqmlglobal.cpp
+++ b/src/qml/qml/qqmlglobal.cpp
@@ -48,7 +48,7 @@
QT_BEGIN_NAMESPACE
QQmlValueTypeProvider::QQmlValueTypeProvider()
- : next(0)
+ : next(nullptr)
{
}
@@ -65,7 +65,7 @@ const QMetaObject *QQmlValueTypeProvider::metaObjectForMetaType(int type)
return mo;
} while ((p = p->next));
- return 0;
+ return nullptr;
}
bool QQmlValueTypeProvider::initValueType(int type, QVariant& dst)
@@ -218,7 +218,7 @@ bool QQmlValueTypeProvider::writeValueType(int type, const void *src, QVariant&
return false;
}
-const QMetaObject *QQmlValueTypeProvider::getMetaObjectForMetaType(int) { return 0; }
+const QMetaObject *QQmlValueTypeProvider::getMetaObjectForMetaType(int) { return nullptr; }
bool QQmlValueTypeProvider::init(int, QVariant&) { return false; }
bool QQmlValueTypeProvider::create(int, int, const void *[], QVariant *) { return false; }
bool QQmlValueTypeProvider::createFromString(int, const QString &, void *, size_t) { return false; }
@@ -232,11 +232,11 @@ bool QQmlValueTypeProvider::read(const QVariant&, void *, int) { return false; }
bool QQmlValueTypeProvider::write(int, const void *, QVariant&) { return false; }
Q_GLOBAL_STATIC(QQmlValueTypeProvider, nullValueTypeProvider)
-static QQmlValueTypeProvider *valueTypeProvider = 0;
+static QQmlValueTypeProvider *valueTypeProvider = nullptr;
static QQmlValueTypeProvider **getValueTypeProvider(void)
{
- if (valueTypeProvider == 0) {
+ if (valueTypeProvider == nullptr) {
valueTypeProvider = nullValueTypeProvider;
}
@@ -294,7 +294,7 @@ QVariant QQmlColorProvider::lighter(const QVariant &, qreal) { return QVariant()
QVariant QQmlColorProvider::darker(const QVariant &, qreal) { return QVariant(); }
QVariant QQmlColorProvider::tint(const QVariant &, const QVariant &) { return QVariant(); }
-static QQmlColorProvider *colorProvider = 0;
+static QQmlColorProvider *colorProvider = nullptr;
Q_QML_PRIVATE_EXPORT QQmlColorProvider *QQml_setColorProvider(QQmlColorProvider *newProvider)
{
@@ -305,7 +305,7 @@ Q_QML_PRIVATE_EXPORT QQmlColorProvider *QQml_setColorProvider(QQmlColorProvider
static QQmlColorProvider **getColorProvider(void)
{
- if (colorProvider == 0) {
+ if (colorProvider == nullptr) {
qWarning() << "Warning: QQml_colorProvider: no color provider has been set!";
static QQmlColorProvider nullColorProvider;
colorProvider = &nullColorProvider;
@@ -345,7 +345,7 @@ QObject *QQmlGuiProvider::styleHints()
QString QQmlGuiProvider::pluginName() const { return QString(); }
-static QQmlGuiProvider *guiProvider = 0;
+static QQmlGuiProvider *guiProvider = nullptr;
Q_QML_PRIVATE_EXPORT QQmlGuiProvider *QQml_setGuiProvider(QQmlGuiProvider *newProvider)
{
@@ -356,7 +356,7 @@ Q_QML_PRIVATE_EXPORT QQmlGuiProvider *QQml_setGuiProvider(QQmlGuiProvider *newPr
static QQmlGuiProvider **getGuiProvider(void)
{
- if (guiProvider == 0) {
+ if (guiProvider == nullptr) {
static QQmlGuiProvider nullGuiProvider; //Still provides an application with no GUI support
guiProvider = &nullGuiProvider;
}
diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h
index 5c46da0ea4..53f5dbed02 100644
--- a/src/qml/qml/qqmlglobal_p.h
+++ b/src/qml/qml/qqmlglobal_p.h
@@ -323,7 +323,7 @@ class Q_QML_PRIVATE_EXPORT QQmlApplication : public QObject
Q_PROPERTY(QString organization READ organization WRITE setOrganization NOTIFY organizationChanged)
Q_PROPERTY(QString domain READ domain WRITE setDomain NOTIFY domainChanged)
public:
- QQmlApplication(QObject* parent=0);
+ QQmlApplication(QObject* parent=nullptr);
QStringList args();
@@ -347,7 +347,7 @@ Q_SIGNALS:
void domainChanged();
protected:
- QQmlApplication(QQmlApplicationPrivate &dd, QObject* parent=0);
+ QQmlApplication(QQmlApplicationPrivate &dd, QObject* parent=nullptr);
private:
Q_DISABLE_COPY(QQmlApplication)
diff --git a/src/qml/qml/qqmlguard_p.h b/src/qml/qml/qqmlguard_p.h
index 52526276be..87c3677d29 100644
--- a/src/qml/qml/qqmlguard_p.h
+++ b/src/qml/qml/qqmlguard_p.h
@@ -113,18 +113,18 @@ Q_DECLARE_METATYPE(QQmlGuard<QObject>)
QT_BEGIN_NAMESPACE
QQmlGuardImpl::QQmlGuardImpl()
-: o(0), next(0), prev(0)
+: o(nullptr), next(nullptr), prev(nullptr)
{
}
QQmlGuardImpl::QQmlGuardImpl(QObject *g)
-: o(g), next(0), prev(0)
+: o(g), next(nullptr), prev(nullptr)
{
if (o) addGuard();
}
QQmlGuardImpl::QQmlGuardImpl(const QQmlGuardImpl &g)
-: o(g.o), next(0), prev(0)
+: o(g.o), next(nullptr), prev(nullptr)
{
if (o) addGuard();
}
@@ -132,7 +132,7 @@ QQmlGuardImpl::QQmlGuardImpl(const QQmlGuardImpl &g)
QQmlGuardImpl::~QQmlGuardImpl()
{
if (prev) remGuard();
- o = 0;
+ o = nullptr;
}
void QQmlGuardImpl::addGuard()
@@ -155,8 +155,8 @@ void QQmlGuardImpl::remGuard()
if (next) next->prev = prev;
*prev = next;
- next = 0;
- prev = 0;
+ next = nullptr;
+ prev = nullptr;
}
template<class T>
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index a9113603b8..8e6cbcbd7e 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -728,7 +728,7 @@ bool QQmlImports::resolveType(QQmlImportNamespace *ns, const QHashedStringRef &t
QQmlType *type_return, int *vmaj, int *vmin,
QQmlType::RegistrationType registrationType) const
{
- return ns->resolveType(d->typeLoader, type, vmaj, vmin, type_return, 0, 0, registrationType);
+ return ns->resolveType(d->typeLoader, type, vmaj, vmin, type_return, nullptr, nullptr, registrationType);
}
bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, const QHashedStringRef& type,
@@ -803,7 +803,7 @@ bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, const QHashedSt
int major = vmajor ? *vmajor : -1;
int minor = vminor ? *vminor : -1;
QQmlType returnType = fetchOrCreateTypeForUrl(componentUrl, type, isCompositeSingleton,
- 0, major, minor);
+ nullptr, major, minor);
if (type_return)
*type_return = returnType;
return returnType.isValid();
@@ -831,7 +831,7 @@ bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, const QHashedSt
*typeRecursionDetected = true;
} else {
QQmlType returnType = fetchOrCreateTypeForUrl(
- qmlUrl, type, registrationType == QQmlType::CompositeSingletonType, 0);
+ qmlUrl, type, registrationType == QQmlType::CompositeSingletonType, nullptr);
if (type_return)
*type_return = returnType;
return returnType.isValid();
@@ -847,7 +847,7 @@ bool QQmlImportsPrivate::resolveType(const QHashedStringRef& type, int *vmajor,
QQmlType::RegistrationType registrationType,
QQmlImport::RecursionRestriction recursionRestriction)
{
- QQmlImportNamespace *s = 0;
+ QQmlImportNamespace *s = nullptr;
int dot = type.indexOf(Dot);
if (dot >= 0) {
QHashedStringRef namespaceName(type.constData(), dot);
@@ -978,7 +978,7 @@ QQmlImportNamespace *QQmlImportsPrivate::findQualifiedNamespace(const QHashedStr
if (prefix == ns->prefix)
return ns;
}
- return 0;
+ return nullptr;
}
/*
@@ -1257,7 +1257,7 @@ bool QQmlImportsPrivate::locateQmldir(const QString &uri, int vmaj, int vmin, QQ
// Check cache first
- QQmlImportDatabase::QmldirCache *cacheHead = 0;
+ QQmlImportDatabase::QmldirCache *cacheHead = nullptr;
{
QQmlImportDatabase::QmldirCache **cachePtr = database->qmldirCache.value(uri);
if (cachePtr) {
@@ -1389,7 +1389,7 @@ bool QQmlImportsPrivate::validateQmldirVersion(const QQmlTypeLoaderQmldirContent
QQmlImportNamespace *QQmlImportsPrivate::importNamespace(const QString &prefix) const
{
- QQmlImportNamespace *nameSpace = 0;
+ QQmlImportNamespace *nameSpace = nullptr;
if (prefix.isEmpty()) {
nameSpace = &unqualifiedset;
@@ -1446,7 +1446,7 @@ bool QQmlImportsPrivate::addLibraryImport(const QString& uri, const QString &pre
Q_ASSERT(inserted);
if (!incomplete) {
- const QQmlTypeLoaderQmldirContent *qmldir = 0;
+ const QQmlTypeLoaderQmldirContent *qmldir = nullptr;
if (!qmldirIdentifier.isEmpty()) {
if (!getQmldirContent(qmldirIdentifier, uri, &qmldir, errors))
@@ -1565,7 +1565,7 @@ bool QQmlImportsPrivate::addFileImport(const QString& uri, const QString &prefix
Q_ASSERT(inserted);
if (!incomplete && !qmldirIdentifier.isEmpty()) {
- const QQmlTypeLoaderQmldirContent *qmldir = 0;
+ const QQmlTypeLoaderQmldirContent *qmldir = nullptr;
if (!getQmldirContent(qmldirIdentifier, importUri, &qmldir, errors))
return false;
@@ -1589,7 +1589,7 @@ bool QQmlImportsPrivate::updateQmldirContent(const QString &uri, const QString &
Q_ASSERT(nameSpace);
if (QQmlImportInstance *import = nameSpace->findImport(uri)) {
- const QQmlTypeLoaderQmldirContent *qmldir = 0;
+ const QQmlTypeLoaderQmldirContent *qmldir = nullptr;
if (!getQmldirContent(qmldirIdentifier, uri, &qmldir, errors))
return false;
@@ -2095,7 +2095,7 @@ bool QQmlImportDatabase::importStaticPlugin(QObject *instance, const QString &ba
} else {
RegisteredPlugin plugin;
plugin.uri = uri;
- plugin.loader = 0;
+ plugin.loader = nullptr;
plugins->insert(uniquePluginID, plugin);
if (!registerPluginTypes(instance, basePath, uri, typeNamespace, vmaj, errors))
@@ -2156,7 +2156,7 @@ bool QQmlImportDatabase::importDynamicPlugin(const QString &filePath, const QStr
return false;
}
- QPluginLoader* loader = 0;
+ QPluginLoader* loader = nullptr;
if (!typesRegistered) {
loader = new QPluginLoader(absoluteFilePath);
diff --git a/src/qml/qml/qqmlimport_p.h b/src/qml/qml/qqmlimport_p.h
index 6298dd9c22..b70bb5253c 100644
--- a/src/qml/qml/qqmlimport_p.h
+++ b/src/qml/qml/qqmlimport_p.h
@@ -92,7 +92,7 @@ struct QQmlImportInstance
bool resolveType(QQmlTypeLoader *typeLoader, const QHashedStringRef &type,
int *vmajor, int *vminor, QQmlType* type_return,
- QString *base = 0, bool *typeRecursionDetected = 0,
+ QString *base = nullptr, bool *typeRecursionDetected = nullptr,
QQmlType::RegistrationType = QQmlType::AnyRegistrationType,
QQmlImport::RecursionRestriction recursionRestriction = QQmlImport::PreventRecursion) const;
};
@@ -100,7 +100,7 @@ struct QQmlImportInstance
class QQmlImportNamespace
{
public:
- QQmlImportNamespace() : nextNamespace(0) {}
+ QQmlImportNamespace() : nextNamespace(nullptr) {}
~QQmlImportNamespace() { qDeleteAll(imports); }
QList<QQmlImportInstance *> imports;
@@ -109,7 +109,7 @@ public:
bool resolveType(QQmlTypeLoader *typeLoader, const QHashedStringRef& type,
int *vmajor, int *vminor, QQmlType* type_return,
- QString *base = 0, QList<QQmlError> *errors = 0,
+ QString *base = nullptr, QList<QQmlError> *errors = nullptr,
QQmlType::RegistrationType registrationType = QQmlType::AnyRegistrationType,
QQmlImport::RecursionRestriction recursionRestriction = QQmlImport::PreventRecursion);
@@ -137,7 +137,7 @@ public:
QQmlType *type_return,
int *version_major, int *version_minor,
QQmlImportNamespace **ns_return,
- QList<QQmlError> *errors = 0,
+ QList<QQmlError> *errors = nullptr,
QQmlType::RegistrationType registrationType = QQmlType::AnyRegistrationType,
QQmlImport::RecursionRestriction recursionRestriction
= QQmlImport::PreventRecursion) const;
diff --git a/src/qml/qml/qqmlincubator.cpp b/src/qml/qml/qqmlincubator.cpp
index 9855c27375..4546a4423f 100644
--- a/src/qml/qml/qqmlincubator.cpp
+++ b/src/qml/qml/qqmlincubator.cpp
@@ -110,7 +110,7 @@ void QQmlEngine::setIncubationController(QQmlIncubationController *controller)
{
Q_D(QQmlEngine);
if (d->incubationController)
- d->incubationController->d = 0;
+ d->incubationController->d = nullptr;
d->incubationController = controller;
if (controller) controller->d = d;
}
@@ -128,7 +128,7 @@ QQmlIncubationController *QQmlEngine::incubationController() const
QQmlIncubatorPrivate::QQmlIncubatorPrivate(QQmlIncubator *q, QQmlIncubator::IncubationMode m)
: q(q), status(QQmlIncubator::Null), mode(m), isAsynchronous(false), progress(Execute),
- result(0), enginePriv(0), waitingOnMe(0)
+ result(nullptr), enginePriv(nullptr), waitingOnMe(nullptr)
{
}
@@ -147,16 +147,16 @@ void QQmlIncubatorPrivate::clear()
if (controller)
controller->incubatingObjectCountChanged(enginePriv->incubatorCount);
}
- enginePriv = 0;
+ enginePriv = nullptr;
if (!rootContext.isNull()) {
- rootContext->incubator = 0;
- rootContext = 0;
+ rootContext->incubator = nullptr;
+ rootContext = nullptr;
}
if (nextWaitingFor.isInList()) {
Q_ASSERT(waitingOnMe);
nextWaitingFor.remove();
- waitingOnMe = 0;
+ waitingOnMe = nullptr;
}
// if we're waiting on any incubators then they should be cleared too.
@@ -171,7 +171,7 @@ void QQmlIncubatorPrivate::clear()
vmeGuard.clear();
if (creator && guardOk)
creator->clear();
- creator.reset(0);
+ creator.reset(nullptr);
}
/*!
@@ -218,15 +218,15 @@ than a static amount like 5 milliseconds - while not disturbing the application.
Create a new incubation controller.
*/
QQmlIncubationController::QQmlIncubationController()
-: d(0)
+: d(nullptr)
{
}
/*! \internal */
QQmlIncubationController::~QQmlIncubationController()
{
- if (d) QQmlEnginePrivate::get(d)->setIncubationController(0);
- d = 0;
+ if (d) QQmlEnginePrivate::get(d)->setIncubationController(nullptr);
+ d = nullptr;
}
/*!
@@ -294,8 +294,8 @@ void QQmlIncubatorPrivate::incubate(QQmlInstantiationInterrupt &i)
if (progress == QQmlIncubatorPrivate::Execute) {
enginePriv->referenceScarceResources();
- QObject *tresult = 0;
- tresult = creator->create(subComponentToCreate, /*parent*/0, &i);
+ QObject *tresult = nullptr;
+ tresult = creator->create(subComponentToCreate, /*parent*/nullptr, &i);
if (!tresult)
errors = creator->errors;
enginePriv->dereferenceScarceResources();
@@ -304,7 +304,7 @@ void QQmlIncubatorPrivate::incubate(QQmlInstantiationInterrupt &i)
return;
result = tresult;
- if (errors.isEmpty() && result == 0)
+ if (errors.isEmpty() && result == nullptr)
goto finishIncubate;
if (result) {
@@ -340,7 +340,7 @@ void QQmlIncubatorPrivate::incubate(QQmlInstantiationInterrupt &i)
if (watcher.hasRecursed())
return;
- QQmlContextData *ctxt = 0;
+ QQmlContextData *ctxt = nullptr;
ctxt = creator->finalize(i);
if (ctxt) {
rootContext = ctxt;
@@ -506,12 +506,12 @@ QQmlIncubator::QQmlIncubator(IncubationMode mode)
/*! \internal */
QQmlIncubator::~QQmlIncubator()
{
- d->q = 0;
+ d->q = nullptr;
if (!d->ref.deref()) {
delete d;
}
- d = 0;
+ d = nullptr;
}
/*!
@@ -557,18 +557,18 @@ void QQmlIncubator::clear()
if (s == Loading) {
Q_ASSERT(d->compilationUnit);
if (d->result) d->result->deleteLater();
- d->result = 0;
+ d->result = nullptr;
}
d->clear();
Q_ASSERT(d->compilationUnit.isNull());
- Q_ASSERT(d->waitingOnMe.data() == 0);
+ Q_ASSERT(d->waitingOnMe.data() == nullptr);
Q_ASSERT(d->waitingFor.isEmpty());
d->errors.clear();
d->progress = QQmlIncubatorPrivate::Execute;
- d->result = 0;
+ d->result = nullptr;
if (s == Loading) {
Q_ASSERT(enginePriv);
@@ -657,7 +657,7 @@ Return the incubated object if the status is Ready, otherwise 0.
QObject *QQmlIncubator::object() const
{
if (status() != Ready)
- return 0;
+ return nullptr;
else
return d->result;
}
diff --git a/src/qml/qml/qqmlinfo.cpp b/src/qml/qml/qqmlinfo.cpp
index dae15e2eca..c8f5ba506f 100644
--- a/src/qml/qml/qqmlinfo.cpp
+++ b/src/qml/qml/qqmlinfo.cpp
@@ -182,7 +182,7 @@ QQmlInfo::~QQmlInfo()
if (0 == --d->ref) {
QList<QQmlError> errors = d->errors;
- QQmlEngine *engine = 0;
+ QQmlEngine *engine = nullptr;
if (!d->buffer.isEmpty()) {
QQmlError error;
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index cd35ab93c6..74148e3ca4 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -93,12 +93,12 @@ void QQmlDelayedError::catchJavaScriptException(QV4::ExecutionEngine *engine)
QQmlJavaScriptExpression::QQmlJavaScriptExpression()
- : m_error(0),
- m_context(0),
- m_prevExpression(0),
- m_nextExpression(0),
- m_v4Function(0),
- m_sourceLocation(0)
+ : m_error(nullptr),
+ m_context(nullptr),
+ m_prevExpression(nullptr),
+ m_nextExpression(nullptr),
+ m_v4Function(nullptr),
+ m_sourceLocation(nullptr)
{
}
@@ -114,7 +114,7 @@ QQmlJavaScriptExpression::~QQmlJavaScriptExpression()
clearPermanentGuards();
clearError();
if (m_scopeObject.isT2()) // notify DeleteWatcher of our deletion.
- m_scopeObject.asT2()->_s = 0;
+ m_scopeObject.asT2()->_s = nullptr;
delete m_sourceLocation;
}
@@ -157,8 +157,8 @@ void QQmlJavaScriptExpression::setContext(QQmlContextData *context)
*m_prevExpression = m_nextExpression;
if (m_nextExpression)
m_nextExpression->m_prevExpression = m_prevExpression;
- m_prevExpression = 0;
- m_nextExpression = 0;
+ m_prevExpression = nullptr;
+ m_nextExpression = nullptr;
}
m_context = context;
@@ -211,7 +211,7 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QV4::CallData *callData, b
QQmlPropertyCapture capture(m_context->engine, this, &watcher);
QQmlPropertyCapture *lastPropertyCapture = ep->propertyCapture;
- ep->propertyCapture = notifyOnValueChanged() ? &capture : 0;
+ ep->propertyCapture = notifyOnValueChanged() ? &capture : nullptr;
if (notifyOnValueChanged())
@@ -253,7 +253,7 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QV4::CallData *callData, b
for (int ii = 0; ii < capture.errorString->count(); ++ii)
qWarning("%s", qPrintable(capture.errorString->at(ii)));
delete capture.errorString;
- capture.errorString = 0;
+ capture.errorString = nullptr;
}
while (QQmlJavaScriptExpressionGuard *g = capture.guards.takeFirst())
@@ -274,7 +274,7 @@ void QQmlPropertyCapture::captureProperty(QQmlNotifier *n, Duration duration)
while (!guards.isEmpty() && !guards.first()->isConnected(n))
guards.takeFirst()->Delete();
- QQmlJavaScriptExpressionGuard *g = 0;
+ QQmlJavaScriptExpressionGuard *g = nullptr;
if (!guards.isEmpty()) {
g = guards.takeFirst();
g->cancelNotify();
@@ -323,7 +323,7 @@ void QQmlPropertyCapture::captureProperty(QObject *o, int c, int n, Duration dur
while (!guards.isEmpty() && !guards.first()->isConnected(o, n))
guards.takeFirst()->Delete();
- QQmlJavaScriptExpressionGuard *g = 0;
+ QQmlJavaScriptExpressionGuard *g = nullptr;
if (!guards.isEmpty()) {
g = guards.takeFirst();
g->cancelNotify();
diff --git a/src/qml/qml/qqmljavascriptexpression_p.h b/src/qml/qml/qqmljavascriptexpression_p.h
index 1cb6d7bfd1..a028850074 100644
--- a/src/qml/qml/qqmljavascriptexpression_p.h
+++ b/src/qml/qml/qqmljavascriptexpression_p.h
@@ -62,7 +62,7 @@ struct QQmlSourceLocation;
class QQmlDelayedError
{
public:
- inline QQmlDelayedError() : nextError(0), prevError(0) {}
+ inline QQmlDelayedError() : nextError(nullptr), prevError(nullptr) {}
inline ~QQmlDelayedError() { removeError(); }
bool addError(QQmlEnginePrivate *);
@@ -71,8 +71,8 @@ public:
if (!prevError) return;
if (nextError) nextError->prevError = prevError;
*prevError = nextError;
- nextError = 0;
- prevError = 0;
+ nextError = nullptr;
+ prevError = nullptr;
}
inline bool isValid() const { return m_error.isValid(); }
@@ -117,7 +117,7 @@ public:
QQmlSourceLocation sourceLocation() const;
void setSourceLocation(const QQmlSourceLocation &location);
- bool isValid() const { return context() != 0; }
+ bool isValid() const { return context() != nullptr; }
QQmlContextData *context() const { return m_context; }
void setContext(QQmlContextData *context);
@@ -193,11 +193,11 @@ class QQmlPropertyCapture
{
public:
QQmlPropertyCapture(QQmlEngine *engine, QQmlJavaScriptExpression *e, QQmlJavaScriptExpression::DeleteWatcher *w)
- : engine(engine), expression(e), watcher(w), errorString(0) { }
+ : engine(engine), expression(e), watcher(w), errorString(nullptr) { }
~QQmlPropertyCapture() {
Q_ASSERT(guards.isEmpty());
- Q_ASSERT(errorString == 0);
+ Q_ASSERT(errorString == nullptr);
}
enum Duration {
@@ -217,7 +217,7 @@ public:
};
QQmlJavaScriptExpression::DeleteWatcher::DeleteWatcher(QQmlJavaScriptExpression *e)
-: _c(0), _w(0), _s(e)
+: _c(nullptr), _w(nullptr), _s(e)
{
if (e->m_scopeObject.isT1()) {
_w = &_s;
@@ -231,14 +231,14 @@ QQmlJavaScriptExpression::DeleteWatcher::DeleteWatcher(QQmlJavaScriptExpression
QQmlJavaScriptExpression::DeleteWatcher::~DeleteWatcher()
{
- Q_ASSERT(*_w == 0 || (*_w == _s && _s->m_scopeObject.isT2()));
+ Q_ASSERT(*_w == nullptr || (*_w == _s && _s->m_scopeObject.isT2()));
if (*_w && _s->m_scopeObject.asT2() == this)
_s->m_scopeObject = _c;
}
bool QQmlJavaScriptExpression::DeleteWatcher::wasDeleted() const
{
- return *_w == 0;
+ return *_w == nullptr;
}
bool QQmlJavaScriptExpression::notifyOnValueChanged() const
@@ -272,12 +272,12 @@ inline void QQmlJavaScriptExpression::clearError()
{
if (m_error)
delete m_error;
- m_error = 0;
+ m_error = nullptr;
}
QQmlJavaScriptExpressionGuard::QQmlJavaScriptExpressionGuard(QQmlJavaScriptExpression *e)
: QQmlNotifierEndpoint(QQmlNotifierEndpoint::QQmlJavaScriptExpressionGuard),
- expression(e), next(0)
+ expression(e), next(nullptr)
{
}
diff --git a/src/qml/qml/qqmllist.cpp b/src/qml/qml/qqmllist.cpp
index 9bfdd3da35..ac6e3695fe 100644
--- a/src/qml/qml/qqmllist.cpp
+++ b/src/qml/qml/qqmllist.cpp
@@ -55,7 +55,7 @@ QQmlListReference QQmlListReferencePrivate::init(const QQmlListProperty<QObject>
if (!prop.object) return rv;
- QQmlEnginePrivate *p = engine?QQmlEnginePrivate::get(engine):0;
+ QQmlEnginePrivate *p = engine?QQmlEnginePrivate::get(engine):nullptr;
int listType = p?p->listType(propType):QQmlMetaType::listType(propType);
if (listType == -1) return rv;
@@ -117,7 +117,7 @@ The \l {Qt Quick 1} version of this class is named QDeclarativeListReference.
Constructs an invalid instance.
*/
QQmlListReference::QQmlListReference()
-: d(0)
+: d(nullptr)
{
}
@@ -131,17 +131,17 @@ Passing \a engine is required to access some QML created list properties. If in
is available, pass it.
*/
QQmlListReference::QQmlListReference(QObject *object, const char *property, QQmlEngine *engine)
-: d(0)
+: d(nullptr)
{
if (!object || !property) return;
QQmlPropertyData local;
QQmlPropertyData *data =
- QQmlPropertyCache::property(engine, object, QLatin1String(property), 0, local);
+ QQmlPropertyCache::property(engine, object, QLatin1String(property), nullptr, local);
if (!data || !data->isQList()) return;
- QQmlEnginePrivate *p = engine?QQmlEnginePrivate::get(engine):0;
+ QQmlEnginePrivate *p = engine?QQmlEnginePrivate::get(engine):nullptr;
int listType = p?p->listType(data->propType()):QQmlMetaType::listType(data->propType());
if (listType == -1) return;
@@ -151,7 +151,7 @@ QQmlListReference::QQmlListReference(QObject *object, const char *property, QQml
d->elementType = p ? p->rawMetaObjectForType(listType) : QQmlMetaType::qmlType(listType).baseMetaObject();
d->propertyType = data->propType();
- void *args[] = { &d->property, 0 };
+ void *args[] = { &d->property, nullptr };
QMetaObject::metacall(object, QMetaObject::ReadProperty, data->coreIndex(), args);
}
@@ -191,7 +191,7 @@ Returns the list property's object. Returns 0 if the reference is invalid.
QObject *QQmlListReference::object() const
{
if (isValid()) return d->object;
- else return 0;
+ else return nullptr;
}
/*!
@@ -204,7 +204,7 @@ to a list.
const QMetaObject *QQmlListReference::listElementType() const
{
if (isValid()) return d->elementType.metaObject();
- else return 0;
+ else return nullptr;
}
/*!
@@ -301,7 +301,7 @@ Returns the list element at \a index, or 0 if the operation failed.
*/
QObject *QQmlListReference::at(int index) const
{
- if (!canAt()) return 0;
+ if (!canAt()) return nullptr;
return d->property.at(&d->property, index);
}
diff --git a/src/qml/qml/qqmllistwrapper.cpp b/src/qml/qml/qqmllistwrapper.cpp
index cdeb991e11..3fbe3df2ab 100644
--- a/src/qml/qml/qqmllistwrapper.cpp
+++ b/src/qml/qml/qqmllistwrapper.cpp
@@ -77,7 +77,7 @@ ReturnedValue QmlListWrapper::create(ExecutionEngine *engine, QObject *object, i
Scoped<QmlListWrapper> r(scope, engine->memoryManager->allocObject<QmlListWrapper>());
r->d()->object = object;
r->d()->propertyType = propType;
- void *args[] = { &r->d()->property(), 0 };
+ void *args[] = { &r->d()->property(), nullptr };
QMetaObject::metacall(object, QMetaObject::ReadProperty, propId, args);
return r.asReturnedValue();
}
@@ -151,7 +151,7 @@ bool QmlListWrapper::put(Managed *m, String *name, const Value &value)
void QmlListWrapper::advanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attrs)
{
- name->setM(0);
+ name->setM(nullptr);
*index = UINT_MAX;
Q_ASSERT(m->as<QmlListWrapper>());
QmlListWrapper *w = static_cast<QmlListWrapper *>(m);
diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp
index eafe2792c1..2a5c58b47b 100644
--- a/src/qml/qml/qqmllocale.cpp
+++ b/src/qml/qml/qqmllocale.cpp
@@ -684,23 +684,23 @@ QV4LocaleDataDeletable::QV4LocaleDataDeletable(QV4::ExecutionEngine *engine)
o->defineDefaultProperty(QStringLiteral("monthName"), QQmlLocaleData::method_monthName, 0);
o->defineDefaultProperty(QStringLiteral("currencySymbol"), QQmlLocaleData::method_currencySymbol, 0);
o->defineDefaultProperty(QStringLiteral("dateTimeFormat"), QQmlLocaleData::method_dateTimeFormat, 0);
- o->defineAccessorProperty(QStringLiteral("name"), QQmlLocaleData::method_get_name, 0);
- o->defineAccessorProperty(QStringLiteral("positiveSign"), QQmlLocaleData::method_get_positiveSign, 0);
- o->defineAccessorProperty(QStringLiteral("uiLanguages"), QQmlLocaleData::method_get_uiLanguages, 0);
- o->defineAccessorProperty(QStringLiteral("firstDayOfWeek"), QQmlLocaleData::method_get_firstDayOfWeek, 0);
- o->defineAccessorProperty(QStringLiteral("pmText"), QQmlLocaleData::method_get_pmText, 0);
- o->defineAccessorProperty(QStringLiteral("percent"), QQmlLocaleData::method_get_percent, 0);
- o->defineAccessorProperty(QStringLiteral("textDirection"), QQmlLocaleData::method_get_textDirection, 0);
- o->defineAccessorProperty(QStringLiteral("weekDays"), QQmlLocaleData::method_get_weekDays, 0);
- o->defineAccessorProperty(QStringLiteral("negativeSign"), QQmlLocaleData::method_get_negativeSign, 0);
- o->defineAccessorProperty(QStringLiteral("groupSeparator"), QQmlLocaleData::method_get_groupSeparator, 0);
- o->defineAccessorProperty(QStringLiteral("decimalPoint"), QQmlLocaleData::method_get_decimalPoint, 0);
- o->defineAccessorProperty(QStringLiteral("nativeLanguageName"), QQmlLocaleData::method_get_nativeLanguageName, 0);
- o->defineAccessorProperty(QStringLiteral("nativeCountryName"), QQmlLocaleData::method_get_nativeCountryName, 0);
- o->defineAccessorProperty(QStringLiteral("zeroDigit"), QQmlLocaleData::method_get_zeroDigit, 0);
- o->defineAccessorProperty(QStringLiteral("amText"), QQmlLocaleData::method_get_amText, 0);
- o->defineAccessorProperty(QStringLiteral("measurementSystem"), QQmlLocaleData::method_get_measurementSystem, 0);
- o->defineAccessorProperty(QStringLiteral("exponential"), QQmlLocaleData::method_get_exponential, 0);
+ o->defineAccessorProperty(QStringLiteral("name"), QQmlLocaleData::method_get_name, nullptr);
+ o->defineAccessorProperty(QStringLiteral("positiveSign"), QQmlLocaleData::method_get_positiveSign, nullptr);
+ o->defineAccessorProperty(QStringLiteral("uiLanguages"), QQmlLocaleData::method_get_uiLanguages, nullptr);
+ o->defineAccessorProperty(QStringLiteral("firstDayOfWeek"), QQmlLocaleData::method_get_firstDayOfWeek, nullptr);
+ o->defineAccessorProperty(QStringLiteral("pmText"), QQmlLocaleData::method_get_pmText, nullptr);
+ o->defineAccessorProperty(QStringLiteral("percent"), QQmlLocaleData::method_get_percent, nullptr);
+ o->defineAccessorProperty(QStringLiteral("textDirection"), QQmlLocaleData::method_get_textDirection, nullptr);
+ o->defineAccessorProperty(QStringLiteral("weekDays"), QQmlLocaleData::method_get_weekDays, nullptr);
+ o->defineAccessorProperty(QStringLiteral("negativeSign"), QQmlLocaleData::method_get_negativeSign, nullptr);
+ o->defineAccessorProperty(QStringLiteral("groupSeparator"), QQmlLocaleData::method_get_groupSeparator, nullptr);
+ o->defineAccessorProperty(QStringLiteral("decimalPoint"), QQmlLocaleData::method_get_decimalPoint, nullptr);
+ o->defineAccessorProperty(QStringLiteral("nativeLanguageName"), QQmlLocaleData::method_get_nativeLanguageName, nullptr);
+ o->defineAccessorProperty(QStringLiteral("nativeCountryName"), QQmlLocaleData::method_get_nativeCountryName, nullptr);
+ o->defineAccessorProperty(QStringLiteral("zeroDigit"), QQmlLocaleData::method_get_zeroDigit, nullptr);
+ o->defineAccessorProperty(QStringLiteral("amText"), QQmlLocaleData::method_get_amText, nullptr);
+ o->defineAccessorProperty(QStringLiteral("measurementSystem"), QQmlLocaleData::method_get_measurementSystem, nullptr);
+ o->defineAccessorProperty(QStringLiteral("exponential"), QQmlLocaleData::method_get_exponential, nullptr);
prototype.set(engine, o);
}
diff --git a/src/qml/qml/qqmllocale_p.h b/src/qml/qml/qqmllocale_p.h
index 57666c64f1..8341b1f555 100644
--- a/src/qml/qml/qqmllocale_p.h
+++ b/src/qml/qml/qqmllocale_p.h
@@ -163,7 +163,7 @@ struct QQmlLocaleData : public QV4::Object
const QQmlLocaleData *data = o ? o->as<QQmlLocaleData>() : nullptr;
if (!data) {
scope.engine->throwTypeError();
- return 0;
+ return nullptr;
}
return data->d()->locale;
}
diff --git a/src/qml/qml/qqmlloggingcategory_p.h b/src/qml/qml/qqmlloggingcategory_p.h
index 2b7f2f5b53..544db1fe33 100644
--- a/src/qml/qml/qqmlloggingcategory_p.h
+++ b/src/qml/qml/qqmlloggingcategory_p.h
@@ -67,7 +67,7 @@ class QQmlLoggingCategory : public QObject, public QQmlParserStatus
Q_PROPERTY(QString name READ name WRITE setName)
public:
- QQmlLoggingCategory(QObject *parent = 0);
+ QQmlLoggingCategory(QObject *parent = nullptr);
virtual ~QQmlLoggingCategory();
QString name() const;
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index 76d40bf442..7754f0fddc 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -170,7 +170,7 @@ public:
~QQmlTypePrivate();
void init() const;
- void initEnums(const QQmlPropertyCache *cache = 0) const;
+ void initEnums(const QQmlPropertyCache *cache = nullptr) const;
void insertEnums(const QMetaObject *metaObject) const;
void insertEnumsFromPropertyCache(const QQmlPropertyCache *cache) const;
@@ -315,31 +315,31 @@ QJSValue QQmlType::SingletonInstanceInfo::scriptApi(QQmlEngine *e) const
QHash<const QMetaObject *, int> QQmlTypePrivate::attachedPropertyIds;
QQmlTypePrivate::QQmlTypePrivate(QQmlType::RegistrationType type)
-: refCount(1), regType(type), iid(0), typeId(0), listId(0), revision(0),
- containsRevisionedAttributes(false), baseMetaObject(0),
+: refCount(1), regType(type), iid(nullptr), typeId(0), listId(0), revision(0),
+ containsRevisionedAttributes(false), baseMetaObject(nullptr),
index(-1), isSetup(false), isEnumSetup(false), haveSuperType(false)
{
switch (type) {
case QQmlType::CppType:
extraData.cd = new QQmlCppTypeData;
extraData.cd->allocationSize = 0;
- extraData.cd->newFunc = 0;
+ extraData.cd->newFunc = nullptr;
extraData.cd->parserStatusCast = -1;
- extraData.cd->extFunc = 0;
- extraData.cd->extMetaObject = 0;
- extraData.cd->customParser = 0;
- extraData.cd->attachedPropertiesFunc = 0;
- extraData.cd->attachedPropertiesType = 0;
+ extraData.cd->extFunc = nullptr;
+ extraData.cd->extMetaObject = nullptr;
+ extraData.cd->customParser = nullptr;
+ extraData.cd->attachedPropertiesFunc = nullptr;
+ extraData.cd->attachedPropertiesType = nullptr;
extraData.cd->propertyValueSourceCast = -1;
extraData.cd->propertyValueInterceptorCast = -1;
break;
case QQmlType::SingletonType:
case QQmlType::CompositeSingletonType:
extraData.sd = new QQmlSingletonTypeData;
- extraData.sd->singletonInstanceInfo = 0;
+ extraData.sd->singletonInstanceInfo = nullptr;
break;
case QQmlType::InterfaceType:
- extraData.cd = 0;
+ extraData.cd = nullptr;
break;
case QQmlType::CompositeType:
extraData.fd = new QQmlCompositeTypeData;
@@ -406,7 +406,7 @@ QQmlType::QQmlType(QQmlMetaTypeData *data, const QString &elementName, const QQm
d->extraData.sd->singletonInstanceInfo->qobjectCallback = type.qobjectApi;
d->extraData.sd->singletonInstanceInfo->typeName = QString::fromUtf8(type.typeName);
d->extraData.sd->singletonInstanceInfo->instanceMetaObject
- = (type.qobjectApi && type.version >= 1) ? type.instanceMetaObject : 0;
+ = (type.qobjectApi && type.version >= 1) ? type.instanceMetaObject : nullptr;
}
QQmlType::QQmlType(QQmlMetaTypeData *data, const QString &elementName, const QQmlPrivate::RegisterCompositeSingletonType &type)
@@ -478,7 +478,7 @@ QQmlType::QQmlType(QQmlMetaTypeData *data, const QString &elementName, const QQm
}
QQmlType::QQmlType()
- : d(0)
+ : d(nullptr)
{
}
@@ -586,10 +586,10 @@ QQmlPropertyCache *QQmlType::compositePropertyCache(QQmlEnginePrivate *engine) c
// similar logic to resolveCompositeBaseType
Q_ASSERT(isComposite());
if (!engine)
- return 0;
+ return nullptr;
QQmlRefPointer<QQmlTypeData> td(engine->typeLoader.getType(sourceUrl()), QQmlRefPointer<QQmlTypeData>::Adopt);
if (td.isNull() || !td->isComplete())
- return 0;
+ return nullptr;
QV4::CompiledData::CompilationUnit *compilationUnit = td->compilationUnit();
return compilationUnit->rootPropertyCache();
}
@@ -739,7 +739,7 @@ void QQmlTypePrivate::init() const
// Check for revisioned details
{
- const QMetaObject *mo = 0;
+ const QMetaObject *mo = nullptr;
if (metaObjects.isEmpty())
mo = baseMetaObject;
else
@@ -792,7 +792,7 @@ void QQmlTypePrivate::insertEnums(const QMetaObject *metaObject) const
for (int ii = 0; ii < metaObject->enumeratorCount(); ++ii) {
QMetaEnum e = metaObject->enumerator(ii);
const bool isScoped = e.isScoped();
- QStringHash<int> *scoped = isScoped ? new QStringHash<int>() : 0;
+ QStringHash<int> *scoped = isScoped ? new QStringHash<int>() : nullptr;
for (int jj = 0; jj < e.keyCount(); ++jj) {
const QString key = QString::fromUtf8(e.key(jj));
@@ -888,7 +888,7 @@ QString QQmlType::qmlTypeName() const
QObject *QQmlType::create() const
{
if (!d || !isCreatable())
- return 0;
+ return nullptr;
d->init();
@@ -921,25 +921,25 @@ void QQmlType::create(QObject **out, void **memory, size_t additionalMemory) con
QQmlType::SingletonInstanceInfo *QQmlType::singletonInstanceInfo() const
{
if (!d)
- return 0;
+ return nullptr;
if (d->regType != SingletonType && d->regType != CompositeSingletonType)
- return 0;
+ return nullptr;
return d->extraData.sd->singletonInstanceInfo;
}
QQmlCustomParser *QQmlType::customParser() const
{
if (!d)
- return 0;
+ return nullptr;
if (d->regType != CppType)
- return 0;
+ return nullptr;
return d->extraData.cd->customParser;
}
QQmlType::CreateFunc QQmlType::createFunction() const
{
if (!d || d->regType != CppType)
- return 0;
+ return nullptr;
return d->extraData.cd->newFunc;
}
@@ -1004,7 +1004,7 @@ int QQmlType::qListTypeId() const
const QMetaObject *QQmlType::metaObject() const
{
if (!d)
- return 0;
+ return nullptr;
d->init();
if (d->metaObjects.isEmpty())
@@ -1016,7 +1016,7 @@ const QMetaObject *QQmlType::metaObject() const
const QMetaObject *QQmlType::baseMetaObject() const
{
- return d ? d->baseMetaObject : 0;
+ return d ? d->baseMetaObject : nullptr;
}
bool QQmlType::containsRevisionedAttributes() const
@@ -1036,7 +1036,7 @@ int QQmlType::metaObjectRevision() const
QQmlAttachedPropertiesFunc QQmlType::attachedPropertiesFunction(QQmlEnginePrivate *engine) const
{
if (!d)
- return 0;
+ return nullptr;
if (d->regType == CppType)
return d->extraData.cd->attachedPropertiesFunc;
@@ -1049,7 +1049,7 @@ QQmlAttachedPropertiesFunc QQmlType::attachedPropertiesFunction(QQmlEnginePrivat
const QMetaObject *QQmlType::attachedPropertiesType(QQmlEnginePrivate *engine) const
{
if (!d)
- return 0;
+ return nullptr;
if (d->regType == CppType)
return d->extraData.cd->attachedPropertiesType;
@@ -1101,7 +1101,7 @@ int QQmlType::propertyValueInterceptorCast() const
const char *QQmlType::interfaceIId() const
{
if (!d || d->regType != InterfaceType)
- return 0;
+ return nullptr;
return d->iid;
}
@@ -1125,7 +1125,7 @@ int QQmlType::enumValue(QQmlEnginePrivate *engine, const QHashedStringRef &name,
{
Q_ASSERT(ok);
if (d) {
- const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : 0;
+ const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : nullptr;
*ok = true;
@@ -1144,7 +1144,7 @@ int QQmlType::enumValue(QQmlEnginePrivate *engine, const QHashedCStringRef &name
{
Q_ASSERT(ok);
if (d) {
- const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : 0;
+ const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : nullptr;
*ok = true;
@@ -1163,7 +1163,7 @@ int QQmlType::enumValue(QQmlEnginePrivate *engine, const QV4::String *name, bool
{
Q_ASSERT(ok);
if (d) {
- const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : 0;
+ const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : nullptr;
*ok = true;
d->initEnums(cache);
@@ -1181,7 +1181,7 @@ int QQmlType::scopedEnumIndex(QQmlEnginePrivate *engine, const QV4::String *name
{
Q_ASSERT(ok);
if (d) {
- const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : 0;
+ const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : nullptr;
*ok = true;
d->initEnums(cache);
@@ -1199,7 +1199,7 @@ int QQmlType::scopedEnumIndex(QQmlEnginePrivate *engine, const QString &name, bo
{
Q_ASSERT(ok);
if (d) {
- const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : 0;
+ const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : nullptr;
*ok = true;
d->initEnums(cache);
@@ -1251,7 +1251,7 @@ int QQmlType::scopedEnumValue(QQmlEnginePrivate *engine, const QByteArray &scope
{
Q_ASSERT(ok);
if (d) {
- const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : 0;
+ const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : nullptr;
*ok = true;
d->initEnums(cache);
@@ -1274,7 +1274,7 @@ int QQmlType::scopedEnumValue(QQmlEnginePrivate *engine, const QStringRef &scope
{
Q_ASSERT(ok);
if (d) {
- const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : 0;
+ const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : nullptr;
*ok = true;
d->initEnums(cache);
@@ -1340,7 +1340,7 @@ QQmlTypeModule::QQmlTypeModule()
QQmlTypeModule::~QQmlTypeModule()
{
- delete d; d = 0;
+ delete d; d = nullptr;
}
QString QQmlTypeModule::module() const
@@ -1439,7 +1439,7 @@ void QQmlTypeModule::walkCompositeSingletons(const std::function<void(const QQml
}
QQmlTypeModuleVersion::QQmlTypeModuleVersion()
-: m_module(0), m_minor(0)
+: m_module(nullptr), m_minor(0)
{
}
@@ -1699,7 +1699,7 @@ QQmlType QQmlMetaType::registerCompositeSingletonType(const QQmlPrivate::Registe
bool fileImport = false;
if (*(type.uri) == '\0')
fileImport = true;
- if (!checkRegistration(QQmlType::CompositeSingletonType, data, fileImport ? 0 : type.uri, typeName))
+ if (!checkRegistration(QQmlType::CompositeSingletonType, data, fileImport ? nullptr : type.uri, typeName))
return QQmlType();
QQmlType dtype(data, typeName, type);
@@ -1721,7 +1721,7 @@ QQmlType QQmlMetaType::registerCompositeType(const QQmlPrivate::RegisterComposit
bool fileImport = false;
if (*(type.uri) == '\0')
fileImport = true;
- if (!checkRegistration(QQmlType::CompositeType, data, fileImport?0:type.uri, typeName, type.versionMajor))
+ if (!checkRegistration(QQmlType::CompositeType, data, fileImport?nullptr:type.uri, typeName, type.versionMajor))
return QQmlType();
QQmlType dtype(data, typeName, type);
@@ -1745,13 +1745,13 @@ void QQmlMetaType::registerInternalCompositeType(QV4::CompiledData::CompilationU
QtMetaTypePrivate::QMetaTypeFunctionHelper<QObject*>::Construct,
sizeof(QObject*),
static_cast<QFlags<QMetaType::TypeFlag> >(QtPrivate::QMetaTypeTypeFlags<QObject*>::Flags),
- 0);
+ nullptr);
int lst_type = QMetaType::registerNormalizedType(lst,
QtMetaTypePrivate::QMetaTypeFunctionHelper<QQmlListProperty<QObject> >::Destruct,
QtMetaTypePrivate::QMetaTypeFunctionHelper<QQmlListProperty<QObject> >::Construct,
sizeof(QQmlListProperty<QObject>),
static_cast<QFlags<QMetaType::TypeFlag> >(QtPrivate::QMetaTypeTypeFlags<QQmlListProperty<QObject> >::Flags),
- static_cast<QMetaObject*>(0));
+ static_cast<QMetaObject*>(nullptr));
compilationUnit->metaTypeId = ptr_type;
compilationUnit->listMetaTypeId = lst_type;
@@ -1964,7 +1964,7 @@ QObject *QQmlMetaType::toQObject(const QVariant &v, bool *ok)
{
if (!isQObject(v.userType())) {
if (ok) *ok = false;
- return 0;
+ return nullptr;
}
if (ok) *ok = true;
@@ -2014,7 +2014,7 @@ int QQmlMetaType::attachedPropertiesFuncId(QQmlEnginePrivate *engine, const QMet
QQmlAttachedPropertiesFunc QQmlMetaType::attachedPropertiesFuncById(QQmlEnginePrivate *engine, int id)
{
if (id < 0)
- return 0;
+ return nullptr;
QMutexLocker lock(metaTypeDataLock());
QQmlMetaTypeData *data = metaTypeData();
return data->types.at(id).attachedPropertiesFunction(engine);
@@ -2107,7 +2107,7 @@ const char *QQmlMetaType::interfaceIId(int userType)
if (type.isInterface() && type.typeId() == userType)
return type.interfaceIId();
else
- return 0;
+ return nullptr;
}
bool QQmlMetaType::isList(int userType)
diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h
index cee1070a09..07bef526ba 100644
--- a/src/qml/qml/qqmlmetatype_p.h
+++ b/src/qml/qml/qqmlmetatype_p.h
@@ -109,7 +109,7 @@ public:
static QMetaMethod defaultMethod(QObject *);
static bool isQObject(int);
- static QObject *toQObject(const QVariant &, bool *ok = 0);
+ static QObject *toQObject(const QVariant &, bool *ok = nullptr);
static int listType(int);
static int attachedPropertiesFuncId(QQmlEnginePrivate *engine, const QMetaObject *);
@@ -163,7 +163,7 @@ public:
return d == other.d;
}
- bool isValid() const { return d != 0; }
+ bool isValid() const { return d != nullptr; }
const QQmlTypePrivate *key() const { return d; }
QByteArray typeName() const;
@@ -218,7 +218,7 @@ public:
{
public:
SingletonInstanceInfo()
- : scriptCallback(0), qobjectCallback(0), instanceMetaObject(0) {}
+ : scriptCallback(nullptr), qobjectCallback(nullptr), instanceMetaObject(nullptr) {}
QJSValue (*scriptCallback)(QQmlEngine *, QJSEngine *);
QObject *(*qobjectCallback)(QQmlEngine *, QJSEngine *);
diff --git a/src/qml/qml/qqmlnotifier.cpp b/src/qml/qml/qqmlnotifier.cpp
index e068ad174a..ac247ae0ad 100644
--- a/src/qml/qml/qqmlnotifier.cpp
+++ b/src/qml/qml/qqmlnotifier.cpp
@@ -51,7 +51,7 @@ void QQmlJavaScriptExpressionGuard_callback(QQmlNotifierEndpoint *, void **);
void QQmlVMEMetaObjectEndpoint_callback(QQmlNotifierEndpoint *, void **);
static Callback QQmlNotifier_callbacks[] = {
- 0,
+ nullptr,
QQmlBoundSignal_callback,
QQmlJavaScriptExpressionGuard_callback,
QQmlVMEMetaObjectEndpoint_callback
@@ -59,9 +59,9 @@ static Callback QQmlNotifier_callbacks[] = {
namespace {
struct NotifyListTraversalData {
- NotifyListTraversalData(QQmlNotifierEndpoint *ep = 0)
+ NotifyListTraversalData(QQmlNotifierEndpoint *ep = nullptr)
: originalSenderPtr(0)
- , disconnectWatch(0)
+ , disconnectWatch(nullptr)
, endpoint(ep)
{}
diff --git a/src/qml/qml/qqmlnotifier_p.h b/src/qml/qml/qqmlnotifier_p.h
index a99b13f155..39761875bf 100644
--- a/src/qml/qml/qqmlnotifier_p.h
+++ b/src/qml/qml/qqmlnotifier_p.h
@@ -129,7 +129,7 @@ private:
};
QQmlNotifier::QQmlNotifier()
-: endpoints(0)
+: endpoints(nullptr)
{
}
@@ -142,22 +142,22 @@ QQmlNotifier::~QQmlNotifier()
if (n->isNotifying()) *((qintptr *)(n->senderPtr & ~0x1)) = 0;
- n->next = 0;
- n->prev = 0;
+ n->next = nullptr;
+ n->prev = nullptr;
n->senderPtr = 0;
n->sourceSignal = -1;
}
- endpoints = 0;
+ endpoints = nullptr;
}
void QQmlNotifier::notify()
{
- void *args[] = { 0 };
+ void *args[] = { nullptr };
if (endpoints) emitNotify(endpoints, args);
}
QQmlNotifierEndpoint::QQmlNotifierEndpoint(Callback callback)
-: next(0), prev(0), senderPtr(0), callback(callback), needsConnectNotify(false), sourceSignal(-1)
+: next(nullptr), prev(nullptr), senderPtr(0), callback(callback), needsConnectNotify(false), sourceSignal(-1)
{
}
@@ -168,7 +168,7 @@ QQmlNotifierEndpoint::~QQmlNotifierEndpoint()
bool QQmlNotifierEndpoint::isConnected() const
{
- return prev != 0;
+ return prev != nullptr;
}
/*! \internal
@@ -212,8 +212,8 @@ void QQmlNotifierEndpoint::disconnect()
}
if (isNotifying()) *((qintptr *)(senderPtr & ~0x1)) = 0;
- next = 0;
- prev = 0;
+ next = nullptr;
+ prev = nullptr;
senderPtr = 0;
sourceSignal = -1;
}
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index caf063c79f..36e56a01f8 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -82,13 +82,13 @@ QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QV4::Compil
{
init(parentContext);
- sharedState->componentAttached = 0;
+ sharedState->componentAttached = nullptr;
sharedState->allCreatedBindings.allocate(compilationUnit->totalBindingsCount);
sharedState->allParserStatusCallbacks.allocate(compilationUnit->totalParserStatusCount);
sharedState->allCreatedObjects.allocate(compilationUnit->totalObjectCount);
- sharedState->allJavaScriptObjects = 0;
+ sharedState->allJavaScriptObjects = nullptr;
sharedState->creationContext = creationContext;
- sharedState->rootContext = 0;
+ sharedState->rootContext = nullptr;
if (auto profiler = QQmlEnginePrivate::get(engine)->profiler) {
Q_QML_PROFILE_IF_ENABLED(QQmlProfilerDefinitions::ProfileCreating, profiler,
@@ -105,7 +105,7 @@ QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QV4::Compil
, propertyCaches(&compilationUnit->propertyCaches)
, sharedState(inheritedSharedState)
, topLevelCreator(false)
- , incubator(0)
+ , incubator(nullptr)
{
init(parentContext);
}
@@ -120,17 +120,17 @@ void QQmlObjectCreator::init(QQmlContextData *providedParentContext)
compilationUnit->linkToEngine(v4);
qmlUnit = compilationUnit->data;
- context = 0;
- _qobject = 0;
- _scopeObject = 0;
- _bindingTarget = 0;
- _valueTypeProperty = 0;
- _compiledObject = 0;
+ context = nullptr;
+ _qobject = nullptr;
+ _scopeObject = nullptr;
+ _bindingTarget = nullptr;
+ _valueTypeProperty = nullptr;
+ _compiledObject = nullptr;
_compiledObjectIndex = -1;
- _ddata = 0;
- _propertyCache = 0;
- _vmeMetaObject = 0;
- _qmlContext = 0;
+ _ddata = nullptr;
+ _propertyCache = nullptr;
+ _vmeMetaObject = nullptr;
+ _qmlContext = nullptr;
}
QQmlObjectCreator::~QQmlObjectCreator()
@@ -142,7 +142,7 @@ QQmlObjectCreator::~QQmlObjectCreator()
for (int i = 0; i < sharedState->allParserStatusCallbacks.count(); ++i) {
QQmlParserStatus *ps = sharedState->allParserStatusCallbacks.at(i);
if (ps)
- ps->d = 0;
+ ps->d = nullptr;
}
while (sharedState->componentAttached) {
QQmlComponentAttached *a = sharedState->componentAttached;
@@ -207,12 +207,12 @@ QObject *QQmlObjectCreator::create(int subComponentIndex, QObject *parent, QQmlI
}
if (topLevelCreator)
- sharedState->allJavaScriptObjects = 0;
+ sharedState->allJavaScriptObjects = nullptr;
phase = CreatingObjectsPhase2;
if (interrupt && interrupt->shouldInterrupt())
- return 0;
+ return nullptr;
phase = ObjectsCreated;
@@ -796,7 +796,7 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *property, con
}
const int id = attachedType.attachedPropertiesId(QQmlEnginePrivate::get(engine));
QObject *qmlObject = qmlAttachedPropertiesObjectById(id, _qobject);
- if (!populateInstance(binding->value.objectIndex, qmlObject, qmlObject, /*value type property*/0))
+ if (!populateInstance(binding->value.objectIndex, qmlObject, qmlObject, /*value type property*/nullptr))
return false;
return true;
}
@@ -814,12 +814,12 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *property, con
QQmlPropertyData::WriteFlags propertyWriteFlags = QQmlPropertyData::BypassInterceptor |
QQmlPropertyData::RemoveBindingOnAliasWrite;
int propertyWriteStatus = -1;
- void *argv[] = { &ss, 0, &propertyWriteStatus, &propertyWriteFlags };
+ void *argv[] = { &ss, nullptr, &propertyWriteStatus, &propertyWriteFlags };
QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex(), argv);
return true;
}
- QObject *createdSubObject = 0;
+ QObject *createdSubObject = nullptr;
if (binding->type == QV4::CompiledData::Binding::Type_Object) {
createdSubObject = createInstance(binding->value.objectIndex, _bindingTarget);
if (!createdSubObject)
@@ -833,9 +833,9 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *property, con
const QV4::CompiledData::Object *obj = qmlUnit->objectAt(binding->value.objectIndex);
if (stringAt(obj->inheritedTypeNameIndex).isEmpty()) {
- QObject *groupObject = 0;
- QQmlValueType *valueType = 0;
- const QQmlPropertyData *valueTypeProperty = 0;
+ QObject *groupObject = nullptr;
+ QQmlValueType *valueType = nullptr;
+ const QQmlPropertyData *valueTypeProperty = nullptr;
QObject *bindingTarget = _bindingTarget;
if (QQmlValueTypeFactory::isValueType(property->propType())) {
@@ -1008,7 +1008,7 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *property, con
QQmlPropertyData::WriteFlags propertyWriteFlags = QQmlPropertyData::BypassInterceptor |
QQmlPropertyData::RemoveBindingOnAliasWrite;
int propertyWriteStatus = -1;
- void *argv[] = { 0, 0, &propertyWriteStatus, &propertyWriteFlags };
+ void *argv[] = { nullptr, nullptr, &propertyWriteStatus, &propertyWriteFlags };
if (const char *iid = QQmlMetaType::interfaceIId(property->propType())) {
void *ptr = createdSubObject->qt_metacast(iid);
@@ -1034,7 +1034,7 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *property, con
void *itemToAdd = createdSubObject;
- const char *iid = 0;
+ const char *iid = nullptr;
int listItemType = QQmlEnginePrivate::get(engine)->listType(property->propType());
if (listItemType != -1)
iid = QQmlMetaType::interfaceIId(listItemType);
@@ -1114,10 +1114,10 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isCo
ActiveOCRestorer ocRestorer(this, QQmlEnginePrivate::get(engine));
bool isComponent = false;
- QObject *instance = 0;
- QQmlData *ddata = 0;
- QQmlCustomParser *customParser = 0;
- QQmlParserStatus *parserStatus = 0;
+ QObject *instance = nullptr;
+ QQmlData *ddata = nullptr;
+ QQmlCustomParser *customParser = nullptr;
+ QQmlParserStatus *parserStatus = nullptr;
bool installPropertyCache = true;
if (obj->flags & QV4::CompiledData::Object::IsComponent) {
@@ -1137,11 +1137,11 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isCo
Q_QML_OC_PROFILE(sharedState->profiler, profiler.update(
compilationUnit, obj, type.qmlTypeName(), context->url()));
- void *ddataMemory = 0;
+ void *ddataMemory = nullptr;
type.create(&instance, &ddataMemory, sizeof(QQmlData));
if (!instance) {
recordError(obj->location, tr("Unable to create object of type %1").arg(stringAt(obj->inheritedTypeNameIndex)));
- return 0;
+ return nullptr;
}
{
@@ -1173,14 +1173,14 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isCo
if (typeRef->compilationUnit->data->isSingleton())
{
recordError(obj->location, tr("Composite Singleton Type %1 is not creatable").arg(stringAt(obj->inheritedTypeNameIndex)));
- return 0;
+ return nullptr;
}
QQmlObjectCreator subCreator(context, typeRef->compilationUnit, sharedState.data());
instance = subCreator.create();
if (!instance) {
errors += subCreator.errors;
- return 0;
+ return nullptr;
}
}
if (instance->isWidgetType()) {
@@ -1244,8 +1244,8 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isCo
}
customParser->applyBindings(instance, compilationUnit, bindings);
- customParser->engine = 0;
- customParser->imports = (QQmlTypeNameCache*)0;
+ customParser->engine = nullptr;
+ customParser->imports = (QQmlTypeNameCache*)nullptr;
}
if (isComponent) {
@@ -1274,12 +1274,12 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isCo
qSwap(_qmlContext, qmlContext);
- bool result = populateInstance(index, instance, /*binding target*/instance, /*value type property*/0);
+ bool result = populateInstance(index, instance, /*binding target*/instance, /*value type property*/nullptr);
qSwap(_qmlContext, qmlContext);
qSwap(_scopeObject, scopeObject);
- return result ? instance : 0;
+ return result ? instance : nullptr;
}
QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interrupt)
@@ -1303,7 +1303,7 @@ QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interru
QQmlPropertyData::DontRemoveBinding);
if (watcher.hasRecursed() || interrupt.shouldInterrupt())
- return 0;
+ return nullptr;
}
if (QQmlVME::componentCompleteEnabled()) { // the qml designer does the component complete later
@@ -1312,12 +1312,12 @@ QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interru
QQmlParserStatus *status = sharedState->allParserStatusCallbacks.pop();
if (status && status->d) {
- status->d = 0;
+ status->d = nullptr;
status->componentComplete();
}
if (watcher.hasRecursed() || interrupt.shouldInterrupt())
- return 0;
+ return nullptr;
}
}
@@ -1325,11 +1325,11 @@ QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interru
QQmlEnginePrivate::FinalizeCallback callback = sharedState->finalizeCallbacks.at(ii);
QObject *obj = callback.first;
if (obj) {
- void *args[] = { 0 };
+ void *args[] = { nullptr };
QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, callback.second, args);
}
if (watcher.hasRecursed())
- return 0;
+ return nullptr;
}
sharedState->finalizeCallbacks.clear();
@@ -1344,7 +1344,7 @@ QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interru
emit a->completed();
if (watcher.hasRecursed() || interrupt.shouldInterrupt())
- return 0;
+ return nullptr;
}
phase = Done;
@@ -1386,7 +1386,7 @@ bool QQmlObjectCreator::populateInstance(int index, QObject *instance, QObject *
QQmlRefPointer<QQmlPropertyCache> cache = propertyCaches->at(_compiledObjectIndex);
- QQmlVMEMetaObject *vmeMetaObject = 0;
+ QQmlVMEMetaObject *vmeMetaObject = nullptr;
if (propertyCaches->needsVMEMetaObject(_compiledObjectIndex)) {
Q_ASSERT(!cache.isNull());
// install on _object
diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h
index bef58b8c9a..399a5f6d4a 100644
--- a/src/qml/qml/qqmlobjectcreator_p.h
+++ b/src/qml/qml/qqmlobjectcreator_p.h
@@ -85,10 +85,10 @@ class Q_QML_PRIVATE_EXPORT QQmlObjectCreator
{
Q_DECLARE_TR_FUNCTIONS(QQmlObjectCreator)
public:
- QQmlObjectCreator(QQmlContextData *parentContext, QV4::CompiledData::CompilationUnit *compilationUnit, QQmlContextData *creationContext, QQmlIncubatorPrivate *incubator = 0);
+ QQmlObjectCreator(QQmlContextData *parentContext, QV4::CompiledData::CompilationUnit *compilationUnit, QQmlContextData *creationContext, QQmlIncubatorPrivate *incubator = nullptr);
~QQmlObjectCreator();
- QObject *create(int subComponentIndex = -1, QObject *parent = 0, QQmlInstantiationInterrupt *interrupt = 0);
+ QObject *create(int subComponentIndex = -1, QObject *parent = nullptr, QQmlInstantiationInterrupt *interrupt = nullptr);
bool populateDeferredProperties(QObject *instance, QQmlData::DeferredData *deferredData);
bool populateDeferredBinding(const QQmlProperty &qmlProperty, QQmlData::DeferredData *deferredData, const QV4::CompiledData::Binding *binding);
QQmlContextData *finalize(QQmlInstantiationInterrupt &interrupt);
@@ -108,7 +108,7 @@ private:
void init(QQmlContextData *parentContext);
- QObject *createInstance(int index, QObject *parent = 0, bool isContextObject = false);
+ QObject *createInstance(int index, QObject *parent = nullptr, bool isContextObject = false);
bool populateInstance(int index, QObject *instance,
QObject *bindingTarget, const QQmlPropertyData *valueTypeProperty);
diff --git a/src/qml/qml/qqmlopenmetaobject.cpp b/src/qml/qml/qqmlopenmetaobject.cpp
index fc85030b3d..1b44bbdda3 100644
--- a/src/qml/qml/qqmlopenmetaobject.cpp
+++ b/src/qml/qml/qqmlopenmetaobject.cpp
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
class QQmlOpenMetaObjectTypePrivate
{
public:
- QQmlOpenMetaObjectTypePrivate() : mem(0), cache(0), engine(0) {}
+ QQmlOpenMetaObjectTypePrivate() : mem(nullptr), cache(nullptr), engine(nullptr) {}
void init(const QMetaObject *metaObj);
@@ -83,7 +83,7 @@ QQmlOpenMetaObjectType::~QQmlOpenMetaObjectType()
void QQmlOpenMetaObjectType::clear()
{
- d->engine = 0;
+ d->engine = nullptr;
}
int QQmlOpenMetaObjectType::propertyOffset() const
@@ -182,7 +182,7 @@ class QQmlOpenMetaObjectPrivate
{
public:
QQmlOpenMetaObjectPrivate(QQmlOpenMetaObject *_q)
- : q(_q), parent(0), type(0), cacheProperties(false) {}
+ : q(_q), parent(nullptr), type(nullptr), cacheProperties(false) {}
inline QPair<QVariant, bool> &getDataRef(int idx) {
while (data.count() <= idx)
@@ -220,7 +220,7 @@ QQmlOpenMetaObject::QQmlOpenMetaObject(QObject *obj, const QMetaObject *base, bo
d->autoCreate = automatic;
d->object = obj;
- d->type = new QQmlOpenMetaObjectType(base ? base : obj->metaObject(), 0);
+ d->type = new QQmlOpenMetaObjectType(base ? base : obj->metaObject(), nullptr);
d->type->d->referers.insert(this);
QObjectPrivate *op = QObjectPrivate::get(obj);
@@ -264,7 +264,7 @@ void QQmlOpenMetaObject::emitPropertyNotification(const QByteArray &propertyName
QHash<QByteArray, int>::ConstIterator iter = d->type->d->names.constFind(propertyName);
if (iter == d->type->d->names.constEnd())
return;
- activate(d->object, *iter + d->type->d->signalOffset, 0);
+ activate(d->object, *iter + d->type->d->signalOffset, nullptr);
}
int QQmlOpenMetaObject::metaCall(QObject *o, QMetaObject::Call c, int id, void **a)
@@ -284,7 +284,7 @@ int QQmlOpenMetaObject::metaCall(QObject *o, QMetaObject::Call c, int id, void *
prop.first = propertyWriteValue(propId, *reinterpret_cast<QVariant *>(a[0]));
prop.second = true;
propertyWritten(propId);
- activate(o, d->type->d->signalOffset + propId, 0);
+ activate(o, d->type->d->signalOffset + propId, nullptr);
}
}
return -1;
@@ -311,7 +311,7 @@ void QQmlOpenMetaObject::setValue(int id, const QVariant &value)
QPair<QVariant, bool> &prop = d->getDataRef(id);
prop.first = propertyWriteValue(id, value);
prop.second = true;
- activate(d->object, id + d->type->d->signalOffset, 0);
+ activate(d->object, id + d->type->d->signalOffset, nullptr);
}
QVariant QQmlOpenMetaObject::value(const QByteArray &name) const
@@ -353,7 +353,7 @@ bool QQmlOpenMetaObject::setValue(const QByteArray &name, const QVariant &val)
return false;
dataVal = val;
- activate(d->object, id + d->type->d->signalOffset, 0);
+ activate(d->object, id + d->type->d->signalOffset, nullptr);
return true;
}
@@ -382,7 +382,7 @@ void QQmlOpenMetaObject::setCached(bool c)
} else {
if (d->type->d->cache)
d->type->d->cache->release();
- qmldata->propertyCache = 0;
+ qmldata->propertyCache = nullptr;
}
}
@@ -395,7 +395,7 @@ int QQmlOpenMetaObject::createProperty(const char *name, const char *)
if (QQmlData *ddata = QQmlData::get(d->object, /*create*/false)) {
if (ddata->propertyCache) {
ddata->propertyCache->release();
- ddata->propertyCache = 0;
+ ddata->propertyCache = nullptr;
}
}
diff --git a/src/qml/qml/qqmlopenmetaobject_p.h b/src/qml/qml/qqmlopenmetaobject_p.h
index 4bb92489a5..bb5477dfbf 100644
--- a/src/qml/qml/qqmlopenmetaobject_p.h
+++ b/src/qml/qml/qqmlopenmetaobject_p.h
@@ -95,7 +95,7 @@ class QQmlOpenMetaObjectPrivate;
class Q_QML_PRIVATE_EXPORT QQmlOpenMetaObject : public QAbstractDynamicMetaObject
{
public:
- QQmlOpenMetaObject(QObject *, const QMetaObject * = 0, bool = true);
+ QQmlOpenMetaObject(QObject *, const QMetaObject * = nullptr, bool = true);
QQmlOpenMetaObject(QObject *, QQmlOpenMetaObjectType *, bool = true);
~QQmlOpenMetaObject();
diff --git a/src/qml/qml/qqmlparserstatus.cpp b/src/qml/qml/qqmlparserstatus.cpp
index ad07cac7ef..1082c318cb 100644
--- a/src/qml/qml/qqmlparserstatus.cpp
+++ b/src/qml/qml/qqmlparserstatus.cpp
@@ -87,7 +87,7 @@ QT_BEGIN_NAMESPACE
/*! \internal */
QQmlParserStatus::QQmlParserStatus()
-: d(0)
+: d(nullptr)
{
}
@@ -95,7 +95,7 @@ QQmlParserStatus::QQmlParserStatus()
QQmlParserStatus::~QQmlParserStatus()
{
if(d)
- (*d) = 0;
+ (*d) = nullptr;
}
/*!
diff --git a/src/qml/qml/qqmlplatform_p.h b/src/qml/qml/qqmlplatform_p.h
index 6246ca7105..af33dffca3 100644
--- a/src/qml/qml/qqmlplatform_p.h
+++ b/src/qml/qml/qqmlplatform_p.h
@@ -64,7 +64,7 @@ class Q_QML_PRIVATE_EXPORT QQmlPlatform : public QObject
Q_PROPERTY(QString pluginName READ pluginName CONSTANT)
public:
- explicit QQmlPlatform(QObject *parent = 0);
+ explicit QQmlPlatform(QObject *parent = nullptr);
virtual ~QQmlPlatform();
static QString os();
diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h
index b9e9d5e59e..11adea6fc9 100644
--- a/src/qml/qml/qqmlprivate.h
+++ b/src/qml/qml/qqmlprivate.h
@@ -167,8 +167,8 @@ namespace QQmlPrivate
class AttachedPropertySelector
{
public:
- static inline QQmlAttachedPropertiesFunc func() { return 0; }
- static inline const QMetaObject *metaObject() { return 0; }
+ static inline QQmlAttachedPropertiesFunc func() { return nullptr; }
+ static inline const QMetaObject *metaObject() { return nullptr; }
};
template<typename T>
class AttachedPropertySelector<T, 1>
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp
index 50d9f13049..8ecd597a39 100644
--- a/src/qml/qml/qqmlproperty.cpp
+++ b/src/qml/qml/qqmlproperty.cpp
@@ -119,7 +119,7 @@ The \l {Qt Quick 1} version of this class was named QDeclarativeProperty.
Create an invalid QQmlProperty.
*/
QQmlProperty::QQmlProperty()
-: d(0)
+: d(nullptr)
{
}
@@ -128,7 +128,7 @@ QQmlProperty::~QQmlProperty()
{
if (d)
d->release();
- d = 0;
+ d = nullptr;
}
/*!
@@ -150,8 +150,8 @@ QQmlProperty::QQmlProperty(QObject *obj)
QQmlProperty::QQmlProperty(QObject *obj, QQmlContext *ctxt)
: d(new QQmlPropertyPrivate)
{
- d->context = ctxt?QQmlContextData::get(ctxt):0;
- d->engine = ctxt?ctxt->engine():0;
+ d->context = ctxt?QQmlContextData::get(ctxt):nullptr;
+ d->engine = ctxt?ctxt->engine():nullptr;
d->initDefault(obj);
}
@@ -164,7 +164,7 @@ QQmlProperty::QQmlProperty(QObject *obj, QQmlContext *ctxt)
QQmlProperty::QQmlProperty(QObject *obj, QQmlEngine *engine)
: d(new QQmlPropertyPrivate)
{
- d->context = 0;
+ d->context = nullptr;
d->engine = engine;
d->initDefault(obj);
}
@@ -190,7 +190,7 @@ QQmlProperty::QQmlProperty(QObject *obj, const QString &name)
: d(new QQmlPropertyPrivate)
{
d->initProperty(obj, name);
- if (!isValid()) d->object = 0;
+ if (!isValid()) d->object = nullptr;
}
/*!
@@ -203,10 +203,10 @@ QQmlProperty::QQmlProperty(QObject *obj, const QString &name)
QQmlProperty::QQmlProperty(QObject *obj, const QString &name, QQmlContext *ctxt)
: d(new QQmlPropertyPrivate)
{
- d->context = ctxt?QQmlContextData::get(ctxt):0;
- d->engine = ctxt?ctxt->engine():0;
+ d->context = ctxt?QQmlContextData::get(ctxt):nullptr;
+ d->engine = ctxt?ctxt->engine():nullptr;
d->initProperty(obj, name);
- if (!isValid()) { d->object = 0; d->context = 0; d->engine = 0; }
+ if (!isValid()) { d->object = nullptr; d->context = nullptr; d->engine = nullptr; }
}
/*!
@@ -217,10 +217,10 @@ QQmlProperty::QQmlProperty(QObject *obj, const QString &name, QQmlContext *ctxt)
QQmlProperty::QQmlProperty(QObject *obj, const QString &name, QQmlEngine *engine)
: d(new QQmlPropertyPrivate)
{
- d->context = 0;
+ d->context = nullptr;
d->engine = engine;
d->initProperty(obj, name);
- if (!isValid()) { d->object = 0; d->context = 0; d->engine = 0; }
+ if (!isValid()) { d->object = nullptr; d->context = nullptr; d->engine = nullptr; }
}
QQmlProperty QQmlPropertyPrivate::create(QObject *target, const QString &propertyName, QQmlContextData *context)
@@ -240,7 +240,7 @@ QQmlProperty QQmlPropertyPrivate::create(QObject *target, const QString &propert
}
QQmlPropertyPrivate::QQmlPropertyPrivate()
-: context(0), engine(0), object(0), isNameCached(false)
+: context(nullptr), engine(nullptr), object(nullptr), isNameCached(false)
{
}
@@ -248,14 +248,14 @@ QQmlContextData *QQmlPropertyPrivate::effectiveContext() const
{
if (context) return context;
else if (engine) return QQmlContextData::get(engine->rootContext());
- else return 0;
+ else return nullptr;
}
void QQmlPropertyPrivate::initProperty(QObject *obj, const QString &name)
{
if (!obj) return;
- QQmlTypeNameCache *typeNameCache = context?context->imports:0;
+ QQmlTypeNameCache *typeNameCache = context?context->imports:nullptr;
QObject *currentObject = obj;
QVector<QStringRef> path;
@@ -487,7 +487,7 @@ QQmlPropertyPrivate::propertyTypeCategory() const
const char *QQmlProperty::propertyTypeName() const
{
if (!d)
- return 0;
+ return nullptr;
if (d->isValueType()) {
const QMetaObject *valueTypeMetaObject = QQmlValueTypeFactory::metaObjectForMetaType(d->core.propType());
Q_ASSERT(valueTypeMetaObject);
@@ -495,7 +495,7 @@ const char *QQmlProperty::propertyTypeName() const
} else if (d->object && type() & Property && d->core.isValid()) {
return d->object->metaObject()->property(d->core.coreIndex()).typeName();
} else {
- return 0;
+ return nullptr;
}
}
@@ -579,7 +579,7 @@ bool QQmlProperty::isSignalProperty() const
*/
QObject *QQmlProperty::object() const
{
- return d ? d->object : 0;
+ return d ? d->object : nullptr;
}
/*!
@@ -717,7 +717,7 @@ QQmlAbstractBinding *
QQmlPropertyPrivate::binding(const QQmlProperty &that)
{
if (!that.d || !that.isProperty() || !that.d->object)
- return 0;
+ return nullptr;
QQmlPropertyIndex thatIndex(that.d->core.coreIndex(), that.d->valueTypeData.coreIndex());
return binding(that.d->object, thatIndex);
@@ -779,7 +779,7 @@ static void removeOldBinding(QObject *object, QQmlPropertyIndex index, QQmlPrope
return;
if (!(flags & QQmlPropertyPrivate::DontEnable))
- oldBinding->setEnabled(false, 0);
+ oldBinding->setEnabled(false, nullptr);
oldBinding->removeFromObject();
}
@@ -813,13 +813,13 @@ QQmlPropertyPrivate::binding(QObject *object, QQmlPropertyIndex index)
QQmlData *data = QQmlData::get(object);
if (!data)
- return 0;
+ return nullptr;
const int coreIndex = index.coreIndex();
const int valueTypeIndex = index.valueTypeIndex();
if (coreIndex < 0 || !data->hasBindingBit(coreIndex))
- return 0;
+ return nullptr;
QQmlAbstractBinding *binding = data->bindings;
while (binding && (binding->targetPropertyIndex().coreIndex() != coreIndex ||
@@ -845,11 +845,11 @@ void QQmlPropertyPrivate::findAliasTarget(QObject *object, QQmlPropertyIndex bin
int valueTypeIndex = bindingIndex.valueTypeIndex();
QQmlPropertyData *propertyData =
- data->propertyCache?data->propertyCache->property(coreIndex):0;
+ data->propertyCache?data->propertyCache->property(coreIndex):nullptr;
if (propertyData && propertyData->isAlias()) {
QQmlVMEMetaObject *vme = QQmlVMEMetaObject::getForProperty(object, coreIndex);
- QObject *aObject = 0; int aCoreIndex = -1; int aValueTypeIndex = -1;
+ QObject *aObject = nullptr; int aCoreIndex = -1; int aValueTypeIndex = -1;
if (vme->aliasTarget(coreIndex, &aObject, &aCoreIndex, &aValueTypeIndex)) {
// This will either be a value type sub-reference or an alias to a value-type sub-reference not both
Q_ASSERT(valueTypeIndex == -1 || aValueTypeIndex == -1);
@@ -904,11 +904,11 @@ QQmlBoundSignalExpression *
QQmlPropertyPrivate::signalExpression(const QQmlProperty &that)
{
if (!(that.type() & QQmlProperty::SignalProperty))
- return 0;
+ return nullptr;
QQmlData *data = QQmlData::get(that.d->object);
if (!data)
- return 0;
+ return nullptr;
QQmlBoundSignal *signalHandler = data->signalHandlers;
@@ -918,7 +918,7 @@ QQmlPropertyPrivate::signalExpression(const QQmlProperty &that)
if (signalHandler)
return signalHandler->expression();
- return 0;
+ return nullptr;
}
/*!
@@ -945,7 +945,7 @@ void QQmlPropertyPrivate::takeSignalExpression(const QQmlProperty &that,
return;
}
- QQmlData *data = QQmlData::get(that.d->object, 0 != expr);
+ QQmlData *data = QQmlData::get(that.d->object, nullptr != expr);
if (!data)
return;
@@ -1052,7 +1052,7 @@ QVariant QQmlPropertyPrivate::readValueProperty()
} else if (core.isQObject()) {
- QObject *rv = 0;
+ QObject *rv = nullptr;
core.readProperty(object, &rv);
return QVariant::fromValue(rv);
@@ -1063,11 +1063,11 @@ QVariant QQmlPropertyPrivate::readValueProperty()
QVariant value;
int status = -1;
- void *args[] = { 0, &value, &status };
+ void *args[] = { nullptr, &value, &status };
if (core.propType() == QMetaType::QVariant) {
args[0] = &value;
} else {
- value = QVariant(core.propType(), (void*)0);
+ value = QVariant(core.propType(), (void*)nullptr);
args[0] = value.data();
}
core.readPropertyWithArgs(object, args);
@@ -1426,7 +1426,7 @@ QQmlMetaObject QQmlPropertyPrivate::rawMetaObjectForType(QQmlEnginePrivate *engi
*/
bool QQmlProperty::write(const QVariant &value) const
{
- return QQmlPropertyPrivate::write(*this, value, 0);
+ return QQmlPropertyPrivate::write(*this, value, nullptr);
}
/*!
@@ -1495,7 +1495,7 @@ bool QQmlProperty::write(QObject *object, const QString &name, const QVariant &v
bool QQmlProperty::reset() const
{
if (isResettable()) {
- void *args[] = { 0 };
+ void *args[] = { nullptr };
QMetaObject::metacall(d->object, QMetaObject::ResetProperty, d->core.coreIndex(), args);
return true;
} else {
diff --git a/src/qml/qml/qqmlproperty_p.h b/src/qml/qml/qqmlproperty_p.h
index 7a66d8113c..544eab4c7f 100644
--- a/src/qml/qml/qqmlproperty_p.h
+++ b/src/qml/qml/qqmlproperty_p.h
@@ -104,9 +104,9 @@ public:
static bool writeValueProperty(QObject *,
const QQmlPropertyData &, const QQmlPropertyData &valueTypeData,
const QVariant &, QQmlContextData *,
- QQmlPropertyData::WriteFlags flags = 0);
+ QQmlPropertyData::WriteFlags flags = nullptr);
static bool write(QObject *, const QQmlPropertyData &, const QVariant &,
- QQmlContextData *, QQmlPropertyData::WriteFlags flags = 0);
+ QQmlContextData *, QQmlPropertyData::WriteFlags flags = nullptr);
static void findAliasTarget(QObject *, QQmlPropertyIndex, QObject **, QQmlPropertyIndex *);
enum BindingFlag {
@@ -140,7 +140,7 @@ public:
static QMetaMethod findSignalByName(const QMetaObject *mo, const QByteArray &);
static bool connect(const QObject *sender, int signal_index,
const QObject *receiver, int method_index,
- int type = 0, int *types = 0);
+ int type = 0, int *types = nullptr);
static void flushSignal(const QObject *sender, int signal_index);
static QVariant resolvedUrlSequence(const QVariant &value, QQmlContextData *context);
diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp
index bce81c1504..88eda9c020 100644
--- a/src/qml/qml/qqmlpropertycache.cpp
+++ b/src/qml/qml/qqmlpropertycache.cpp
@@ -243,9 +243,9 @@ void QQmlPropertyData::lazyLoad(const QMetaMethod &m)
Creates a new empty QQmlPropertyCache.
*/
QQmlPropertyCache::QQmlPropertyCache()
- : _parent(0), propertyIndexCacheStart(0), methodIndexCacheStart(0),
+ : _parent(nullptr), propertyIndexCacheStart(0), methodIndexCacheStart(0),
signalHandlerIndexCacheStart(0), _hasPropertyOverrides(false), _ownMetaObject(false),
- _metaObject(0), argumentsCache(0), _jsFactoryMethodIndex(-1)
+ _metaObject(nullptr), argumentsCache(nullptr), _jsFactoryMethodIndex(-1)
{
}
@@ -277,8 +277,8 @@ QQmlPropertyCache::~QQmlPropertyCache()
if (_parent) _parent->release();
if (_ownMetaObject) free(const_cast<QMetaObject *>(_metaObject));
- _metaObject = 0;
- _parent = 0;
+ _metaObject = nullptr;
+ _parent = nullptr;
}
QQmlPropertyCache *QQmlPropertyCache::copy(int reserve)
@@ -310,7 +310,7 @@ QQmlPropertyCache *QQmlPropertyCache::copyAndReserve(int propertyCount, int meth
rv->methodIndexCache.reserve(methodCount);
rv->signalHandlerIndexCache.reserve(signalCount);
rv->enumCache.reserve(enumCount);
- rv->_metaObject = 0;
+ rv->_metaObject = nullptr;
return rv;
}
@@ -337,7 +337,7 @@ void QQmlPropertyCache::appendProperty(const QString &name, QQmlPropertyData::Fl
int index = propertyIndexCache.count();
propertyIndexCache.append(data);
- setNamedProperty(name, index + propertyOffset(), propertyIndexCache.data() + index, (old != 0));
+ setNamedProperty(name, index + propertyOffset(), propertyIndexCache.data() + index, (old != nullptr));
}
void QQmlPropertyCache::appendSignal(const QString &name, QQmlPropertyData::Flags flags,
@@ -374,8 +374,8 @@ void QQmlPropertyCache::appendSignal(const QString &name, QQmlPropertyData::Flag
QString handlerName = QLatin1String("on") + name;
handlerName[2] = handlerName.at(2).toUpper();
- setNamedProperty(name, methodIndex + methodOffset(), methodIndexCache.data() + methodIndex, (old != 0));
- setNamedProperty(handlerName, signalHandlerIndex + signalOffset(), signalHandlerIndexCache.data() + signalHandlerIndex, (old != 0));
+ setNamedProperty(name, methodIndex + methodOffset(), methodIndexCache.data() + methodIndex, (old != nullptr));
+ setNamedProperty(handlerName, signalHandlerIndex + signalOffset(), signalHandlerIndexCache.data() + signalHandlerIndex, (old != nullptr));
}
void QQmlPropertyCache::appendMethod(const QString &name, QQmlPropertyData::Flags flags,
@@ -402,7 +402,7 @@ void QQmlPropertyCache::appendMethod(const QString &name, QQmlPropertyData::Flag
int methodIndex = methodIndexCache.count();
methodIndexCache.append(data);
- setNamedProperty(name, methodIndex + methodOffset(), methodIndexCache.data() + methodIndex, (old != 0));
+ setNamedProperty(name, methodIndex + methodOffset(), methodIndexCache.data() + methodIndex, (old != nullptr));
}
void QQmlPropertyCache::appendEnum(const QString &name, const QVector<QQmlEnumValue> &values)
@@ -430,7 +430,7 @@ const QMetaObject *QQmlPropertyCache::createMetaObject()
QQmlPropertyData *QQmlPropertyCache::defaultProperty() const
{
- return property(defaultPropertyName(), 0, 0);
+ return property(defaultPropertyName(), nullptr, nullptr);
}
void QQmlPropertyCache::setParent(QQmlPropertyCache *newParent)
@@ -543,7 +543,7 @@ void QQmlPropertyCache::append(const QMetaObject *metaObject,
}
QQmlPropertyData *data = &methodIndexCache[ii - methodIndexCacheStart];
- QQmlPropertyData *sigdata = 0;
+ QQmlPropertyData *sigdata = nullptr;
if (m.methodType() == QMetaMethod::Signal)
data->setFlags(signalFlags);
@@ -562,24 +562,24 @@ void QQmlPropertyCache::append(const QMetaObject *metaObject,
sigdata->_flags.isSignalHandler = true;
}
- QQmlPropertyData *old = 0;
+ QQmlPropertyData *old = nullptr;
if (utf8) {
QHashedString methodName(QString::fromUtf8(rawName, cptr - rawName));
if (StringCache::mapped_type *it = stringCache.value(methodName))
old = it->second;
- setNamedProperty(methodName, ii, data, (old != 0));
+ setNamedProperty(methodName, ii, data, (old != nullptr));
if (data->isSignal()) {
QHashedString on(QLatin1String("on") % methodName.at(0).toUpper() % methodName.midRef(1));
- setNamedProperty(on, ii, sigdata, (old != 0));
+ setNamedProperty(on, ii, sigdata, (old != nullptr));
++signalHandlerIndex;
}
} else {
QHashedCStringRef methodName(rawName, cptr - rawName);
if (StringCache::mapped_type *it = stringCache.value(methodName))
old = it->second;
- setNamedProperty(methodName, ii, data, (old != 0));
+ setNamedProperty(methodName, ii, data, (old != nullptr));
if (data->isSignal()) {
int length = methodName.length();
@@ -593,7 +593,7 @@ void QQmlPropertyCache::append(const QMetaObject *metaObject,
str[length + 2] = '\0';
QHashedString on(QString::fromLatin1(str.data()));
- setNamedProperty(on, ii, data, (old != 0));
+ setNamedProperty(on, ii, data, (old != nullptr));
++signalHandlerIndex;
}
}
@@ -636,18 +636,18 @@ void QQmlPropertyCache::append(const QMetaObject *metaObject,
Q_ASSERT((allowedRevisionCache.count() - 1) < Q_INT16_MAX);
data->setMetaObjectOffset(allowedRevisionCache.count() - 1);
- QQmlPropertyData *old = 0;
+ QQmlPropertyData *old = nullptr;
if (utf8) {
QHashedString propName(QString::fromUtf8(str, cptr - str));
if (StringCache::mapped_type *it = stringCache.value(propName))
old = it->second;
- setNamedProperty(propName, ii, data, (old != 0));
+ setNamedProperty(propName, ii, data, (old != nullptr));
} else {
QHashedCStringRef propName(str, cptr - str);
if (StringCache::mapped_type *it = stringCache.value(propName))
old = it->second;
- setNamedProperty(propName, ii, data, (old != 0));
+ setNamedProperty(propName, ii, data, (old != nullptr));
}
bool isGadget = true;
@@ -750,7 +750,7 @@ void QQmlPropertyCache::invalidate(const QMetaObject *metaObject)
signalHandlerIndexCache.clear();
_hasPropertyOverrides = false;
- argumentsCache = 0;
+ argumentsCache = nullptr;
int pc = metaObject->propertyCount();
int mc = metaObject->methodCount();
@@ -773,8 +773,8 @@ void QQmlPropertyCache::invalidate(const QMetaObject *metaObject)
QQmlPropertyData *QQmlPropertyCache::findProperty(StringCache::ConstIterator it, QObject *object, QQmlContextData *context) const
{
- QQmlData *data = (object ? QQmlData::get(object) : 0);
- const QQmlVMEMetaObject *vmemo = 0;
+ QQmlData *data = (object ? QQmlData::get(object) : nullptr);
+ const QQmlVMEMetaObject *vmemo = nullptr;
if (data && data->hasVMEMetaObject) {
QObjectPrivate *op = QObjectPrivate::get(object);
vmemo = static_cast<const QQmlVMEMetaObject *>(op->metaObject);
@@ -849,7 +849,7 @@ QQmlPropertyData *QQmlPropertyCache::findProperty(StringCache::ConstIterator it,
return ensureResolved(result);
}
- return 0;
+ return nullptr;
}
QString QQmlPropertyData::name(QObject *object) const
@@ -919,9 +919,9 @@ QQmlPropertyCacheMethodArguments *QQmlPropertyCache::createArgumentsObject(int a
A *args = static_cast<A *>(malloc(sizeof(A) + (argc) * sizeof(int)));
args->arguments[0] = argc;
args->argumentsValid = false;
- args->signalParameterStringForJS = 0;
+ args->signalParameterStringForJS = nullptr;
args->parameterError = false;
- args->names = argc ? new QList<QByteArray>(names) : 0;
+ args->names = argc ? new QList<QByteArray>(names) : nullptr;
args->next = argumentsCache;
argumentsCache = args;
return args;
@@ -1027,10 +1027,10 @@ static QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, c
}
/* If the "cmo" variable didn't change, set it to 0 to
* avoid running into an infinite loop */
- if (!changed) cmo = 0;
+ if (!changed) cmo = nullptr;
}
} else {
- cmo = 0;
+ cmo = nullptr;
}
}
}
@@ -1057,7 +1057,7 @@ QQmlPropertyData *
qQmlPropertyCacheProperty(QJSEngine *engine, QObject *obj, T name,
QQmlContextData *context, QQmlPropertyData &local)
{
- QQmlPropertyCache *cache = 0;
+ QQmlPropertyCache *cache = nullptr;
QQmlData *ddata = QQmlData::get(obj, false);
@@ -1073,7 +1073,7 @@ qQmlPropertyCacheProperty(QJSEngine *engine, QObject *obj, T name,
}
}
- QQmlPropertyData *rv = 0;
+ QQmlPropertyData *rv = nullptr;
if (cache) {
rv = cache->property(name, obj, context);
@@ -1214,7 +1214,7 @@ void QQmlPropertyCache::toMetaObjectBuilder(QMetaObjectBuilder &builder)
// '+=' reserves extra capacity. Follow-up appending will be probably free.
signature += methods.at(ii).first.toUtf8() + '(';
- QQmlPropertyCacheMethodArguments *arguments = 0;
+ QQmlPropertyCacheMethodArguments *arguments = nullptr;
if (data->hasArguments()) {
arguments = (QQmlPropertyCacheMethodArguments *)data->arguments();
Q_ASSERT(arguments->argumentsValid);
@@ -1252,7 +1252,7 @@ void QQmlPropertyCache::toMetaObjectBuilder(QMetaObjectBuilder &builder)
}
if (!_defaultPropertyName.isEmpty()) {
- QQmlPropertyData *dp = property(_defaultPropertyName, 0, 0);
+ QQmlPropertyData *dp = property(_defaultPropertyName, nullptr, nullptr);
if (dp && dp->coreIndex() >= propertyIndexCacheStart) {
Q_ASSERT(!dp->isFunction());
builder.addClassInfo("DefaultProperty", _defaultPropertyName.toUtf8());
@@ -1577,7 +1577,7 @@ void QQmlMetaObject::resolveGadgetMethodOrPropertyIndex(QMetaObject::Call type,
QQmlPropertyCache *QQmlMetaObject::propertyCache(QQmlEnginePrivate *e) const
{
- if (_m.isNull()) return 0;
+ if (_m.isNull()) return nullptr;
if (_m.isT1()) return _m.asT1();
else return e->cache(_m.asT2());
}
@@ -1588,7 +1588,7 @@ int QQmlMetaObject::methodReturnType(const QQmlPropertyData &data, QByteArray *u
int type = data.propType();
- const char *propTypeName = 0;
+ const char *propTypeName = nullptr;
if (type == QMetaType::UnknownType) {
// Find the return type name from the method info
@@ -1676,7 +1676,7 @@ int *QQmlMetaObject::methodParameterTypes(int index, ArgTypeStorage *argStorage,
}
if (type == QMetaType::UnknownType) {
if (unknownTypeError) *unknownTypeError = argTypeNames.at(ii);
- return 0;
+ return nullptr;
}
args->arguments[ii + 1] = type;
}
@@ -1715,7 +1715,7 @@ int *QQmlMetaObject::methodParameterTypes(const QMetaMethod &m, ArgTypeStorage *
}
if (type == QMetaType::UnknownType) {
if (unknownTypeError) *unknownTypeError = argTypeNames.at(ii);
- return 0;
+ return nullptr;
}
argStorage->operator[](ii + 1) = type;
}
@@ -1727,7 +1727,7 @@ void QQmlObjectOrGadget::metacall(QMetaObject::Call type, int index, void **argv
{
if (ptr.isNull()) {
const QMetaObject *metaObject = _m.asT2();
- metaObject->d.static_metacall(0, type, index, argv);
+ metaObject->d.static_metacall(nullptr, type, index, argv);
}
else if (ptr.isT1()) {
QMetaObject::metacall(ptr.asT1(), type, index, argv);
diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h
index 11b7c04c52..22be6ba60c 100644
--- a/src/qml/qml/qqmlpropertycache_p.h
+++ b/src/qml/qml/qqmlpropertycache_p.h
@@ -323,7 +323,7 @@ public:
inline void readProperty(QObject *target, void *property) const
{
- void *args[] = { property, 0 };
+ void *args[] = { property, nullptr };
readPropertyWithArgs(target, args);
}
@@ -340,7 +340,7 @@ public:
bool writeProperty(QObject *target, void *value, WriteFlags flags) const
{
int status = -1;
- void *argv[] = { value, 0, &status, &flags };
+ void *argv[] = { value, nullptr, &status, &flags };
if (flags.testFlag(BypassInterceptor) && hasStaticMetaCallFunction())
staticMetaCallFunction()(target, QMetaObject::WriteProperty, relativePropertyIndex(), argv);
else if (flags.testFlag(BypassInterceptor) && isDirect())
@@ -417,7 +417,7 @@ public:
void appendProperty(const QString &, QQmlPropertyRawData::Flags flags, int coreIndex,
int propType, int revision, int notifyIndex);
void appendSignal(const QString &, QQmlPropertyRawData::Flags, int coreIndex,
- const int *types = 0, const QList<QByteArray> &names = QList<QByteArray>());
+ const int *types = nullptr, const QList<QByteArray> &names = QList<QByteArray>());
void appendMethod(const QString &, QQmlPropertyData::Flags flags, int coreIndex,
const QList<QByteArray> &names = QList<QByteArray>());
void appendEnum(const QString &, const QVector<QQmlEnumValue> &);
@@ -465,7 +465,7 @@ public:
static int originalClone(QObject *, int index);
QList<QByteArray> signalParameterNames(int index) const;
- static QString signalParameterStringForJS(QV4::ExecutionEngine *engine, const QList<QByteArray> &parameterNameList, QString *errorString = 0);
+ static QString signalParameterStringForJS(QV4::ExecutionEngine *engine, const QList<QByteArray> &parameterNameList, QString *errorString = nullptr);
const char *className() const;
@@ -739,7 +739,7 @@ inline const QMetaObject *QQmlPropertyCache::metaObject() const
// QML
inline const QMetaObject *QQmlPropertyCache::firstCppMetaObject() const
{
- while (_parent && (_metaObject == 0 || _ownMetaObject))
+ while (_parent && (_metaObject == nullptr || _ownMetaObject))
return _parent->firstCppMetaObject();
return _metaObject;
}
@@ -747,7 +747,7 @@ inline const QMetaObject *QQmlPropertyCache::firstCppMetaObject() const
inline QQmlPropertyData *QQmlPropertyCache::property(int index) const
{
if (index < 0 || index >= (propertyIndexCacheStart + propertyIndexCache.count()))
- return 0;
+ return nullptr;
if (index < propertyIndexCacheStart)
return _parent->property(index);
@@ -759,7 +759,7 @@ inline QQmlPropertyData *QQmlPropertyCache::property(int index) const
inline QQmlPropertyData *QQmlPropertyCache::method(int index) const
{
if (index < 0 || index >= (methodIndexCacheStart + methodIndexCache.count()))
- return 0;
+ return nullptr;
if (index < methodIndexCacheStart)
return _parent->method(index);
@@ -775,7 +775,7 @@ inline QQmlPropertyData *QQmlPropertyCache::method(int index) const
inline QQmlPropertyData *QQmlPropertyCache::signal(int index) const
{
if (index < 0 || index >= (signalHandlerIndexCacheStart + signalHandlerIndexCache.count()))
- return 0;
+ return nullptr;
if (index < signalHandlerIndexCacheStart)
return _parent->signal(index);
@@ -788,7 +788,7 @@ inline QQmlPropertyData *QQmlPropertyCache::signal(int index) const
inline QQmlEnumData *QQmlPropertyCache::qmlEnum(int index) const
{
if (index < 0 || index >= enumCache.count())
- return 0;
+ return nullptr;
return const_cast<QQmlEnumData *>(&enumCache.at(index));
}
@@ -819,7 +819,7 @@ QQmlPropertyData *
QQmlPropertyCache::overrideData(QQmlPropertyData *data) const
{
if (!data->hasOverride())
- return 0;
+ return nullptr;
if (data->overrideIndexIsProperty())
return property(data->overrideIndex());
@@ -921,7 +921,7 @@ bool QQmlMetaObject::isNull() const
const char *QQmlMetaObject::className() const
{
if (_m.isNull()) {
- return 0;
+ return nullptr;
} else if (_m.isT1()) {
return _m.asT1()->className();
} else {
@@ -947,7 +947,7 @@ bool QQmlMetaObject::hasMetaObject() const
const QMetaObject *QQmlMetaObject::metaObject() const
{
- if (_m.isNull()) return 0;
+ if (_m.isNull()) return nullptr;
if (_m.isT1()) return _m.asT1()->createMetaObject();
else return _m.asT2();
}
diff --git a/src/qml/qml/qqmlpropertyvalueinterceptor.cpp b/src/qml/qml/qqmlpropertyvalueinterceptor.cpp
index 52c003ab59..603245f29d 100644
--- a/src/qml/qml/qqmlpropertyvalueinterceptor.cpp
+++ b/src/qml/qml/qqmlpropertyvalueinterceptor.cpp
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
/*!
Constructs a QQmlPropertyValueInterceptor.
*/
-QQmlPropertyValueInterceptor::QQmlPropertyValueInterceptor() : m_next(0)
+QQmlPropertyValueInterceptor::QQmlPropertyValueInterceptor() : m_next(nullptr)
{
}
diff --git a/src/qml/qml/qqmlproxymetaobject.cpp b/src/qml/qml/qqmlproxymetaobject.cpp
index 27e3c13ff8..e1500f70fb 100644
--- a/src/qml/qml/qqmlproxymetaobject.cpp
+++ b/src/qml/qml/qqmlproxymetaobject.cpp
@@ -43,7 +43,7 @@
QT_BEGIN_NAMESPACE
QQmlProxyMetaObject::QQmlProxyMetaObject(QObject *obj, QList<ProxyData> *mList)
-: metaObjects(mList), proxies(0), parent(0), object(obj)
+: metaObjects(mList), proxies(nullptr), parent(nullptr), object(obj)
{
*static_cast<QMetaObject *>(this) = *metaObjects->constFirst().metaObject;
@@ -58,11 +58,11 @@ QQmlProxyMetaObject::~QQmlProxyMetaObject()
{
if (parent)
delete parent;
- parent = 0;
+ parent = nullptr;
if (proxies)
delete [] proxies;
- proxies = 0;
+ proxies = nullptr;
}
int QQmlProxyMetaObject::metaCall(QObject *o, QMetaObject::Call c, int id, void **a)
diff --git a/src/qml/qml/qqmlscriptstring_p.h b/src/qml/qml/qqmlscriptstring_p.h
index 2dfb817186..fd8ccd5d53 100644
--- a/src/qml/qml/qqmlscriptstring_p.h
+++ b/src/qml/qml/qqmlscriptstring_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
class Q_AUTOTEST_EXPORT QQmlScriptStringPrivate : public QSharedData
{
public:
- QQmlScriptStringPrivate() : context(0), scope(0), bindingId(-1), lineNumber(0), columnNumber(0),
+ QQmlScriptStringPrivate() : context(nullptr), scope(nullptr), bindingId(-1), lineNumber(0), columnNumber(0),
numberValue(0), isStringLiteral(false), isNumberLiteral(false) {}
//for testing
diff --git a/src/qml/qml/qqmlstringconverters_p.h b/src/qml/qml/qqmlstringconverters_p.h
index af344e3344..215f0c0aaf 100644
--- a/src/qml/qml/qqmlstringconverters_p.h
+++ b/src/qml/qml/qqmlstringconverters_p.h
@@ -67,19 +67,19 @@ class QByteArray;
namespace QQmlStringConverters
{
Q_QML_PRIVATE_EXPORT QVariant variantFromString(const QString &);
- Q_QML_PRIVATE_EXPORT QVariant variantFromString(const QString &, int preferredType, bool *ok = 0);
+ Q_QML_PRIVATE_EXPORT QVariant variantFromString(const QString &, int preferredType, bool *ok = nullptr);
- Q_QML_PRIVATE_EXPORT QVariant colorFromString(const QString &, bool *ok = 0);
- Q_QML_PRIVATE_EXPORT unsigned rgbaFromString(const QString &, bool *ok = 0);
+ Q_QML_PRIVATE_EXPORT QVariant colorFromString(const QString &, bool *ok = nullptr);
+ Q_QML_PRIVATE_EXPORT unsigned rgbaFromString(const QString &, bool *ok = nullptr);
#if QT_CONFIG(datestring)
- Q_QML_PRIVATE_EXPORT QDate dateFromString(const QString &, bool *ok = 0);
- Q_QML_PRIVATE_EXPORT QTime timeFromString(const QString &, bool *ok = 0);
- Q_QML_PRIVATE_EXPORT QDateTime dateTimeFromString(const QString &, bool *ok = 0);
+ Q_QML_PRIVATE_EXPORT QDate dateFromString(const QString &, bool *ok = nullptr);
+ Q_QML_PRIVATE_EXPORT QTime timeFromString(const QString &, bool *ok = nullptr);
+ Q_QML_PRIVATE_EXPORT QDateTime dateTimeFromString(const QString &, bool *ok = nullptr);
#endif
- Q_QML_PRIVATE_EXPORT QPointF pointFFromString(const QString &, bool *ok = 0);
- Q_QML_PRIVATE_EXPORT QSizeF sizeFFromString(const QString &, bool *ok = 0);
- Q_QML_PRIVATE_EXPORT QRectF rectFFromString(const QString &, bool *ok = 0);
+ Q_QML_PRIVATE_EXPORT QPointF pointFFromString(const QString &, bool *ok = nullptr);
+ Q_QML_PRIVATE_EXPORT QSizeF sizeFFromString(const QString &, bool *ok = nullptr);
+ Q_QML_PRIVATE_EXPORT QRectF rectFFromString(const QString &, bool *ok = nullptr);
Q_QML_PRIVATE_EXPORT bool createFromString(int, const QString &, void *, size_t);
}
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index e5682df761..ed1526c0a9 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -550,7 +550,7 @@ void QQmlDataBlob::networkError(QNetworkReply::NetworkError networkError)
QQmlError error;
error.setUrl(m_url);
- const char *errorString = 0;
+ const char *errorString = nullptr;
switch (networkError) {
default:
errorString = "Network error";
@@ -791,7 +791,7 @@ void QQmlDataBlob::ThreadData::setProgress(quint8 v)
QQmlTypeLoaderThread::QQmlTypeLoaderThread(QQmlTypeLoader *loader)
: m_loader(loader)
#if QT_CONFIG(qml_network)
-, m_networkAccessManager(0), m_networkReplyProxy(0)
+, m_networkAccessManager(nullptr), m_networkReplyProxy(nullptr)
#endif // qml_network
{
// Do that after initializing all the members.
@@ -803,7 +803,7 @@ QNetworkAccessManager *QQmlTypeLoaderThread::networkAccessManager() const
{
Q_ASSERT(isThisThread());
if (!m_networkAccessManager) {
- m_networkAccessManager = QQmlEnginePrivate::get(m_loader->engine())->createNetworkAccessManager(0);
+ m_networkAccessManager = QQmlEnginePrivate::get(m_loader->engine())->createNetworkAccessManager(nullptr);
m_networkReplyProxy = new QQmlTypeLoaderNetworkReplyProxy(m_loader);
}
@@ -876,9 +876,9 @@ void QQmlTypeLoaderThread::shutdownThread()
{
#if QT_CONFIG(qml_network)
delete m_networkAccessManager;
- m_networkAccessManager = 0;
+ m_networkAccessManager = nullptr;
delete m_networkReplyProxy;
- m_networkReplyProxy = 0;
+ m_networkReplyProxy = nullptr;
#endif // qml_network
}
@@ -962,7 +962,7 @@ void QQmlTypeLoader::invalidate()
if (m_thread) {
shutdownThread();
delete m_thread;
- m_thread = 0;
+ m_thread = nullptr;
}
#if QT_CONFIG(qml_network)
@@ -1535,7 +1535,7 @@ void QQmlTypeLoader::Blob::dependencyComplete(QQmlDataBlob *blob)
bool QQmlTypeLoader::Blob::isDebugging() const
{
- return typeLoader()->engine()->handle()->debugger() != 0;
+ return typeLoader()->engine()->handle()->debugger() != nullptr;
}
bool QQmlTypeLoader::Blob::qmldirDataAvailable(QQmlQmldirData *data, QList<QQmlError> *errors)
@@ -1543,7 +1543,7 @@ bool QQmlTypeLoader::Blob::qmldirDataAvailable(QQmlQmldirData *data, QList<QQmlE
bool resolve = true;
const QV4::CompiledData::Import *import = data->import(this);
- data->setImport(this, 0);
+ data->setImport(this, nullptr);
int priority = data->priority(this);
data->setPriority(this, 0);
@@ -1818,7 +1818,7 @@ QString QQmlTypeLoader::absoluteFilePath(const QString &path)
if (!m_importDirCache.contains(dirPath)) {
bool exists = QDir(dirPath).exists();
- QCache<QString, bool> *entry = exists ? new QCache<QString, bool> : 0;
+ QCache<QString, bool> *entry = exists ? new QCache<QString, bool> : nullptr;
m_importDirCache.insert(dirPath, entry);
}
QCache<QString, bool> *fileSet = m_importDirCache.object(dirPath);
@@ -1881,12 +1881,12 @@ bool QQmlTypeLoader::directoryExists(const QString &path)
if (!m_importDirCache.contains(dirPath)) {
bool exists = QDir(dirPath).exists();
- QCache<QString, bool> *files = exists ? new QCache<QString, bool> : 0;
+ QCache<QString, bool> *files = exists ? new QCache<QString, bool> : nullptr;
m_importDirCache.insert(dirPath, files);
}
QCache<QString, bool> *fileSet = m_importDirCache.object(dirPath);
- return fileSet != 0;
+ return fileSet != nullptr;
}
@@ -2764,7 +2764,7 @@ bool QQmlTypeData::resolveType(const QString &typeName, int &majorVersion, int &
TypeReference &ref, int lineNumber, int columnNumber,
bool reportErrors, QQmlType::RegistrationType registrationType)
{
- QQmlImportNamespace *typeNamespace = 0;
+ QQmlImportNamespace *typeNamespace = nullptr;
QList<QQmlError> errors;
bool typeFound = m_importCache.resolveType(typeName, &ref.type, &majorVersion, &minorVersion,
@@ -2824,9 +2824,9 @@ void QQmlTypeData::scriptImported(QQmlScriptBlob *blob, const QV4::CompiledData:
}
QQmlScriptData::QQmlScriptData()
- : typeNameCache(0)
+ : typeNameCache(nullptr)
, m_loaded(false)
- , m_program(0)
+ , m_program(nullptr)
{
}
@@ -2843,7 +2843,7 @@ void QQmlScriptData::initialize(QQmlEngine *engine)
QV4::ExecutionEngine *v4 = engine->handle();
- m_program = new QV4::Script(v4, 0, m_precompiledScript);
+ m_program = new QV4::Script(v4, nullptr, m_precompiledScript);
addToEngine(engine);
@@ -2864,7 +2864,7 @@ QV4::ReturnedValue QQmlScriptData::scriptValueForContext(QQmlContextData *parent
QQmlContextData *effectiveCtxt = parentCtxt;
if (shared)
- effectiveCtxt = 0;
+ effectiveCtxt = nullptr;
// Create the script context if required
QQmlContextDataRef ctxt(new QQmlContextData);
@@ -2912,7 +2912,7 @@ QV4::ReturnedValue QQmlScriptData::scriptValueForContext(QQmlContextData *parent
return QV4::Encode::undefined();
}
- QV4::Scoped<QV4::QmlContext> qmlContext(scope, QV4::QmlContext::create(v4->rootContext(), ctxt, 0));
+ QV4::Scoped<QV4::QmlContext> qmlContext(scope, QV4::QmlContext::create(v4->rootContext(), ctxt, nullptr));
m_program->qmlContext.set(scope.engine, qmlContext);
m_program->run();
@@ -2936,7 +2936,7 @@ void QQmlScriptData::clear()
{
if (typeNameCache) {
typeNameCache->release();
- typeNameCache = 0;
+ typeNameCache = nullptr;
}
for (int ii = 0; ii < scripts.count(); ++ii)
@@ -2948,7 +2948,7 @@ void QQmlScriptData::clear()
}
QQmlScriptBlob::QQmlScriptBlob(const QUrl &url, QQmlTypeLoader *loader)
-: QQmlTypeLoader::Blob(url, JavaScriptFile, loader), m_scriptData(0)
+: QQmlTypeLoader::Blob(url, JavaScriptFile, loader), m_scriptData(nullptr)
{
}
@@ -2956,7 +2956,7 @@ QQmlScriptBlob::~QQmlScriptBlob()
{
if (m_scriptData) {
m_scriptData->release();
- m_scriptData = 0;
+ m_scriptData = nullptr;
}
}
@@ -3135,7 +3135,7 @@ const QV4::CompiledData::Import *QQmlQmldirData::import(QQmlTypeLoader::Blob *bl
QHash<QQmlTypeLoader::Blob *, const QV4::CompiledData::Import *>::const_iterator it =
m_imports.find(blob);
if (it == m_imports.end())
- return 0;
+ return nullptr;
return *it;
}
diff --git a/src/qml/qml/qqmltypeloader_p.h b/src/qml/qml/qqmltypeloader_p.h
index 875c335c9a..f2327e9a5f 100644
--- a/src/qml/qml/qqmltypeloader_p.h
+++ b/src/qml/qml/qqmltypeloader_p.h
@@ -411,7 +411,7 @@ class Q_AUTOTEST_EXPORT QQmlTypeData : public QQmlTypeLoader::Blob
public:
struct TypeReference
{
- TypeReference() : majorVersion(0), minorVersion(0), typeData(0), needsCreation(true) {}
+ TypeReference() : majorVersion(0), minorVersion(0), typeData(nullptr), needsCreation(true) {}
QV4::CompiledData::Location location;
QQmlType type;
@@ -425,7 +425,7 @@ public:
struct ScriptReference
{
- ScriptReference() : script(0) {}
+ ScriptReference() : script(nullptr) {}
QV4::CompiledData::Location location;
QString qualifier;
@@ -558,7 +558,7 @@ public:
struct ScriptReference
{
- ScriptReference() : script(0) {}
+ ScriptReference() : script(nullptr) {}
QV4::CompiledData::Location location;
QString qualifier;
diff --git a/src/qml/qml/qqmltypenamecache.cpp b/src/qml/qml/qqmltypenamecache.cpp
index 32b0fa16c4..8f1a61e6ad 100644
--- a/src/qml/qml/qqmltypenamecache.cpp
+++ b/src/qml/qml/qqmltypenamecache.cpp
@@ -56,7 +56,7 @@ void QQmlTypeNameCache::add(const QHashedString &name, const QUrl &url, const QH
{
if (nameSpace.length() != 0) {
QQmlImportRef *i = m_namedImports.value(nameSpace);
- Q_ASSERT(i != 0);
+ Q_ASSERT(i != nullptr);
i->compositeSingletons.insert(name, url);
return;
}
@@ -75,7 +75,7 @@ void QQmlTypeNameCache::add(const QHashedString &name, int importedScriptIndex,
if (nameSpace.length() != 0) {
QQmlImportRef *i = m_namedImports.value(nameSpace);
- Q_ASSERT(i != 0);
+ Q_ASSERT(i != nullptr);
m_namespacedImports[i].insert(name, import);
return;
}
@@ -98,10 +98,10 @@ QQmlTypeNameCache::Result QQmlTypeNameCache::query(const QHashedStringRef &name)
if (!result.isValid()) {
// Look up anonymous types from the imports of this document
- QQmlImportNamespace *typeNamespace = 0;
+ QQmlImportNamespace *typeNamespace = nullptr;
QList<QQmlError> errors;
QQmlType t;
- bool typeFound = m_imports.resolveType(name, &t, 0, 0, &typeNamespace, &errors);
+ bool typeFound = m_imports.resolveType(name, &t, nullptr, nullptr, &typeNamespace, &errors);
if (typeFound) {
return Result(t);
}
@@ -126,10 +126,10 @@ QQmlTypeNameCache::Result QQmlTypeNameCache::query(const QHashedStringRef &name,
// ### it would be nice if QQmlImports allowed us to resolve a namespace
// first, and then types on it.
QString qualifiedTypeName = importNamespace->m_qualifier + QLatin1Char('.') + name.toString();
- QQmlImportNamespace *typeNamespace = 0;
+ QQmlImportNamespace *typeNamespace = nullptr;
QList<QQmlError> errors;
QQmlType t;
- bool typeFound = m_imports.resolveType(qualifiedTypeName, &t, 0, 0, &typeNamespace, &errors);
+ bool typeFound = m_imports.resolveType(qualifiedTypeName, &t, nullptr, nullptr, &typeNamespace, &errors);
if (typeFound) {
return Result(t);
}
@@ -151,10 +151,10 @@ QQmlTypeNameCache::Result QQmlTypeNameCache::query(const QV4::String *name, QQml
if (!result.isValid()) {
// Look up anonymous types from the imports of this document
QString typeName = name->toQStringNoThrow();
- QQmlImportNamespace *typeNamespace = 0;
+ QQmlImportNamespace *typeNamespace = nullptr;
QList<QQmlError> errors;
QQmlType t;
- bool typeFound = m_imports.resolveType(typeName, &t, 0, 0, &typeNamespace, &errors,
+ bool typeFound = m_imports.resolveType(typeName, &t, nullptr, nullptr, &typeNamespace, &errors,
QQmlType::AnyRegistrationType, recursionRestriction);
if (typeFound) {
return Result(t);
@@ -186,10 +186,10 @@ QQmlTypeNameCache::Result QQmlTypeNameCache::query(const QV4::String *name, cons
// ### it would be nice if QQmlImports allowed us to resolve a namespace
// first, and then types on it.
QString qualifiedTypeName = importNamespace->m_qualifier + QLatin1Char('.') + name->toQStringNoThrow();
- QQmlImportNamespace *typeNamespace = 0;
+ QQmlImportNamespace *typeNamespace = nullptr;
QList<QQmlError> errors;
QQmlType t;
- bool typeFound = m_imports.resolveType(qualifiedTypeName, &t, 0, 0, &typeNamespace, &errors);
+ bool typeFound = m_imports.resolveType(qualifiedTypeName, &t, nullptr, nullptr, &typeNamespace, &errors);
if (typeFound) {
return Result(t);
}
diff --git a/src/qml/qml/qqmltypenamecache_p.h b/src/qml/qml/qqmltypenamecache_p.h
index 8ac25c4fbe..c2f7a70d03 100644
--- a/src/qml/qml/qqmltypenamecache_p.h
+++ b/src/qml/qml/qqmltypenamecache_p.h
@@ -162,7 +162,7 @@ private:
};
QQmlTypeNameCache::Result::Result()
-: importNamespace(0), scriptIndex(-1)
+: importNamespace(nullptr), scriptIndex(-1)
{
}
@@ -172,12 +172,12 @@ QQmlTypeNameCache::Result::Result(const QQmlImportRef *importNamespace)
}
QQmlTypeNameCache::Result::Result(const QQmlType &type)
-: type(type), importNamespace(0), scriptIndex(-1)
+: type(type), importNamespace(nullptr), scriptIndex(-1)
{
}
QQmlTypeNameCache::Result::Result(int scriptIndex)
-: importNamespace(0), scriptIndex(scriptIndex)
+: importNamespace(nullptr), scriptIndex(scriptIndex)
{
}
diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp
index 8e067932bb..6dbf6ad8c1 100644
--- a/src/qml/qml/qqmltypewrapper.cpp
+++ b/src/qml/qml/qqmltypewrapper.cpp
@@ -85,7 +85,7 @@ bool QQmlTypeWrapper::isSingleton() const
QObject* QQmlTypeWrapper::singletonObject() const
{
if (!isSingleton())
- return 0;
+ return nullptr;
QQmlEngine *e = engine()->qmlEngine();
QQmlType::SingletonInstanceInfo *siinfo = d()->type().singletonInstanceInfo();
diff --git a/src/qml/qml/qqmlvaluetype.cpp b/src/qml/qml/qqmlvaluetype.cpp
index 520f512b1a..270414a676 100644
--- a/src/qml/qml/qqmlvaluetype.cpp
+++ b/src/qml/qml/qqmlvaluetype.cpp
@@ -68,7 +68,7 @@ struct QQmlValueTypeFactoryImpl
QQmlValueTypeFactoryImpl::QQmlValueTypeFactoryImpl()
{
for (unsigned int ii = 0; ii < QVariant::UserType; ++ii)
- valueTypes[ii] = 0;
+ valueTypes[ii] = nullptr;
// See types wrapped in qqmlmodelindexvaluetype_p.h
qRegisterMetaType<QItemSelectionRange>();
@@ -83,7 +83,7 @@ QQmlValueTypeFactoryImpl::~QQmlValueTypeFactoryImpl()
bool QQmlValueTypeFactoryImpl::isValueType(int idx)
{
if (idx >= (int)QVariant::UserType) {
- return (valueType(idx) != 0);
+ return (valueType(idx) != nullptr);
} else if (idx >= 0
&& idx != QVariant::StringList
&& idx != QMetaType::QObjectStar
@@ -130,7 +130,7 @@ const QMetaObject *QQmlValueTypeFactoryImpl::metaObjectForMetaType(int t)
QMetaType metaType(t);
if (metaType.flags() & QMetaType::IsGadget)
return metaType.metaObject();
- return 0;
+ return nullptr;
}
QQmlValueType *QQmlValueTypeFactoryImpl::valueType(int idx)
@@ -141,7 +141,7 @@ QQmlValueType *QQmlValueTypeFactoryImpl::valueType(int idx)
QHash<int, QQmlValueType *>::iterator it = userTypes.find(idx);
if (it == userTypes.end()) {
- QQmlValueType *vt = 0;
+ QQmlValueType *vt = nullptr;
if (const QMetaObject *mo = metaObjectForMetaType(idx))
vt = new QQmlValueType(idx, mo);
it = userTypes.insert(idx, vt);
@@ -209,14 +209,14 @@ QQmlValueType::~QQmlValueType()
{
QObjectPrivate *op = QObjectPrivate::get(this);
Q_ASSERT(op->metaObject == this);
- op->metaObject = 0;
+ op->metaObject = nullptr;
::free(const_cast<QMetaObject *>(_metaObject));
metaType.destroy(gadgetPtr);
}
void QQmlValueType::read(QObject *obj, int idx)
{
- void *a[] = { gadgetPtr, 0 };
+ void *a[] = { gadgetPtr, nullptr };
QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
}
@@ -224,7 +224,7 @@ void QQmlValueType::write(QObject *obj, int idx, QQmlPropertyData::WriteFlags fl
{
Q_ASSERT(gadgetPtr);
int status = -1;
- void *a[] = { gadgetPtr, 0, &status, &flags };
+ void *a[] = { gadgetPtr, nullptr, &status, &flags };
QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
}
diff --git a/src/qml/qml/qqmlvaluetype_p.h b/src/qml/qml/qqmlvaluetype_p.h
index 0502a5d665..7d8473db0e 100644
--- a/src/qml/qml/qqmlvaluetype_p.h
+++ b/src/qml/qml/qqmlvaluetype_p.h
@@ -272,19 +272,19 @@ int qmlRegisterValueTypeEnums(const char *uri, int versionMajor, int versionMino
QQmlPrivate::RegisterType type = {
0,
- qRegisterNormalizedMetaType<T *>(pointerName.constData()), 0, 0, 0,
+ qRegisterNormalizedMetaType<T *>(pointerName.constData()), 0, 0, nullptr,
QString(),
uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
- 0, 0,
+ nullptr, nullptr,
0, 0, 0,
- 0, 0,
+ nullptr, nullptr,
- 0,
+ nullptr,
0
};
diff --git a/src/qml/qml/qqmlvaluetypeproxybinding.cpp b/src/qml/qml/qqmlvaluetypeproxybinding.cpp
index 7a3e4b2df4..d5cff26444 100644
--- a/src/qml/qml/qqmlvaluetypeproxybinding.cpp
+++ b/src/qml/qml/qqmlvaluetypeproxybinding.cpp
@@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE
QQmlValueTypeProxyBinding::QQmlValueTypeProxyBinding(QObject *o, QQmlPropertyIndex index)
: QQmlAbstractBinding(),
- m_bindings(0)
+ m_bindings(nullptr)
{
m_target = o;
m_targetIndex = index;
@@ -93,7 +93,7 @@ Removes a collection of bindings, corresponding to the set bits in \a mask.
void QQmlValueTypeProxyBinding::removeBindings(quint32 mask)
{
QQmlAbstractBinding *binding = m_bindings.data();
- QQmlAbstractBinding *lastBinding = 0;
+ QQmlAbstractBinding *lastBinding = nullptr;
while (binding) {
const int valueTypeIndex = binding->targetPropertyIndex().valueTypeIndex();
@@ -102,7 +102,7 @@ void QQmlValueTypeProxyBinding::removeBindings(quint32 mask)
remove->setAddedToObject(false);
binding = remove->nextBinding();
- if (lastBinding == 0)
+ if (lastBinding == nullptr)
m_bindings = remove->nextBinding();
else
lastBinding->setNextBinding(remove->nextBinding());
diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp
index c643beeadc..a28115d192 100644
--- a/src/qml/qml/qqmlvaluetypewrapper.cpp
+++ b/src/qml/qml/qqmlvaluetypewrapper.cpp
@@ -131,7 +131,7 @@ bool QQmlValueTypeReference::readReferenceValue() const
// variant-containing-value-type reference
QVariant variantReferenceValue;
- void *a[] = { &variantReferenceValue, 0 };
+ void *a[] = { &variantReferenceValue, nullptr };
QMetaObject::metacall(d()->object, QMetaObject::ReadProperty, d()->property, a);
int variantReferenceType = variantReferenceValue.userType();
@@ -141,14 +141,14 @@ bool QQmlValueTypeReference::readReferenceValue() const
// We need to modify this reference to the updated value type, if
// possible, or return false if it is not a value type.
if (QQmlValueTypeFactory::isValueType(variantReferenceType)) {
- QQmlPropertyCache *cache = 0;
+ QQmlPropertyCache *cache = nullptr;
if (const QMetaObject *mo = QQmlValueTypeFactory::metaObjectForMetaType(variantReferenceType))
cache = QJSEnginePrivate::get(engine())->cache(mo);
if (d()->gadgetPtr) {
d()->valueType->metaType.destruct(d()->gadgetPtr);
::operator delete(d()->gadgetPtr);
}
- d()->gadgetPtr =0;
+ d()->gadgetPtr =nullptr;
d()->setPropertyCache(cache);
d()->valueType = QQmlValueTypeFactory::valueType(variantReferenceType);
if (!cache)
@@ -161,10 +161,10 @@ bool QQmlValueTypeReference::readReferenceValue() const
} else {
if (!d()->gadgetPtr) {
d()->gadgetPtr = ::operator new(d()->valueType->metaType.sizeOf());
- d()->valueType->metaType.construct(d()->gadgetPtr, 0);
+ d()->valueType->metaType.construct(d()->gadgetPtr, nullptr);
}
// value-type reference
- void *args[] = { d()->gadgetPtr, 0 };
+ void *args[] = { d()->gadgetPtr, nullptr };
QMetaObject::metacall(d()->object, QMetaObject::ReadProperty, d()->property, args);
}
return true;
@@ -191,7 +191,7 @@ ReturnedValue QQmlValueTypeWrapper::create(ExecutionEngine *engine, QObject *obj
r->d()->property = property;
r->d()->setPropertyCache(QJSEnginePrivate::get(engine)->cache(metaObject));
r->d()->valueType = QQmlValueTypeFactory::valueType(typeId);
- r->d()->gadgetPtr = 0;
+ r->d()->gadgetPtr = nullptr;
return r->asReturnedValue();
}
@@ -203,7 +203,7 @@ ReturnedValue QQmlValueTypeWrapper::create(ExecutionEngine *engine, const QVaria
Scoped<QQmlValueTypeWrapper> r(scope, engine->memoryManager->allocObject<QQmlValueTypeWrapper>());
r->d()->setPropertyCache(QJSEnginePrivate::get(engine)->cache(metaObject));
r->d()->valueType = QQmlValueTypeFactory::valueType(typeId);
- r->d()->gadgetPtr = 0;
+ r->d()->gadgetPtr = nullptr;
r->d()->setValue(value);
return r->asReturnedValue();
}
@@ -246,13 +246,13 @@ PropertyAttributes QQmlValueTypeWrapper::query(const Managed *m, String *name)
Q_ASSERT(m->as<const QQmlValueTypeWrapper>());
const QQmlValueTypeWrapper *r = static_cast<const QQmlValueTypeWrapper *>(m);
- QQmlPropertyData *result = r->d()->propertyCache()->property(name, 0, 0);
+ QQmlPropertyData *result = r->d()->propertyCache()->property(name, nullptr, nullptr);
return result ? Attr_Data : Attr_Invalid;
}
void QQmlValueTypeWrapper::advanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes)
{
- name->setM(0);
+ name->setM(nullptr);
*index = UINT_MAX;
QQmlValueTypeWrapper *that = static_cast<QQmlValueTypeWrapper*>(m);
@@ -299,7 +299,7 @@ bool QQmlValueTypeWrapper::write(QObject *target, int propertyIndex) const
if (!d()->gadgetPtr) {
Q_ALLOCA_ASSIGN(void, gadget, d()->valueType->metaType.sizeOf());
d()->gadgetPtr = gadget;
- d()->valueType->metaType.construct(d()->gadgetPtr, 0);
+ d()->valueType->metaType.construct(d()->gadgetPtr, nullptr);
destructGadgetOnExit = true;
}
if (!ref->readReferenceValue())
@@ -308,12 +308,12 @@ bool QQmlValueTypeWrapper::write(QObject *target, int propertyIndex) const
int flags = 0;
int status = -1;
- void *a[] = { d()->gadgetPtr, 0, &status, &flags };
+ void *a[] = { d()->gadgetPtr, nullptr, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty, propertyIndex, a);
if (destructGadgetOnExit) {
d()->valueType->metaType.destruct(d()->gadgetPtr);
- d()->gadgetPtr = 0;
+ d()->gadgetPtr = nullptr;
}
return true;
}
@@ -367,7 +367,7 @@ ReturnedValue QQmlValueTypeWrapper::get(const Managed *m, String *name, bool *ha
return Primitive::undefinedValue().asReturnedValue();
}
- QQmlPropertyData *result = r->d()->propertyCache()->property(name, 0, 0);
+ QQmlPropertyData *result = r->d()->propertyCache()->property(name, nullptr, nullptr);
if (!result)
return Object::get(m, name, hasProperty);
@@ -436,7 +436,7 @@ bool QQmlValueTypeWrapper::put(Managed *m, String *name, const Value &value)
}
const QMetaObject *metaObject = r->d()->propertyCache()->metaObject();
- const QQmlPropertyData *pd = r->d()->propertyCache()->property(name, 0, 0);
+ const QQmlPropertyData *pd = r->d()->propertyCache()->property(name, nullptr, nullptr);
if (!pd)
return false;
@@ -505,13 +505,13 @@ bool QQmlValueTypeWrapper::put(Managed *m, String *name, const Value &value)
int flags = 0;
int status = -1;
- void *a[] = { &variantReferenceValue, 0, &status, &flags };
+ void *a[] = { &variantReferenceValue, nullptr, &status, &flags };
QMetaObject::metacall(reference->d()->object, QMetaObject::WriteProperty, reference->d()->property, a);
} else {
int flags = 0;
int status = -1;
- void *a[] = { r->d()->gadgetPtr, 0, &status, &flags };
+ void *a[] = { r->d()->gadgetPtr, nullptr, &status, &flags };
QMetaObject::metacall(reference->d()->object, QMetaObject::WriteProperty, reference->d()->property, a);
}
}
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp
index 72d4ab7e8f..018769948d 100644
--- a/src/qml/qml/qqmlvme.cpp
+++ b/src/qml/qml/qqmlvme.cpp
@@ -96,7 +96,7 @@ bool QQmlVME::componentCompleteEnabled()
}
QQmlVMEGuard::QQmlVMEGuard()
-: m_objectCount(0), m_objects(0), m_contextCount(0), m_contexts(0)
+: m_objectCount(0), m_objects(nullptr), m_contextCount(0), m_contexts(nullptr)
{
}
@@ -126,9 +126,9 @@ void QQmlVMEGuard::clear()
delete [] m_contexts;
m_objectCount = 0;
- m_objects = 0;
+ m_objects = nullptr;
m_contextCount = 0;
- m_contexts = 0;
+ m_contexts = nullptr;
}
bool QQmlVMEGuard::isOK() const
diff --git a/src/qml/qml/qqmlvme_p.h b/src/qml/qml/qqmlvme_p.h
index 99d63380ad..9a94ac6258 100644
--- a/src/qml/qml/qqmlvme_p.h
+++ b/src/qml/qml/qqmlvme_p.h
@@ -83,7 +83,7 @@ namespace QQmlVMETypes {
struct State {
enum Flag { Deferred = 0x00000001 };
- State() : flags(0), context(0), instructionStream(0) {}
+ State() : flags(0), context(nullptr), instructionStream(nullptr) {}
quint32 flags;
QQmlContextData *context;
const char *instructionStream;
@@ -143,7 +143,7 @@ private:
};
QQmlInstantiationInterrupt::QQmlInstantiationInterrupt()
- : mode(None), nsecs(0), runWhile(0)
+ : mode(None), nsecs(0), runWhile(nullptr)
{
}
@@ -153,7 +153,7 @@ QQmlInstantiationInterrupt::QQmlInstantiationInterrupt(volatile bool *runWhile,
}
QQmlInstantiationInterrupt::QQmlInstantiationInterrupt(int nsecs)
- : mode(Time), nsecs(nsecs), runWhile(0)
+ : mode(Time), nsecs(nsecs), runWhile(nullptr)
{
}
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp
index 73cb20dc7f..c1d3980b58 100644
--- a/src/qml/qml/qqmlvmemetaobject.cpp
+++ b/src/qml/qml/qqmlvmemetaobject.cpp
@@ -64,7 +64,7 @@ static void list_append(QQmlListProperty<QObject> *prop, QObject *o)
{
QList<QObject *> *list = static_cast<QList<QObject *> *>(prop->data);
list->append(o);
- static_cast<QQmlVMEMetaObject *>(prop->dummy1)->activate(prop->object, reinterpret_cast<quintptr>(prop->dummy2), 0);
+ static_cast<QQmlVMEMetaObject *>(prop->dummy1)->activate(prop->object, reinterpret_cast<quintptr>(prop->dummy2), nullptr);
}
static int list_count(QQmlListProperty<QObject> *prop)
@@ -83,11 +83,11 @@ static void list_clear(QQmlListProperty<QObject> *prop)
{
QList<QObject *> *list = static_cast<QList<QObject *> *>(prop->data);
list->clear();
- static_cast<QQmlVMEMetaObject *>(prop->dummy1)->activate(prop->object, reinterpret_cast<quintptr>(prop->dummy2), 0);
+ static_cast<QQmlVMEMetaObject *>(prop->dummy1)->activate(prop->object, reinterpret_cast<quintptr>(prop->dummy2), nullptr);
}
QQmlVMEVariantQObjectPtr::QQmlVMEVariantQObjectPtr()
- : QQmlGuard<QObject>(0), m_target(0), m_index(-1)
+ : QQmlGuard<QObject>(nullptr), m_target(nullptr), m_index(-1)
{
}
@@ -111,7 +111,7 @@ void QQmlVMEVariantQObjectPtr::objectDestroyed(QObject *)
}
}
- m_target->activate(m_target->object, m_target->methodOffset() + m_index, 0);
+ m_target->activate(m_target->object, m_target->methodOffset() + m_index, nullptr);
}
}
@@ -150,7 +150,7 @@ void QQmlVMEMetaObjectEndpoint::tryConnect()
if (metaObject.flag()) {
// This is actually notify
int sigIdx = metaObject->methodOffset() + aliasId + metaObject->compiledObject->nProperties;
- metaObject->activate(metaObject->object, sigIdx, 0);
+ metaObject->activate(metaObject->object, sigIdx, nullptr);
} else {
const QV4::CompiledData::Alias *aliasData = &metaObject->compiledObject->aliasTable()[aliasId];
if (!aliasData->isObjectAlias()) {
@@ -179,7 +179,7 @@ void QQmlVMEMetaObjectEndpoint::tryConnect()
QQmlInterceptorMetaObject::QQmlInterceptorMetaObject(QObject *obj, QQmlPropertyCache *cache)
: object(obj),
cache(cache),
- interceptors(0),
+ interceptors(nullptr),
hasAssignedMetaObjectData(false)
{
QObjectPrivate *op = QObjectPrivate::get(obj);
@@ -320,7 +320,7 @@ QQmlVMEMetaObject::QQmlVMEMetaObject(QV4::ExecutionEngine *engine,
: QQmlInterceptorMetaObject(obj, cache),
engine(engine),
ctxt(QQmlData::get(obj, true)->outerContext),
- aliasEndpoints(0), compilationUnit(qmlCompilationUnit), compiledObject(0)
+ aliasEndpoints(nullptr), compilationUnit(qmlCompilationUnit), compiledObject(nullptr)
{
Q_ASSERT(engine);
QQmlData::get(obj)->hasVMEMetaObject = true;
@@ -358,7 +358,7 @@ QV4::MemberData *QQmlVMEMetaObject::propertyAndMethodStorageAsMemberData() const
// such as the varProperties array) will have been cleaned up, but the
// QObject ptr will not yet have been deleted (eg, waiting on deleteLater).
// In this situation, return 0.
- return 0;
+ return nullptr;
}
return static_cast<QV4::MemberData*>(propertyAndMethodStorage.asManaged());
@@ -575,13 +575,13 @@ QObject* QQmlVMEMetaObject::readPropertyAsQObject(int id) const
{
QV4::MemberData *md = propertyAndMethodStorageAsMemberData();
if (!md)
- return 0;
+ return nullptr;
QV4::Scope scope(engine);
QV4::ScopedValue sv(scope, *(md->data() + id));
const QV4::QObjectWrapper *wrapper = sv->as<QV4::QObjectWrapper>();
if (!wrapper)
- return 0;
+ return nullptr;
return wrapper->object();
}
@@ -589,7 +589,7 @@ QList<QObject *> *QQmlVMEMetaObject::readPropertyAsList(int id) const
{
QV4::MemberData *md = propertyAndMethodStorageAsMemberData();
if (!md)
- return 0;
+ return nullptr;
QV4::Scope scope(engine);
QV4::Scoped<QV4::VariantObject> v(scope, *(md->data() + id));
@@ -643,7 +643,7 @@ int QQmlVMEMetaObject::metaCall(QObject *o, QMetaObject::Call c, int _id, void *
if (t == QV4::CompiledData::Property::Var) {
// the context can be null if accessing var properties from cpp after re-parenting an item.
- QQmlEnginePrivate *ep = (ctxt == 0 || ctxt->engine == 0) ? 0 : QQmlEnginePrivate::get(ctxt->engine);
+ QQmlEnginePrivate *ep = (ctxt == nullptr || ctxt->engine == nullptr) ? nullptr : QQmlEnginePrivate::get(ctxt->engine);
if (ep) {
if (c == QMetaObject::ReadProperty) {
*reinterpret_cast<QVariant *>(a[0]) = readPropertyAsVariant(id);
@@ -836,7 +836,7 @@ int QQmlVMEMetaObject::metaCall(QObject *o, QMetaObject::Call c, int _id, void *
}
if (c == QMetaObject::WriteProperty && needActivate) {
- activate(object, methodOffset() + id, 0);
+ activate(object, methodOffset() + id, nullptr);
}
return -1;
@@ -848,7 +848,7 @@ int QQmlVMEMetaObject::metaCall(QObject *o, QMetaObject::Call c, int _id, void *
const QV4::CompiledData::Alias *aliasData = &compiledObject->aliasTable()[id];
if ((aliasData->flags & QV4::CompiledData::Alias::AliasPointsToPointerObject) && c == QMetaObject::ReadProperty)
- *reinterpret_cast<void **>(a[0]) = 0;
+ *reinterpret_cast<void **>(a[0]) = nullptr;
if (!ctxt) return -1;
@@ -899,7 +899,7 @@ int QQmlVMEMetaObject::metaCall(QObject *o, QMetaObject::Call c, int _id, void *
int rv = QMetaObject::metacall(valueType, c, valueTypePropertyIndex, a);
if (c == QMetaObject::WriteProperty)
- valueType->write(target, coreIndex, 0x00);
+ valueType->write(target, coreIndex, nullptr);
return rv;
@@ -1037,7 +1037,7 @@ void QQmlVMEMetaObject::writeVarProperty(int id, const QV4::Value &value)
if (oldVariant)
oldVariant->removeVmePropertyReference();
- QObject *valueObject = 0;
+ QObject *valueObject = nullptr;
QQmlVMEVariantQObjectPtr *guard = getQObjectGuardForProperty(id);
// And, if the new value is a scarce resource, we need to ensure that it does not get
@@ -1060,7 +1060,7 @@ void QQmlVMEMetaObject::writeVarProperty(int id, const QV4::Value &value)
// Write the value and emit change signal as appropriate.
md->set(engine, id, value);
- activate(object, methodOffset() + id, 0);
+ activate(object, methodOffset() + id, nullptr);
}
void QQmlVMEMetaObject::writeProperty(int id, const QVariant &value)
@@ -1088,7 +1088,7 @@ void QQmlVMEMetaObject::writeProperty(int id, const QVariant &value)
QVariant currentValue = readPropertyAsVariant(id);
md->set(engine, id, newv);
if ((currentValue.userType() != value.userType() || currentValue != value))
- activate(object, methodOffset() + id, 0);
+ activate(object, methodOffset() + id, nullptr);
} else {
bool needActivate = false;
if (value.userType() == QMetaType::QObjectStar) {
@@ -1111,7 +1111,7 @@ void QQmlVMEMetaObject::writeProperty(int id, const QVariant &value)
}
if (needActivate)
- activate(object, methodOffset() + id, 0);
+ activate(object, methodOffset() + id, nullptr);
}
}
@@ -1187,7 +1187,7 @@ bool QQmlVMEMetaObject::aliasTarget(int index, QObject **target, int *coreIndex,
{
Q_ASSERT(compiledObject && (index >= propOffset() + int(compiledObject->nProperties)));
- *target = 0;
+ *target = nullptr;
*coreIndex = -1;
*valueTypeIndex = -1;
@@ -1289,7 +1289,7 @@ QQmlVMEVariantQObjectPtr *QQmlVMEMetaObject::getQObjectGuardForProperty(int inde
}
}
- return 0;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/qml/qml/qqmlvmemetaobject_p.h b/src/qml/qml/qqmlvmemetaobject_p.h
index 7881240452..46bff68327 100644
--- a/src/qml/qml/qqmlvmemetaobject_p.h
+++ b/src/qml/qml/qqmlvmemetaobject_p.h
@@ -112,7 +112,7 @@ public:
if (it->m_propertyIndex == propertyIndex)
return true;
}
- if (auto parentInterceptor = ((parent.isT1() && parent.flag()) ? static_cast<QQmlInterceptorMetaObject *>(parent.asT1()) : 0))
+ if (auto parentInterceptor = ((parent.isT1() && parent.flag()) ? static_cast<QQmlInterceptorMetaObject *>(parent.asT1()) : nullptr))
return parentInterceptor->intercepts(propertyIndex);
return false;
}
@@ -141,7 +141,7 @@ inline QQmlInterceptorMetaObject *QQmlInterceptorMetaObject::get(QObject *obj)
}
}
- return 0;
+ return nullptr;
}
class QQmlVMEMetaObjectEndpoint;
@@ -243,7 +243,7 @@ QQmlVMEMetaObject *QQmlVMEMetaObject::get(QObject *obj)
}
}
- return 0;
+ return nullptr;
}
int QQmlVMEMetaObject::propOffset() const
@@ -271,7 +271,7 @@ QQmlVMEMetaObject *QQmlVMEMetaObject::parentVMEMetaObject() const
if (parent.isT1() && parent.flag())
return static_cast<QQmlVMEMetaObject *>(parent.asT1());
- return 0;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp
index 9c9e199a5b..5673acec89 100644
--- a/src/qml/qml/qqmlxmlhttprequest.cpp
+++ b/src/qml/qml/qqmlxmlhttprequest.cpp
@@ -116,7 +116,7 @@ class DocumentImpl;
class NodeImpl
{
public:
- NodeImpl() : type(Element), document(0), parent(0) {}
+ NodeImpl() : type(Element), document(nullptr), parent(nullptr) {}
virtual ~NodeImpl() {
qDeleteAll(children);
qDeleteAll(attributes);
@@ -157,7 +157,7 @@ public:
class DocumentImpl : public QQmlRefCount, public NodeImpl
{
public:
- DocumentImpl() : root(0) { type = Document; }
+ DocumentImpl() : root(nullptr) { type = Document; }
virtual ~DocumentImpl() {
delete root;
}
@@ -306,18 +306,18 @@ void Heap::NodePrototype::init()
Scope scope(internalClass->engine);
ScopedObject o(scope, this);
- o->defineAccessorProperty(QStringLiteral("nodeName"), QV4::NodePrototype::method_get_nodeName, 0);
- o->defineAccessorProperty(QStringLiteral("nodeValue"), QV4::NodePrototype::method_get_nodeValue, 0);
- o->defineAccessorProperty(QStringLiteral("nodeType"), QV4::NodePrototype::method_get_nodeType, 0);
- o->defineAccessorProperty(QStringLiteral("namespaceUri"), QV4::NodePrototype::method_get_namespaceUri, 0);
+ o->defineAccessorProperty(QStringLiteral("nodeName"), QV4::NodePrototype::method_get_nodeName, nullptr);
+ o->defineAccessorProperty(QStringLiteral("nodeValue"), QV4::NodePrototype::method_get_nodeValue, nullptr);
+ o->defineAccessorProperty(QStringLiteral("nodeType"), QV4::NodePrototype::method_get_nodeType, nullptr);
+ o->defineAccessorProperty(QStringLiteral("namespaceUri"), QV4::NodePrototype::method_get_namespaceUri, nullptr);
- o->defineAccessorProperty(QStringLiteral("parentNode"), QV4::NodePrototype::method_get_parentNode, 0);
- o->defineAccessorProperty(QStringLiteral("childNodes"), QV4::NodePrototype::method_get_childNodes, 0);
- o->defineAccessorProperty(QStringLiteral("firstChild"), QV4::NodePrototype::method_get_firstChild, 0);
- o->defineAccessorProperty(QStringLiteral("lastChild"), QV4::NodePrototype::method_get_lastChild, 0);
- o->defineAccessorProperty(QStringLiteral("previousSibling"), QV4::NodePrototype::method_get_previousSibling, 0);
- o->defineAccessorProperty(QStringLiteral("nextSibling"), QV4::NodePrototype::method_get_nextSibling, 0);
- o->defineAccessorProperty(QStringLiteral("attributes"), QV4::NodePrototype::method_get_attributes, 0);
+ o->defineAccessorProperty(QStringLiteral("parentNode"), QV4::NodePrototype::method_get_parentNode, nullptr);
+ o->defineAccessorProperty(QStringLiteral("childNodes"), QV4::NodePrototype::method_get_childNodes, nullptr);
+ o->defineAccessorProperty(QStringLiteral("firstChild"), QV4::NodePrototype::method_get_firstChild, nullptr);
+ o->defineAccessorProperty(QStringLiteral("lastChild"), QV4::NodePrototype::method_get_lastChild, nullptr);
+ o->defineAccessorProperty(QStringLiteral("previousSibling"), QV4::NodePrototype::method_get_previousSibling, nullptr);
+ o->defineAccessorProperty(QStringLiteral("nextSibling"), QV4::NodePrototype::method_get_nextSibling, nullptr);
+ o->defineAccessorProperty(QStringLiteral("attributes"), QV4::NodePrototype::method_get_attributes, nullptr);
}
@@ -644,7 +644,7 @@ ReturnedValue Element::prototype(ExecutionEngine *engine)
ScopedObject p(scope, engine->newObject());
ScopedObject pp(scope);
p->setPrototype((pp = NodePrototype::getProto(engine)));
- p->defineAccessorProperty(QStringLiteral("tagName"), NodePrototype::method_get_nodeName, 0);
+ p->defineAccessorProperty(QStringLiteral("tagName"), NodePrototype::method_get_nodeName, nullptr);
d->elementPrototype.set(engine, p);
engine->v8Engine->freezeObject(p);
}
@@ -659,9 +659,9 @@ ReturnedValue Attr::prototype(ExecutionEngine *engine)
ScopedObject p(scope, engine->newObject());
ScopedObject pp(scope);
p->setPrototype((pp = NodePrototype::getProto(engine)));
- p->defineAccessorProperty(QStringLiteral("name"), method_name, 0);
- p->defineAccessorProperty(QStringLiteral("value"), method_value, 0);
- p->defineAccessorProperty(QStringLiteral("ownerElement"), method_ownerElement, 0);
+ p->defineAccessorProperty(QStringLiteral("name"), method_name, nullptr);
+ p->defineAccessorProperty(QStringLiteral("value"), method_value, nullptr);
+ p->defineAccessorProperty(QStringLiteral("ownerElement"), method_ownerElement, nullptr);
d->attrPrototype.set(engine, p);
engine->v8Engine->freezeObject(p);
}
@@ -716,8 +716,8 @@ ReturnedValue CharacterData::prototype(ExecutionEngine *v4)
ScopedObject p(scope, v4->newObject());
ScopedObject pp(scope);
p->setPrototype((pp = NodePrototype::getProto(v4)));
- p->defineAccessorProperty(QStringLiteral("data"), NodePrototype::method_get_nodeValue, 0);
- p->defineAccessorProperty(QStringLiteral("length"), method_length, 0);
+ p->defineAccessorProperty(QStringLiteral("data"), NodePrototype::method_get_nodeValue, nullptr);
+ p->defineAccessorProperty(QStringLiteral("length"), method_length, nullptr);
d->characterDataPrototype.set(v4, p);
v4->v8Engine->freezeObject(p);
}
@@ -752,8 +752,8 @@ ReturnedValue Text::prototype(ExecutionEngine *v4)
ScopedObject p(scope, v4->newObject());
ScopedObject pp(scope);
p->setPrototype((pp = CharacterData::prototype(v4)));
- p->defineAccessorProperty(QStringLiteral("isElementContentWhitespace"), method_isElementContentWhitespace, 0);
- p->defineAccessorProperty(QStringLiteral("wholeText"), method_wholeText, 0);
+ p->defineAccessorProperty(QStringLiteral("isElementContentWhitespace"), method_isElementContentWhitespace, nullptr);
+ p->defineAccessorProperty(QStringLiteral("wholeText"), method_wholeText, nullptr);
d->textPrototype.set(v4, p);
v4->v8Engine->freezeObject(p);
}
@@ -783,10 +783,10 @@ ReturnedValue Document::prototype(ExecutionEngine *v4)
ScopedObject p(scope, v4->newObject());
ScopedObject pp(scope);
p->setPrototype((pp = NodePrototype::getProto(v4)));
- p->defineAccessorProperty(QStringLiteral("xmlVersion"), method_xmlVersion, 0);
- p->defineAccessorProperty(QStringLiteral("xmlEncoding"), method_xmlEncoding, 0);
- p->defineAccessorProperty(QStringLiteral("xmlStandalone"), method_xmlStandalone, 0);
- p->defineAccessorProperty(QStringLiteral("documentElement"), method_documentElement, 0);
+ p->defineAccessorProperty(QStringLiteral("xmlVersion"), method_xmlVersion, nullptr);
+ p->defineAccessorProperty(QStringLiteral("xmlEncoding"), method_xmlEncoding, nullptr);
+ p->defineAccessorProperty(QStringLiteral("xmlStandalone"), method_xmlStandalone, nullptr);
+ p->defineAccessorProperty(QStringLiteral("documentElement"), method_documentElement, nullptr);
d->documentPrototype.set(v4, p);
v4->v8Engine->freezeObject(p);
}
@@ -797,7 +797,7 @@ ReturnedValue Document::load(ExecutionEngine *v4, const QByteArray &data)
{
Scope scope(v4);
- DocumentImpl *document = 0;
+ DocumentImpl *document = nullptr;
QStack<NodeImpl *> nodeStack;
QXmlStreamReader reader(data);
@@ -885,7 +885,7 @@ ReturnedValue Document::load(ExecutionEngine *v4, const QByteArray &data)
bool Node::isNull() const
{
- return d()->d == 0;
+ return d()->d == nullptr;
}
ReturnedValue NamedNodeMap::getIndexed(const Managed *m, uint index, bool *hasProperty)
@@ -1098,7 +1098,7 @@ private:
QQmlXMLHttpRequest::QQmlXMLHttpRequest(QNetworkAccessManager *manager)
: m_state(Unsent), m_errorFlag(false), m_sendFlag(false)
- , m_redirectCount(0), m_gotXml(false), m_textCodec(0), m_network(0), m_nam(manager)
+ , m_redirectCount(0), m_gotXml(false), m_textCodec(nullptr), m_network(nullptr), m_nam(manager)
, m_responseType()
, m_parsedDocument()
{
@@ -1443,7 +1443,7 @@ void QQmlXMLHttpRequest::finished()
dispatchCallback();
m_thisObject.clear();
- m_qmlContext.setContextData(0);
+ m_qmlContext.setContextData(nullptr);
}
@@ -1516,7 +1516,7 @@ QV4::ReturnedValue QQmlXMLHttpRequest::xmlResponseBody(QV4::ExecutionEngine* eng
#if QT_CONFIG(textcodec)
QTextCodec* QQmlXMLHttpRequest::findTextCodec() const
{
- QTextCodec *codec = 0;
+ QTextCodec *codec = nullptr;
if (!m_charset.isEmpty())
codec = QTextCodec::codecForName(m_charset);
@@ -1528,10 +1528,10 @@ QTextCodec* QQmlXMLHttpRequest::findTextCodec() const
}
if (!codec && m_mime == "text/html")
- codec = QTextCodec::codecForHtml(m_responseEntityBody, 0);
+ codec = QTextCodec::codecForHtml(m_responseEntityBody, nullptr);
if (!codec)
- codec = QTextCodec::codecForUtfText(m_responseEntityBody, 0);
+ codec = QTextCodec::codecForUtfText(m_responseEntityBody, nullptr);
if (!codec)
codec = QTextCodec::codecForName("UTF-8");
@@ -1595,7 +1595,7 @@ void QQmlXMLHttpRequest::destroyNetwork()
if (m_network) {
m_network->disconnect();
m_network->deleteLater();
- m_network = 0;
+ m_network = nullptr;
}
}
@@ -1709,12 +1709,12 @@ void QQmlXMLHttpRequestCtor::setupProto()
p->defineDefaultProperty(QStringLiteral("getAllResponseHeaders"), method_getAllResponseHeaders);
// Read-only properties
- p->defineAccessorProperty(QStringLiteral("readyState"), method_get_readyState, 0);
- p->defineAccessorProperty(QStringLiteral("status"),method_get_status, 0);
- p->defineAccessorProperty(QStringLiteral("statusText"),method_get_statusText, 0);
- p->defineAccessorProperty(QStringLiteral("responseText"),method_get_responseText, 0);
- p->defineAccessorProperty(QStringLiteral("responseXML"),method_get_responseXML, 0);
- p->defineAccessorProperty(QStringLiteral("response"),method_get_response, 0);
+ p->defineAccessorProperty(QStringLiteral("readyState"), method_get_readyState, nullptr);
+ p->defineAccessorProperty(QStringLiteral("status"),method_get_status, nullptr);
+ p->defineAccessorProperty(QStringLiteral("statusText"),method_get_statusText, nullptr);
+ p->defineAccessorProperty(QStringLiteral("responseText"),method_get_responseText, nullptr);
+ p->defineAccessorProperty(QStringLiteral("responseXML"),method_get_responseXML, nullptr);
+ p->defineAccessorProperty(QStringLiteral("response"),method_get_response, nullptr);
// Read-write properties
p->defineAccessorProperty(QStringLiteral("responseType"), method_get_responseType, method_set_responseType);
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index 44ad174f37..c147feeb73 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -151,10 +151,10 @@ void Heap::QtObject::init(QQmlEngine *qmlEngine)
o->defineDefaultProperty(QStringLiteral("createComponent"), QV4::QtObject::method_createComponent);
}
- o->defineAccessorProperty(QStringLiteral("platform"), QV4::QtObject::method_get_platform, 0);
- o->defineAccessorProperty(QStringLiteral("application"), QV4::QtObject::method_get_application, 0);
- o->defineAccessorProperty(QStringLiteral("inputMethod"), QV4::QtObject::method_get_inputMethod, 0);
- o->defineAccessorProperty(QStringLiteral("styleHints"), QV4::QtObject::method_get_styleHints, 0);
+ o->defineAccessorProperty(QStringLiteral("platform"), QV4::QtObject::method_get_platform, nullptr);
+ o->defineAccessorProperty(QStringLiteral("application"), QV4::QtObject::method_get_application, nullptr);
+ o->defineAccessorProperty(QStringLiteral("inputMethod"), QV4::QtObject::method_get_inputMethod, nullptr);
+ o->defineAccessorProperty(QStringLiteral("styleHints"), QV4::QtObject::method_get_styleHints, nullptr);
o->defineDefaultProperty(QStringLiteral("callLater"), QV4::QtObject::method_callLater);
}
@@ -233,7 +233,7 @@ ReturnedValue QtObject::method_isQtObject(const FunctionObject *, const Value *,
if (argc == 0)
RETURN_RESULT(QV4::Encode(false));
- return QV4::Encode(argv[0].as<QV4::QObjectWrapper>() != 0);
+ return QV4::Encode(argv[0].as<QV4::QObjectWrapper>() != nullptr);
}
/*!
@@ -948,7 +948,7 @@ ReturnedValue QtObject::method_resolvedUrl(const FunctionObject *b, const Value
QUrl url = scope.engine->toVariant(argv[0], -1).toUrl();
QQmlEngine *e = scope.engine->qmlEngine();
- QQmlEnginePrivate *p = 0;
+ QQmlEnginePrivate *p = nullptr;
if (e) p = QQmlEnginePrivate::get(e);
if (p) {
QQmlContextData *ctxt = scope.engine->callingQmlContext();
@@ -1120,7 +1120,7 @@ ReturnedValue QtObject::method_createQmlObject(const FunctionObject *b, const Va
QQmlContextData *context = scope.engine->callingQmlContext();
Q_ASSERT(context);
- QQmlContext *effectiveContext = 0;
+ QQmlContext *effectiveContext = nullptr;
if (context->isPragmaLibraryContext)
effectiveContext = engine->rootContext();
else
@@ -1140,7 +1140,7 @@ ReturnedValue QtObject::method_createQmlObject(const FunctionObject *b, const Va
if (url.isValid() && url.isRelative())
url = context->resolvedUrl(url);
- QObject *parentArg = 0;
+ QObject *parentArg = nullptr;
QV4::Scoped<QV4::QObjectWrapper> qobjectWrapper(scope, argv[1]);
if (!!qobjectWrapper)
parentArg = qobjectWrapper->object();
@@ -1249,14 +1249,14 @@ ReturnedValue QtObject::method_createComponent(const FunctionObject *b, const Va
Q_ASSERT(context);
QQmlContextData *effectiveContext = context;
if (context->isPragmaLibraryContext)
- effectiveContext = 0;
+ effectiveContext = nullptr;
QString arg = argv[0].toQStringNoThrow();
if (arg.isEmpty())
RETURN_RESULT(QV4::Encode::null());
QQmlComponent::CompilationMode compileMode = QQmlComponent::PreferSynchronous;
- QObject *parentArg = 0;
+ QObject *parentArg = nullptr;
int consumedCount = 1;
if (argc > 1) {
@@ -1283,7 +1283,7 @@ ReturnedValue QtObject::method_createComponent(const FunctionObject *b, const Va
if (!parentArg)
THROW_GENERIC_ERROR("Qt.createComponent(): Invalid parent object");
} else if (lastArg->isNull()) {
- parentArg = 0;
+ parentArg = nullptr;
} else {
THROW_GENERIC_ERROR("Qt.createComponent(): Invalid parent object");
}
@@ -1514,7 +1514,7 @@ static QString jsStack(QV4::ExecutionEngine *engine) {
static ReturnedValue writeToConsole(const FunctionObject *b, const Value *, const Value *argv, int argc,
ConsoleLogTypes logType, bool printStack = false)
{
- QLoggingCategory *loggingCategory = 0;
+ QLoggingCategory *loggingCategory = nullptr;
QString result;
QV4::Scope scope(b);
QV4::ExecutionEngine *v4 = scope.engine;
diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp
index 2bf623f144..038a75d50a 100644
--- a/src/qml/qml/v8/qv8engine.cpp
+++ b/src/qml/qml/v8/qv8engine.cpp
@@ -125,9 +125,9 @@ static void restoreJSValue(QDataStream &stream, void *data)
QV8Engine::QV8Engine(QJSEngine *qq, QV4::ExecutionEngine *v4)
: q(qq)
- , m_engine(0)
+ , m_engine(nullptr)
, m_v4Engine(v4)
- , m_xmlHttpRequestData(0)
+ , m_xmlHttpRequestData(nullptr)
{
#ifdef Q_PROCESSOR_X86_32
if (!qCpuHasFeature(SSE2)) {
@@ -159,7 +159,7 @@ QV8Engine::~QV8Engine()
#if QT_CONFIG(xmlstreamreader) && QT_CONFIG(qml_network)
qt_rem_qmlxmlhttprequest(m_v4Engine, m_xmlHttpRequestData);
- m_xmlHttpRequestData = 0;
+ m_xmlHttpRequestData = nullptr;
#endif
}
diff --git a/src/qml/qml/v8/qv8engine_p.h b/src/qml/qml/v8/qv8engine_p.h
index eb2b8b474c..b6a378667e 100644
--- a/src/qml/qml/v8/qv8engine_p.h
+++ b/src/qml/qml/v8/qv8engine_p.h
@@ -230,7 +230,7 @@ inline QV8Engine::Deletable *QV8Engine::extensionData(int index) const
if (index < m_extensionData.count())
return m_extensionData[index];
else
- return 0;
+ return nullptr;
}
diff --git a/src/qml/types/qqmlbind.cpp b/src/qml/types/qqmlbind.cpp
index 91c5a50877..513f7f2997 100644
--- a/src/qml/types/qqmlbind.cpp
+++ b/src/qml/types/qqmlbind.cpp
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
class QQmlBindPrivate : public QObjectPrivate
{
public:
- QQmlBindPrivate() : obj(0), componentComplete(true), delayed(false), pendingEval(false) {}
+ QQmlBindPrivate() : obj(nullptr), componentComplete(true), delayed(false), pendingEval(false) {}
~QQmlBindPrivate() { }
QQmlNullableValue<bool> when;
@@ -370,7 +370,7 @@ void QQmlBind::eval()
//restore any previous binding
if (d->prevBind) {
QQmlAbstractBinding::Ptr p = d->prevBind;
- d->prevBind = 0;
+ d->prevBind = nullptr;
QQmlPropertyPrivate::setBinding(p.data());
}
return;
diff --git a/src/qml/types/qqmlbind_p.h b/src/qml/types/qqmlbind_p.h
index c9dd14b58a..5bf9ef85c6 100644
--- a/src/qml/types/qqmlbind_p.h
+++ b/src/qml/types/qqmlbind_p.h
@@ -71,7 +71,7 @@ class Q_AUTOTEST_EXPORT QQmlBind : public QObject, public QQmlPropertyValueSourc
Q_PROPERTY(bool delayed READ delayed WRITE setDelayed REVISION 8)
public:
- QQmlBind(QObject *parent=0);
+ QQmlBind(QObject *parent=nullptr);
~QQmlBind();
bool when() const;
diff --git a/src/qml/types/qqmlconnections.cpp b/src/qml/types/qqmlconnections.cpp
index e218cdcfe4..a43562a7b8 100644
--- a/src/qml/types/qqmlconnections.cpp
+++ b/src/qml/types/qqmlconnections.cpp
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
class QQmlConnectionsPrivate : public QObjectPrivate
{
public:
- QQmlConnectionsPrivate() : target(0), enabled(true), targetSet(false), ignoreUnknownSignals(false), componentcomplete(true) {}
+ QQmlConnectionsPrivate() : target(nullptr), enabled(true), targetSet(false), ignoreUnknownSignals(false), componentcomplete(true) {}
QList<QQmlBoundSignal*> boundsignals;
QObject *target;
@@ -274,7 +274,7 @@ void QQmlConnections::connectSignals()
return;
QObject *target = this->target();
QQmlData *ddata = QQmlData::get(this);
- QQmlContextData *ctxtdata = ddata ? ddata->outerContext : 0;
+ QQmlContextData *ctxtdata = ddata ? ddata->outerContext : nullptr;
const QV4::CompiledData::Unit *qmlUnit = d->compilationUnit->data;
for (const QV4::CompiledData::Binding *binding : qAsConst(d->bindings)) {
@@ -290,7 +290,7 @@ void QQmlConnections::connectSignals()
QQmlBoundSignalExpression *expression = ctxtdata ?
new QQmlBoundSignalExpression(target, signalIndex,
- ctxtdata, this, d->compilationUnit->runtimeFunctions[binding->value.compiledScriptIndex]) : 0;
+ ctxtdata, this, d->compilationUnit->runtimeFunctions[binding->value.compiledScriptIndex]) : nullptr;
signal->takeExpression(expression);
d->boundsignals += signal;
} else {
diff --git a/src/qml/types/qqmlconnections_p.h b/src/qml/types/qqmlconnections_p.h
index 580b6522de..50e2c59ac3 100644
--- a/src/qml/types/qqmlconnections_p.h
+++ b/src/qml/types/qqmlconnections_p.h
@@ -73,7 +73,7 @@ class Q_AUTOTEST_EXPORT QQmlConnections : public QObject, public QQmlParserStatu
Q_PROPERTY(bool ignoreUnknownSignals READ ignoreUnknownSignals WRITE setIgnoreUnknownSignals)
public:
- QQmlConnections(QObject *parent=0);
+ QQmlConnections(QObject *parent=nullptr);
~QQmlConnections();
QObject *target() const;
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index ca19d68948..44166e4aa8 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -200,10 +200,10 @@ QQmlDelegateModelParts::QQmlDelegateModelParts(QQmlDelegateModel *parent)
*/
QQmlDelegateModelPrivate::QQmlDelegateModelPrivate(QQmlContext *ctxt)
- : m_delegate(0)
- , m_cacheMetaType(0)
+ : m_delegate(nullptr)
+ , m_cacheMetaType(nullptr)
, m_context(ctxt)
- , m_parts(0)
+ , m_parts(nullptr)
, m_filterGroup(QStringLiteral("items"))
, m_count(0)
, m_groupCount(Compositor::MinimumGroupCount)
@@ -214,9 +214,9 @@ QQmlDelegateModelPrivate::QQmlDelegateModelPrivate(QQmlContext *ctxt)
, m_transaction(false)
, m_incubatorCleanupScheduled(false)
, m_waitingToFetchMore(false)
- , m_cacheItems(0)
- , m_items(0)
- , m_persistedItems(0)
+ , m_cacheItems(nullptr)
+ , m_items(nullptr)
+ , m_persistedItems(nullptr)
{
}
@@ -268,10 +268,10 @@ QQmlDelegateModel::~QQmlDelegateModel()
if (cacheItem->object) {
delete cacheItem->object;
- cacheItem->object = 0;
+ cacheItem->object = nullptr;
cacheItem->contextData->invalidate();
Q_ASSERT(cacheItem->contextData->refCount == 1);
- cacheItem->contextData = 0;
+ cacheItem->contextData = nullptr;
cacheItem->scriptRef -= 1;
}
cacheItem->groups &= ~Compositor::UnresolvedFlag;
@@ -279,7 +279,7 @@ QQmlDelegateModel::~QQmlDelegateModel()
if (!cacheItem->isReferenced())
delete cacheItem;
else if (cacheItem->incubationTask)
- cacheItem->incubationTask->vdm = 0;
+ cacheItem->incubationTask->vdm = nullptr;
}
}
@@ -408,7 +408,7 @@ void QQmlDelegateModel::setDelegate(QQmlComponent *delegate)
qmlWarning(this) << tr("The delegate of a DelegateModel cannot be changed within onUpdated.");
return;
}
- bool wasValid = d->m_delegate != 0;
+ bool wasValid = d->m_delegate != nullptr;
d->m_delegate = delegate;
d->m_delegateValidated = false;
if (wasValid && d->m_complete) {
@@ -536,7 +536,7 @@ int QQmlDelegateModel::count() const
QQmlDelegateModel::ReleaseFlags QQmlDelegateModelPrivate::release(QObject *object)
{
- QQmlDelegateModel::ReleaseFlags stat = 0;
+ QQmlDelegateModel::ReleaseFlags stat = nullptr;
if (!object)
return stat;
@@ -546,7 +546,7 @@ QQmlDelegateModel::ReleaseFlags QQmlDelegateModelPrivate::release(QObject *objec
emitDestroyingItem(object);
if (cacheItem->incubationTask) {
releaseIncubator(cacheItem->incubationTask);
- cacheItem->incubationTask = 0;
+ cacheItem->incubationTask = nullptr;
}
cacheItem->Dispose();
stat |= QQmlInstanceModel::Destroyed;
@@ -582,7 +582,7 @@ void QQmlDelegateModel::cancel(int index)
if (cacheItem) {
if (cacheItem->incubationTask && !cacheItem->isObjectReferenced()) {
d->releaseIncubator(cacheItem->incubationTask);
- cacheItem->incubationTask = 0;
+ cacheItem->incubationTask = nullptr;
if (cacheItem->object) {
QObject *object = cacheItem->object;
@@ -631,7 +631,7 @@ QQmlDelegateModelGroup *QQmlDelegateModelPrivate::group_at(
QQmlDelegateModelPrivate *d = static_cast<QQmlDelegateModelPrivate *>(property->data);
return index >= 0 && index < d->m_groupCount - 1
? d->m_groups[index + 1]
- : 0;
+ : nullptr;
}
/*!
@@ -661,7 +661,7 @@ QQmlListProperty<QQmlDelegateModelGroup> QQmlDelegateModel::groups()
QQmlDelegateModelPrivate::group_append,
QQmlDelegateModelPrivate::group_count,
QQmlDelegateModelPrivate::group_at,
- 0);
+ nullptr);
}
/*!
@@ -839,11 +839,11 @@ void QQDMIncubationTask::statusChanged(Status status)
Q_ASSERT(incubating);
// The model was deleted from under our feet, cleanup ourselves
delete incubating->object;
- incubating->object = 0;
+ incubating->object = nullptr;
if (incubating->contextData) {
incubating->contextData->invalidate();
Q_ASSERT(incubating->contextData->refCount == 1);
- incubating->contextData = 0;
+ incubating->contextData = nullptr;
}
incubating->scriptRef = 0;
incubating->deleteLater();
@@ -879,8 +879,8 @@ void QQmlDelegateModelPrivate::incubatorStatusChanged(QQDMIncubationTask *incuba
return;
QQmlDelegateModelItem *cacheItem = incubationTask->incubating;
- cacheItem->incubationTask = 0;
- incubationTask->incubating = 0;
+ cacheItem->incubationTask = nullptr;
+ incubationTask->incubating = nullptr;
releaseIncubator(incubationTask);
if (status == QQmlIncubator::Ready) {
@@ -900,13 +900,13 @@ void QQmlDelegateModelPrivate::incubatorStatusChanged(QQDMIncubationTask *incuba
else
emitDestroyingItem(cacheItem->object);
delete cacheItem->object;
- cacheItem->object = 0;
+ cacheItem->object = nullptr;
cacheItem->scriptRef -= 1;
if (cacheItem->contextData) {
cacheItem->contextData->invalidate();
Q_ASSERT(cacheItem->contextData->refCount == 1);
}
- cacheItem->contextData = 0;
+ cacheItem->contextData = nullptr;
if (!cacheItem->isReferenced()) {
removeCacheItem(cacheItem);
@@ -935,9 +935,9 @@ QObject *QQmlDelegateModelPrivate::object(Compositor::Group group, int index, QQ
{
if (!m_delegate || index < 0 || index >= m_compositor.count(group)) {
qWarning() << "DelegateModel::item: index out range" << index << m_compositor.count(group);
- return 0;
+ return nullptr;
} else if (!m_context || !m_context->isValid()) {
- return 0;
+ return nullptr;
}
Compositor::iterator it = m_compositor.find(group, index);
@@ -947,7 +947,7 @@ QObject *QQmlDelegateModelPrivate::object(Compositor::Group group, int index, QQ
if (!cacheItem) {
cacheItem = m_adaptorModel.createItem(m_cacheMetaType, it.modelIndex());
if (!cacheItem)
- return 0;
+ return nullptr;
cacheItem->groups = it->flags;
@@ -1016,7 +1016,7 @@ QObject *QQmlDelegateModelPrivate::object(Compositor::Group group, int index, QQ
delete cacheItem;
}
- return 0;
+ return nullptr;
}
/*
@@ -1032,7 +1032,7 @@ QObject *QQmlDelegateModel::object(int index, QQmlIncubator::IncubationMode incu
Q_D(QQmlDelegateModel);
if (!d->m_delegate || index < 0 || index >= d->m_compositor.count(d->m_compositorGroup)) {
qWarning() << "DelegateModel::item: index out range" << index << d->m_compositor.count(d->m_compositorGroup);
- return 0;
+ return nullptr;
}
return d->object(d->m_compositorGroup, index, incubationMode);
@@ -1347,7 +1347,7 @@ void QQmlDelegateModelPrivate::itemsRemoved(
if (QQDMIncubationTask *incubationTask = cacheItem->incubationTask) {
if (!cacheItem->isObjectReferenced()) {
releaseIncubator(cacheItem->incubationTask);
- cacheItem->incubationTask = 0;
+ cacheItem->incubationTask = nullptr;
if (cacheItem->object) {
QObject *object = cacheItem->object;
cacheItem->destroyObject();
@@ -1668,7 +1668,7 @@ bool QQmlDelegateModelPrivate::insert(Compositor::insert_iterator &before, const
// Must be before the new object is inserted into the cache or its indexes will be adjusted too.
itemsInserted(QVector<Compositor::Insert>(1, Compositor::Insert(before, 1, cacheItem->groups & ~Compositor::CacheFlag)));
- before = m_compositor.insert(before, 0, 0, 1, cacheItem->groups);
+ before = m_compositor.insert(before, nullptr, 0, 1, cacheItem->groups);
m_cache.insert(before.cacheIndex, cacheItem);
return true;
@@ -1681,7 +1681,7 @@ QQmlDelegateModelItemMetaType::QQmlDelegateModelItemMetaType(
: model(model)
, groupCount(groupNames.count() + 1)
, v4Engine(engine)
- , metaObject(0)
+ , metaObject(nullptr)
, groupNames(groupNames)
{
}
@@ -1724,7 +1724,7 @@ void QQmlDelegateModelItemMetaType::initializePrototype()
QV4::Scope scope(v4Engine);
QV4::ScopedObject proto(scope, v4Engine->newObject());
- proto->defineAccessorProperty(QStringLiteral("model"), QQmlDelegateModelItem::get_model, 0);
+ proto->defineAccessorProperty(QStringLiteral("model"), QQmlDelegateModelItem::get_model, nullptr);
proto->defineAccessorProperty(QStringLiteral("groups"), QQmlDelegateModelItem::get_groups, QQmlDelegateModelItem::set_groups);
QV4::ScopedString s(scope);
QV4::ScopedProperty p(scope);
@@ -1733,7 +1733,7 @@ void QQmlDelegateModelItemMetaType::initializePrototype()
QV4::ScopedFunctionObject f(scope);
QV4::ExecutionContext *global = scope.engine->rootContext();
p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, 30, QQmlDelegateModelItem::get_member)));
- p->setSetter(0);
+ p->setSetter(nullptr);
proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable);
s = v4Engine->newString(QStringLiteral("inItems"));
@@ -1752,7 +1752,7 @@ void QQmlDelegateModelItemMetaType::initializePrototype()
s = v4Engine->newString(QStringLiteral("persistedItemsIndex"));
p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, QQmlListCompositor::Persisted, QQmlDelegateModelItem::get_index)));
- p->setSetter(0);
+ p->setSetter(nullptr);
proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable);
for (int i = 2; i < groupNames.count(); ++i) {
@@ -1767,7 +1767,7 @@ void QQmlDelegateModelItemMetaType::initializePrototype()
const QString propertyName = groupNames.at(i) + QLatin1String("Index");
s = v4Engine->newString(propertyName);
p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, i + 1, QQmlDelegateModelItem::get_index)));
- p->setSetter(0);
+ p->setSetter(nullptr);
proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable);
}
modelItemProto.set(v4Engine, proto);
@@ -1909,10 +1909,10 @@ QQmlDelegateModelItem::QQmlDelegateModelItem(
QQmlDelegateModelItemMetaType *metaType, int modelIndex)
: v4(metaType->v4Engine)
, metaType(metaType)
- , contextData(0)
- , object(0)
- , attached(0)
- , incubationTask(0)
+ , contextData(nullptr)
+ , object(nullptr)
+ , attached(nullptr)
+ , incubationTask(nullptr)
, objectRef(0)
, scriptRef(0)
, groups(0)
@@ -1962,39 +1962,39 @@ void QQmlDelegateModelItem::destroyObject()
data->ownContext->clearContext();
if (data->ownContext->contextObject == object)
data->ownContext->contextObject = nullptr;
- data->ownContext = 0;
- data->context = 0;
+ data->ownContext = nullptr;
+ data->context = nullptr;
}
object->deleteLater();
if (attached) {
- attached->m_cacheItem = 0;
- attached = 0;
+ attached->m_cacheItem = nullptr;
+ attached = nullptr;
}
contextData->invalidate();
- contextData = 0;
- object = 0;
+ contextData = nullptr;
+ object = nullptr;
}
QQmlDelegateModelItem *QQmlDelegateModelItem::dataForObject(QObject *object)
{
QQmlData *d = QQmlData::get(object);
- QQmlContextData *context = d ? d->context : 0;
- for (context = context ? context->parent : 0; context; context = context->parent) {
+ QQmlContextData *context = d ? d->context : nullptr;
+ for (context = context ? context->parent : nullptr; context; context = context->parent) {
if (QQmlDelegateModelItem *cacheItem = qobject_cast<QQmlDelegateModelItem *>(
context->contextObject)) {
return cacheItem;
}
}
- return 0;
+ return nullptr;
}
int QQmlDelegateModelItem::groupIndex(Compositor::Group group)
{
if (QQmlDelegateModelPrivate * const model = metaType->model
? QQmlDelegateModelPrivate::get(metaType->model)
- : 0) {
+ : nullptr) {
return model->m_compositor.find(Compositor::Cache, model->m_cache.indexOf(this)).index[group];
}
return -1;
@@ -2067,7 +2067,7 @@ int QQmlDelegateModelAttachedMetaObject::metaCall(QObject *object, QMetaObject::
}
QQmlDelegateModelAttached::QQmlDelegateModelAttached(QObject *parent)
- : m_cacheItem(0)
+ : m_cacheItem(nullptr)
, m_previousGroups(0)
{
QQml_setParent_noEvent(this, parent);
@@ -2107,7 +2107,7 @@ QQmlDelegateModelAttached::QQmlDelegateModelAttached(
QQmlDelegateModel *QQmlDelegateModelAttached::model() const
{
- return m_cacheItem ? m_cacheItem->metaType->model : 0;
+ return m_cacheItem ? m_cacheItem->metaType->model : nullptr;
}
/*!
@@ -2219,11 +2219,11 @@ void QQmlDelegateModelAttached::emitChanges()
const QMetaObject *meta = metaObject();
for (int i = 1; i < m_cacheItem->metaType->groupCount; ++i, ++notifierId) {
if (groupChanges & (1 << i))
- QMetaObject::activate(this, meta, notifierId, 0);
+ QMetaObject::activate(this, meta, notifierId, nullptr);
}
for (int i = 1; i < m_cacheItem->metaType->groupCount; ++i, ++notifierId) {
if (indexChanges & (1 << i))
- QMetaObject::activate(this, meta, notifierId, 0);
+ QMetaObject::activate(this, meta, notifierId, nullptr);
}
if (groupChanges)
@@ -2508,7 +2508,7 @@ bool QQmlDelegateModelGroupPrivate::parseIndex(const QV4::Value &value, int *ind
QQmlDelegateModelItem * const cacheItem = object->d()->item;
if (QQmlDelegateModelPrivate *model = cacheItem->metaType->model
? QQmlDelegateModelPrivate::get(cacheItem->metaType->model)
- : 0) {
+ : nullptr) {
*index = model->m_cache.indexOf(cacheItem);
*group = Compositor::Cache;
return true;
@@ -3133,7 +3133,7 @@ QObject *QQmlPartsModel::object(int index, QQmlIncubator::IncubationMode incubat
if (!model->m_delegate || index < 0 || index >= model->m_compositor.count(m_compositorGroup)) {
qWarning() << "DelegateModel::item: index out range" << index << model->m_compositor.count(m_compositorGroup);
- return 0;
+ return nullptr;
}
QObject *object = model->object(m_compositorGroup, index, incubationMode);
@@ -3141,7 +3141,7 @@ QObject *QQmlPartsModel::object(int index, QQmlIncubator::IncubationMode incubat
if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(object)) {
QObject *part = package->part(m_part);
if (!part)
- return 0;
+ return nullptr;
m_packaged.insertMulti(part, package);
return part;
}
@@ -3153,12 +3153,12 @@ QObject *QQmlPartsModel::object(int index, QQmlIncubator::IncubationMode incubat
model->m_delegateValidated = true;
}
- return 0;
+ return nullptr;
}
QQmlInstanceModel::ReleaseFlags QQmlPartsModel::release(QObject *item)
{
- QQmlInstanceModel::ReleaseFlags flags = 0;
+ QQmlInstanceModel::ReleaseFlags flags = nullptr;
QHash<QObject *, QQuickPackage *>::iterator it = m_packaged.find(item);
if (it != m_packaged.end()) {
@@ -3336,9 +3336,9 @@ QQmlDelegateModelEngineData::QQmlDelegateModelEngineData(QV4::ExecutionEngine *v
QV4::Scope scope(v4);
QV4::ScopedObject proto(scope, v4->newObject());
- proto->defineAccessorProperty(QStringLiteral("index"), QQmlDelegateModelGroupChange::method_get_index, 0);
- proto->defineAccessorProperty(QStringLiteral("count"), QQmlDelegateModelGroupChange::method_get_count, 0);
- proto->defineAccessorProperty(QStringLiteral("moveId"), QQmlDelegateModelGroupChange::method_get_moveId, 0);
+ proto->defineAccessorProperty(QStringLiteral("index"), QQmlDelegateModelGroupChange::method_get_index, nullptr);
+ proto->defineAccessorProperty(QStringLiteral("count"), QQmlDelegateModelGroupChange::method_get_count, nullptr);
+ proto->defineAccessorProperty(QStringLiteral("moveId"), QQmlDelegateModelGroupChange::method_get_moveId, nullptr);
changeProto.set(v4, proto);
}
diff --git a/src/qml/types/qqmldelegatemodel_p.h b/src/qml/types/qqmldelegatemodel_p.h
index 71179fd8be..b894df8f82 100644
--- a/src/qml/types/qqmldelegatemodel_p.h
+++ b/src/qml/types/qqmldelegatemodel_p.h
@@ -90,7 +90,7 @@ class Q_QML_PRIVATE_EXPORT QQmlDelegateModel : public QQmlInstanceModel, public
Q_INTERFACES(QQmlParserStatus)
public:
QQmlDelegateModel();
- QQmlDelegateModel(QQmlContext *, QObject *parent=0);
+ QQmlDelegateModel(QQmlContext *, QObject *parent=nullptr);
~QQmlDelegateModel();
void classBegin() override;
@@ -109,7 +109,7 @@ public:
Q_INVOKABLE QVariant parentModelIndex() const;
int count() const override;
- bool isValid() const override { return delegate() != 0; }
+ bool isValid() const override { return delegate() != nullptr; }
QObject *object(int index, QQmlIncubator::IncubationMode incubationMode = QQmlIncubator::AsynchronousIfNested) override;
ReleaseFlags release(QObject *object) override;
void cancel(int index) override;
@@ -164,8 +164,8 @@ class Q_QML_PRIVATE_EXPORT QQmlDelegateModelGroup : public QObject
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(bool includeByDefault READ defaultInclude WRITE setDefaultInclude NOTIFY defaultIncludeChanged)
public:
- QQmlDelegateModelGroup(QObject *parent = 0);
- QQmlDelegateModelGroup(const QString &name, QQmlDelegateModel *model, int compositorType, QObject *parent = 0);
+ QQmlDelegateModelGroup(QObject *parent = nullptr);
+ QQmlDelegateModelGroup(const QString &name, QQmlDelegateModel *model, int compositorType, QObject *parent = nullptr);
~QQmlDelegateModelGroup();
QString name() const;
diff --git a/src/qml/types/qqmldelegatemodel_p_p.h b/src/qml/types/qqmldelegatemodel_p_p.h
index 7b60bcddc0..68b987a5fa 100644
--- a/src/qml/types/qqmldelegatemodel_p_p.h
+++ b/src/qml/types/qqmldelegatemodel_p_p.h
@@ -182,7 +182,7 @@ class QQDMIncubationTask : public QQmlIncubator
public:
QQDMIncubationTask(QQmlDelegateModelPrivate *l, IncubationMode mode)
: QQmlIncubator(mode)
- , incubating(0)
+ , incubating(nullptr)
, vdm(l) {}
void statusChanged(Status) override;
@@ -278,12 +278,12 @@ public:
void itemsInserted(
const QVector<Compositor::Insert> &inserts,
QVarLengthArray<QVector<QQmlChangeSet::Change>, Compositor::MaximumGroupCount> *translatedInserts,
- QHash<int, QList<QQmlDelegateModelItem *> > *movedItems = 0);
+ QHash<int, QList<QQmlDelegateModelItem *> > *movedItems = nullptr);
void itemsInserted(const QVector<Compositor::Insert> &inserts);
void itemsRemoved(
const QVector<Compositor::Remove> &removes,
QVarLengthArray<QVector<QQmlChangeSet::Change>, Compositor::MaximumGroupCount> *translatedRemoves,
- QHash<int, QList<QQmlDelegateModelItem *> > *movedItems = 0);
+ QHash<int, QList<QQmlDelegateModelItem *> > *movedItems = nullptr);
void itemsRemoved(const QVector<Compositor::Remove> &removes);
void itemsMoved(
const QVector<Compositor::Remove> &removes, const QVector<Compositor::Insert> &inserts);
@@ -341,7 +341,7 @@ class QQmlPartsModel : public QQmlInstanceModel, public QQmlDelegateModelGroupEm
Q_OBJECT
Q_PROPERTY(QString filterOnGroup READ filterGroup WRITE setFilterGroup NOTIFY filterGroupChanged RESET resetFilterGroup)
public:
- QQmlPartsModel(QQmlDelegateModel *model, const QString &part, QObject *parent = 0);
+ QQmlPartsModel(QQmlDelegateModel *model, const QString &part, QObject *parent = nullptr);
~QQmlPartsModel();
QString filterGroup() const;
diff --git a/src/qml/types/qqmlinstantiator.cpp b/src/qml/types/qqmlinstantiator.cpp
index 6e2b66aea7..213bef7879 100644
--- a/src/qml/types/qqmlinstantiator.cpp
+++ b/src/qml/types/qqmlinstantiator.cpp
@@ -56,8 +56,8 @@ QQmlInstantiatorPrivate::QQmlInstantiatorPrivate()
, ownModel(false)
, requestedIndex(-1)
, model(QVariant(1))
- , instanceModel(0)
- , delegate(0)
+ , instanceModel(nullptr)
+ , delegate(nullptr)
{
}
@@ -183,7 +183,7 @@ void QQmlInstantiatorPrivate::_q_modelUpdated(const QQmlChangeSet &changeSet, bo
objects = objects.mid(0, index) + movedObjects + objects.mid(index);
} else {
if (insert.index <= objects.size())
- objects.insert(insert.index, insert.count, 0);
+ objects.insert(insert.index, insert.count, nullptr);
for (int i = 0; i < insert.count; ++i) {
int modelIndex = index + i;
QObject* obj = modelObject(modelIndex, async);
@@ -396,11 +396,11 @@ void QQmlInstantiator::setModel(const QVariant &v)
QQmlInstanceModel *prevModel = d->instanceModel;
QObject *object = qvariant_cast<QObject*>(v);
- QQmlInstanceModel *vim = 0;
+ QQmlInstanceModel *vim = nullptr;
if (object && (vim = qobject_cast<QQmlInstanceModel *>(object))) {
if (d->ownModel) {
delete d->instanceModel;
- prevModel = 0;
+ prevModel = nullptr;
d->ownModel = false;
}
d->instanceModel = vim;
@@ -444,7 +444,7 @@ QObject *QQmlInstantiator::object() const
Q_D(const QQmlInstantiator);
if (d->objects.count())
return d->objects[0];
- return 0;
+ return nullptr;
}
/*!
@@ -457,7 +457,7 @@ QObject *QQmlInstantiator::objectAt(int index) const
Q_D(const QQmlInstantiator);
if (index >= 0 && index < d->objects.count())
return d->objects[index];
- return 0;
+ return nullptr;
}
/*!
diff --git a/src/qml/types/qqmlinstantiator_p.h b/src/qml/types/qqmlinstantiator_p.h
index ee18daa48c..5727c4d1e1 100644
--- a/src/qml/types/qqmlinstantiator_p.h
+++ b/src/qml/types/qqmlinstantiator_p.h
@@ -71,7 +71,7 @@ class Q_AUTOTEST_EXPORT QQmlInstantiator : public QObject, public QQmlParserStat
Q_CLASSINFO("DefaultProperty", "delegate")
public:
- QQmlInstantiator(QObject *parent = 0);
+ QQmlInstantiator(QObject *parent = nullptr);
~QQmlInstantiator();
bool isActive() const;
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index 784368c504..d4fc02cd3e 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -100,7 +100,7 @@ const ListLayout::Role &ListLayout::getRoleOrCreate(const QString &key, Role::Da
if (node) {
const Role &r = *node->value;
if (type != r.type)
- qmlWarning(0) << QStringLiteral("Can't assign to existing role '%1' of different type [%2 -> %3]").arg(r.name).arg(roleTypeName(type)).arg(roleTypeName(r.type));
+ qmlWarning(nullptr) << QStringLiteral("Can't assign to existing role '%1' of different type [%2 -> %3]").arg(r.name).arg(roleTypeName(type)).arg(roleTypeName(r.type));
return r;
}
@@ -113,7 +113,7 @@ const ListLayout::Role &ListLayout::getRoleOrCreate(QV4::String *key, Role::Data
if (node) {
const Role &r = *node->value;
if (type != r.type)
- qmlWarning(0) << QStringLiteral("Can't assign to existing role '%1' of different type [%2 -> %3]").arg(r.name).arg(roleTypeName(type)).arg(roleTypeName(r.type));
+ qmlWarning(nullptr) << QStringLiteral("Can't assign to existing role '%1' of different type [%2 -> %3]").arg(r.name).arg(roleTypeName(type)).arg(roleTypeName(r.type));
return r;
}
@@ -134,7 +134,7 @@ const ListLayout::Role &ListLayout::createRole(const QString &key, ListLayout::R
if (type == Role::List) {
r->subLayout = new ListLayout;
} else {
- r->subLayout = 0;
+ r->subLayout = nullptr;
}
int dataSize = dataSizes[type];
@@ -203,7 +203,7 @@ ListLayout::Role::Role(const Role *other)
if (other->subLayout)
subLayout = new ListLayout(other->subLayout);
else
- subLayout = 0;
+ subLayout = nullptr;
}
ListLayout::Role::~Role()
@@ -236,8 +236,8 @@ const ListLayout::Role *ListLayout::getRoleOrCreate(const QString &key, const QV
}
if (type == Role::Invalid) {
- qmlWarning(0) << "Can't create role for unsupported data type";
- return 0;
+ qmlWarning(nullptr) << "Can't create role for unsupported data type";
+ return nullptr;
}
return &getRoleOrCreate(key, type);
@@ -245,7 +245,7 @@ const ListLayout::Role *ListLayout::getRoleOrCreate(const QString &key, const QV
const ListLayout::Role *ListLayout::getExistingRole(const QString &key) const
{
- Role *r = 0;
+ Role *r = nullptr;
QStringHash<Role *>::Node *node = roleHash.findNode(key);
if (node)
r = node->value;
@@ -254,7 +254,7 @@ const ListLayout::Role *ListLayout::getExistingRole(const QString &key) const
const ListLayout::Role *ListLayout::getExistingRole(QV4::String *key) const
{
- Role *r = 0;
+ Role *r = nullptr;
QStringHash<Role *>::Node *node = roleHash.findNode(key);
if (node)
r = node->value;
@@ -264,7 +264,7 @@ const ListLayout::Role *ListLayout::getExistingRole(QV4::String *key) const
QObject *ListModel::getOrCreateModelObject(QQmlListModel *model, int elementIndex)
{
ListElement *e = elements[elementIndex];
- if (e->m_objectCache == 0) {
+ if (e->m_objectCache == nullptr) {
void *memory = operator new(sizeof(QObject) + sizeof(QQmlData));
void *ddataMemory = ((char *)memory) + sizeof(QObject);
e->m_objectCache = new (memory) QObject;
@@ -404,10 +404,10 @@ void ListModel::destroy()
for (const auto &destroyer : remove(0, elements.count()))
destroyer();
- m_layout = 0;
+ m_layout = nullptr;
if (m_modelCache && m_modelCache->m_primary == false)
delete m_modelCache;
- m_modelCache = 0;
+ m_modelCache = nullptr;
}
int ListModel::appendElement()
@@ -508,7 +508,7 @@ void ListModel::set(int elementIndex, QV4::Object *object, QVector<int> *roles)
roleIndex = e->setDoubleProperty(r, propertyValue->asDouble());
} else if (QV4::ArrayObject *a = propertyValue->as<QV4::ArrayObject>()) {
const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::List);
- ListModel *subModel = new ListModel(r.subLayout, 0);
+ ListModel *subModel = new ListModel(r.subLayout, nullptr);
int arrayLength = a->getLength();
for (int j=0 ; j < arrayLength ; ++j) {
@@ -589,7 +589,7 @@ void ListModel::set(int elementIndex, QV4::Object *object)
} else if (QV4::ArrayObject *a = propertyValue->as<QV4::ArrayObject>()) {
const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::List);
if (r.type == ListLayout::Role::List) {
- ListModel *subModel = new ListModel(r.subLayout, 0);
+ ListModel *subModel = new ListModel(r.subLayout, nullptr);
int arrayLength = a->getLength();
for (int j=0 ; j < arrayLength ; ++j) {
@@ -698,7 +698,7 @@ inline char *ListElement::getPropertyMemory(const ListLayout::Role &role)
ListElement *e = this;
int blockIndex = 0;
while (blockIndex < role.blockIndex) {
- if (e->next == 0) {
+ if (e->next == nullptr) {
e->next = new ListElement;
e->next->uid = uid;
}
@@ -713,7 +713,7 @@ inline char *ListElement::getPropertyMemory(const ListLayout::Role &role)
ModelNodeMetaObject *ListElement::objectCache()
{
if (!m_objectCache)
- return 0;
+ return nullptr;
return ModelNodeMetaObject::get(m_objectCache);
}
@@ -721,7 +721,7 @@ QString *ListElement::getStringProperty(const ListLayout::Role &role)
{
char *mem = getPropertyMemory(role);
QString *s = reinterpret_cast<QString *>(mem);
- return s->data_ptr() ? s : 0;
+ return s->data_ptr() ? s : nullptr;
}
QObject *ListElement::getQObjectProperty(const ListLayout::Role &role)
@@ -733,7 +733,7 @@ QObject *ListElement::getQObjectProperty(const ListLayout::Role &role)
QVariantMap *ListElement::getVariantMapProperty(const ListLayout::Role &role)
{
- QVariantMap *map = 0;
+ QVariantMap *map = nullptr;
char *mem = getPropertyMemory(role);
if (isMemoryUsed<QVariantMap>(mem))
@@ -744,7 +744,7 @@ QVariantMap *ListElement::getVariantMapProperty(const ListLayout::Role &role)
QDateTime *ListElement::getDateTimeProperty(const ListLayout::Role &role)
{
- QDateTime *dt = 0;
+ QDateTime *dt = nullptr;
char *mem = getPropertyMemory(role);
if (isMemoryUsed<QDateTime>(mem))
@@ -755,7 +755,7 @@ QDateTime *ListElement::getDateTimeProperty(const ListLayout::Role &role)
QJSValue *ListElement::getFunctionProperty(const ListLayout::Role &role)
{
- QJSValue *f = 0;
+ QJSValue *f = nullptr;
char *mem = getPropertyMemory(role);
if (isMemoryUsed<QJSValue>(mem))
@@ -776,7 +776,7 @@ QPointer<QObject> *ListElement::getGuardProperty(const ListLayout::Role &role)
}
}
- QPointer<QObject> *o = 0;
+ QPointer<QObject> *o = nullptr;
if (existingGuard)
o = reinterpret_cast<QPointer<QObject> *>(mem);
@@ -807,7 +807,7 @@ QVariant ListElement::getProperty(const ListLayout::Role &role, const QQmlListMo
case ListLayout::Role::String:
{
QString *value = reinterpret_cast<QString *>(mem);
- if (value->data_ptr() != 0)
+ if (value->data_ptr() != nullptr)
data = *value;
}
break;
@@ -823,7 +823,7 @@ QVariant ListElement::getProperty(const ListLayout::Role &role, const QQmlListMo
ListModel *model = *value;
if (model) {
- if (model->m_modelCache == 0) {
+ if (model->m_modelCache == nullptr) {
model->m_modelCache = new QQmlListModel(owner, model, eng);
QQmlEngine::setContextForObject(model->m_modelCache, QQmlEngine::contextForObject(owner));
}
@@ -880,7 +880,7 @@ int ListElement::setStringProperty(const ListLayout::Role &role, const QString &
char *mem = getPropertyMemory(role);
QString *c = reinterpret_cast<QString *>(mem);
bool changed;
- if (c->data_ptr() == 0) {
+ if (c->data_ptr() == nullptr) {
new (mem) QString(s);
changed = true;
} else {
@@ -1114,16 +1114,16 @@ void ListElement::clearProperty(const ListLayout::Role &role)
setBoolProperty(role, false);
break;
case ListLayout::Role::List:
- setListProperty(role, 0);
+ setListProperty(role, nullptr);
break;
case ListLayout::Role::QObject:
- setQObjectProperty(role, 0);
+ setQObjectProperty(role, nullptr);
break;
case ListLayout::Role::DateTime:
setDateTimeProperty(role, QDateTime());
break;
case ListLayout::Role::VariantMap:
- setVariantMapProperty(role, (QVariantMap *)0);
+ setVariantMapProperty(role, (QVariantMap *)nullptr);
break;
case ListLayout::Role::Function:
setFunctionProperty(role, QJSValue());
@@ -1135,17 +1135,17 @@ void ListElement::clearProperty(const ListLayout::Role &role)
ListElement::ListElement()
{
- m_objectCache = 0;
+ m_objectCache = nullptr;
uid = uidCounter.fetchAndAddOrdered(1);
- next = 0;
+ next = nullptr;
memset(data, 0, sizeof(data));
}
ListElement::ListElement(int existingUid)
{
- m_objectCache = 0;
+ m_objectCache = nullptr;
uid = existingUid;
- next = 0;
+ next = nullptr;
memset(data, 0, sizeof(data));
}
@@ -1169,8 +1169,8 @@ QVector<int> ListElement::sync(ListElement *src, ListLayout *srcLayout, ListElem
ListModel *targetSubModel = target->getListProperty(targetRole);
if (srcSubModel) {
- if (targetSubModel == 0) {
- targetSubModel = new ListModel(targetRole.subLayout, 0);
+ if (targetSubModel == nullptr) {
+ targetSubModel = new ListModel(targetRole.subLayout, nullptr);
target->setListPropertyFast(targetRole, targetSubModel);
}
if (ListModel::sync(srcSubModel, targetSubModel))
@@ -1190,7 +1190,7 @@ QVector<int> ListElement::sync(ListElement *src, ListLayout *srcLayout, ListElem
case ListLayout::Role::DateTime:
case ListLayout::Role::Function:
{
- QVariant v = src->getProperty(srcRole, 0, 0);
+ QVariant v = src->getProperty(srcRole, nullptr, nullptr);
roleIndex = target->setVariantProperty(targetRole, v);
}
break;
@@ -1271,7 +1271,7 @@ void ListElement::destroy(ListLayout *layout)
}
if (next)
- next->destroy(0);
+ next->destroy(nullptr);
uid = -1;
}
@@ -1329,7 +1329,7 @@ int ListElement::setJsProperty(const ListLayout::Role &role, const QV4::Value &d
QV4::Scope scope(a->engine());
QV4::ScopedObject o(scope);
- ListModel *subModel = new ListModel(role.subLayout, 0);
+ ListModel *subModel = new ListModel(role.subLayout, nullptr);
int arrayLength = a->getLength();
for (int j=0 ; j < arrayLength ; ++j) {
o = a->getIndexed(j);
@@ -1337,7 +1337,7 @@ int ListElement::setJsProperty(const ListLayout::Role &role, const QV4::Value &d
}
roleIndex = setListProperty(role, subModel);
} else {
- qmlWarning(0) << QStringLiteral("Can't assign to existing role '%1' of different type [%2 -> %3]").arg(role.name).arg(roleTypeName(role.type)).arg(roleTypeName(ListLayout::Role::List));
+ qmlWarning(nullptr) << QStringLiteral("Can't assign to existing role '%1' of different type [%2 -> %3]").arg(role.name).arg(roleTypeName(role.type)).arg(roleTypeName(ListLayout::Role::List));
}
} else if (d.isBoolean()) {
roleIndex = setBoolProperty(role, d.booleanValue());
@@ -1516,7 +1516,7 @@ void ModelObject::advanceIterator(Managed *m, ObjectIterator *it, Value *name, u
{
ModelObject *that = static_cast<ModelObject*>(m);
ExecutionEngine *v4 = that->engine();
- name->setM(0);
+ name->setM(nullptr);
*index = UINT_MAX;
if (it->arrayIndex < uint(that->d()->m_model->m_listModel->roleCount())) {
Scope scope(that->engine());
@@ -1564,7 +1564,7 @@ QVector<int> DynamicRoleModelNode::sync(DynamicRoleModelNode *src, DynamicRoleMo
bool modelHasChanges = false;
if (srcModel) {
- if (targetModel == 0)
+ if (targetModel == nullptr)
targetModel = QQmlListModel::createWithOwner(target->m_owner);
modelHasChanges = QQmlListModel::sync(srcModel, targetModel);
@@ -1787,13 +1787,13 @@ QQmlListModel::QQmlListModel(QObject *parent)
{
m_mainThread = true;
m_primary = true;
- m_agent = 0;
+ m_agent = nullptr;
m_dynamicRoles = false;
m_layout = new ListLayout;
m_listModel = new ListModel(m_layout, this);
- m_engine = 0;
+ m_engine = nullptr;
}
QQmlListModel::QQmlListModel(const QQmlListModel *owner, ListModel *data, QV4::ExecutionEngine *engine, QObject *parent)
@@ -1805,7 +1805,7 @@ QQmlListModel::QQmlListModel(const QQmlListModel *owner, ListModel *data, QV4::E
Q_ASSERT(owner->m_dynamicRoles == false);
m_dynamicRoles = false;
- m_layout = 0;
+ m_layout = nullptr;
m_listModel = data;
m_engine = engine;
@@ -1827,7 +1827,7 @@ QQmlListModel::QQmlListModel(QQmlListModel *orig, QQmlListModelWorkerAgent *agen
else
ListModel::sync(orig->m_listModel, m_listModel);
- m_engine = 0;
+ m_engine = nullptr;
}
QQmlListModel::~QQmlListModel()
@@ -1844,10 +1844,10 @@ QQmlListModel::~QQmlListModel()
}
}
- m_listModel = 0;
+ m_listModel = nullptr;
delete m_layout;
- m_layout = 0;
+ m_layout = nullptr;
}
QQmlListModel *QQmlListModel::createWithOwner(QQmlListModel *newOwner)
@@ -1869,7 +1869,7 @@ QQmlListModel *QQmlListModel::createWithOwner(QQmlListModel *newOwner)
QV4::ExecutionEngine *QQmlListModel::engine() const
{
- if (m_engine == 0) {
+ if (m_engine == nullptr) {
m_engine = qmlEngine(this)->handle();
}
@@ -1939,7 +1939,7 @@ bool QQmlListModel::sync(QQmlListModel *src, QQmlListModel *target)
ElementSync &s = elementHash.find(element->getUid()).value();
Q_ASSERT(s.srcIndex >= 0);
DynamicRoleModelNode *targetElement = s.target;
- if (targetElement == 0) {
+ if (targetElement == nullptr) {
targetElement = new DynamicRoleModelNode(target, element->getUid());
}
s.changedRoles = DynamicRoleModelNode::sync(element, targetElement);
@@ -2111,7 +2111,7 @@ QHash<int, QByteArray> QQmlListModel::roleNames() const
*/
void QQmlListModel::setDynamicRoles(bool enableDynamicRoles)
{
- if (m_mainThread && m_agent == 0) {
+ if (m_mainThread && m_agent == nullptr) {
if (enableDynamicRoles) {
if (m_layout->roleCount())
qmlWarning(this) << tr("unable to enable dynamic roles as this model is not empty");
@@ -2605,15 +2605,15 @@ bool QQmlListModelParser::applyProperty(QV4::CompiledData::CompilationUnit *comp
const quint32 targetObjectIndex = binding->value.objectIndex;
const QV4::CompiledData::Object *target = qmlUnit->objectAt(targetObjectIndex);
- ListModel *subModel = 0;
+ ListModel *subModel = nullptr;
if (outterElementIndex == -1) {
subModel = model;
} else {
const ListLayout::Role &role = model->getOrCreateListRole(elementName);
if (role.type == ListLayout::Role::List) {
subModel = model->getListProperty(outterElementIndex, role);
- if (subModel == 0) {
- subModel = new ListModel(role.subLayout, 0);
+ if (subModel == nullptr) {
+ subModel = new ListModel(role.subLayout, nullptr);
QVariant vModel = QVariant::fromValue(subModel);
model->setOrCreateProperty(outterElementIndex, elementName, vModel);
}
@@ -2640,7 +2640,7 @@ bool QQmlListModelParser::applyProperty(QV4::CompiledData::CompilationUnit *comp
QString scriptStr = binding->valueAsScriptString(qmlUnit);
if (definesEmptyList(scriptStr)) {
const ListLayout::Role &role = model->getOrCreateListRole(elementName);
- ListModel *emptyModel = new ListModel(role.subLayout, 0);
+ ListModel *emptyModel = new ListModel(role.subLayout, nullptr);
value = QVariant::fromValue(emptyModel);
} else if (binding->isFunctionExpression()) {
QQmlBinding::Identifier id = binding->value.compiledScriptIndex;
diff --git a/src/qml/types/qqmllistmodel_p.h b/src/qml/types/qqmllistmodel_p.h
index cbb12caa20..0c0859dc80 100644
--- a/src/qml/types/qqmllistmodel_p.h
+++ b/src/qml/types/qqmllistmodel_p.h
@@ -82,7 +82,7 @@ class Q_QML_PRIVATE_EXPORT QQmlListModel : public QAbstractListModel
Q_PROPERTY(bool dynamicRoles READ dynamicRoles WRITE setDynamicRoles)
public:
- QQmlListModel(QObject *parent=0);
+ QQmlListModel(QObject *parent=nullptr);
~QQmlListModel();
QModelIndex index(int row, int column, const QModelIndex &parent) const override;
@@ -125,7 +125,7 @@ private:
// Constructs a flat list model for a worker agent
QQmlListModel(QQmlListModel *orig, QQmlListModelWorkerAgent *agent);
- QQmlListModel(const QQmlListModel *owner, ListModel *data, QV4::ExecutionEngine *engine, QObject *parent=0);
+ QQmlListModel(const QQmlListModel *owner, ListModel *data, QV4::ExecutionEngine *engine, QObject *parent=nullptr);
QV4::ExecutionEngine *engine() const;
diff --git a/src/qml/types/qqmllistmodelworkeragent.cpp b/src/qml/types/qqmllistmodelworkeragent.cpp
index a2750c926a..fe3eaa3198 100644
--- a/src/qml/types/qqmllistmodelworkeragent.cpp
+++ b/src/qml/types/qqmllistmodelworkeragent.cpp
@@ -86,7 +86,7 @@ void QQmlListModelWorkerAgent::release()
void QQmlListModelWorkerAgent::modelDestroyed()
{
- m_orig = 0;
+ m_orig = nullptr;
}
int QQmlListModelWorkerAgent::count() const
diff --git a/src/qml/types/qqmllistmodelworkeragent_p.h b/src/qml/types/qqmllistmodelworkeragent_p.h
index 761a467e89..2120f25744 100644
--- a/src/qml/types/qqmllistmodelworkeragent_p.h
+++ b/src/qml/types/qqmllistmodelworkeragent_p.h
@@ -91,7 +91,7 @@ public:
struct VariantRef
{
- VariantRef() : a(0) {}
+ VariantRef() : a(nullptr) {}
VariantRef(const VariantRef &r) : a(r.a) { if (a) a->addref(); }
VariantRef(QQmlListModelWorkerAgent *_a) : a(_a) { if (a) a->addref(); }
~VariantRef() { if (a) a->release(); }
diff --git a/src/qml/types/qqmlobjectmodel.cpp b/src/qml/types/qqmlobjectmodel.cpp
index 54da0867d4..08740b4a6f 100644
--- a/src/qml/types/qqmlobjectmodel.cpp
+++ b/src/qml/types/qqmlobjectmodel.cpp
@@ -287,7 +287,7 @@ QQmlInstanceModel::ReleaseFlags QQmlObjectModel::release(QObject *item)
if (!d->children[idx].deref())
return QQmlInstanceModel::Referenced;
}
- return 0;
+ return nullptr;
}
QString QQmlObjectModel::stringValue(int index, const QString &name)
@@ -337,7 +337,7 @@ QObject *QQmlObjectModel::get(int index) const
{
Q_D(const QQmlObjectModel);
if (index < 0 || index >= d->children.count())
- return 0;
+ return nullptr;
return d->children.at(index).item;
}
diff --git a/src/qml/types/qqmlobjectmodel_p.h b/src/qml/types/qqmlobjectmodel_p.h
index b3cf45ca62..267828dcdd 100644
--- a/src/qml/types/qqmlobjectmodel_p.h
+++ b/src/qml/types/qqmlobjectmodel_p.h
@@ -92,7 +92,7 @@ Q_SIGNALS:
void destroyingItem(QObject *object);
protected:
- QQmlInstanceModel(QObjectPrivate &dd, QObject *parent = 0)
+ QQmlInstanceModel(QObjectPrivate &dd, QObject *parent = nullptr)
: QObject(dd, parent) {}
private:
@@ -110,7 +110,7 @@ class Q_QML_PRIVATE_EXPORT QQmlObjectModel : public QQmlInstanceModel
Q_CLASSINFO("DefaultProperty", "children")
public:
- QQmlObjectModel(QObject *parent=0);
+ QQmlObjectModel(QObject *parent=nullptr);
~QQmlObjectModel() {}
int count() const override;
diff --git a/src/qml/types/qqmltimer_p.h b/src/qml/types/qqmltimer_p.h
index 7739dad2a6..d597869994 100644
--- a/src/qml/types/qqmltimer_p.h
+++ b/src/qml/types/qqmltimer_p.h
@@ -72,7 +72,7 @@ class Q_QML_PRIVATE_EXPORT QQmlTimer : public QObject, public QQmlParserStatus
Q_PROPERTY(QObject *parent READ parent CONSTANT)
public:
- QQmlTimer(QObject *parent=0);
+ QQmlTimer(QObject *parent=nullptr);
void setInterval(int interval);
int interval() const;
diff --git a/src/qml/types/qquickpackage.cpp b/src/qml/types/qquickpackage.cpp
index e0d1888f33..e8e897bab9 100644
--- a/src/qml/types/qquickpackage.cpp
+++ b/src/qml/types/qquickpackage.cpp
@@ -183,7 +183,7 @@ QObject *QQuickPackage::part(const QString &name)
if (name == QLatin1String("default") && !d->dataList.isEmpty())
return d->dataList.at(0);
- return 0;
+ return nullptr;
}
QQuickPackageAttached *QQuickPackage::qmlAttachedProperties(QObject *o)
diff --git a/src/qml/types/qquickpackage_p.h b/src/qml/types/qquickpackage_p.h
index ca383bfdcb..122c7fcb30 100644
--- a/src/qml/types/qquickpackage_p.h
+++ b/src/qml/types/qquickpackage_p.h
@@ -66,7 +66,7 @@ class Q_AUTOTEST_EXPORT QQuickPackage : public QObject
Q_PROPERTY(QQmlListProperty<QObject> data READ data)
public:
- QQuickPackage(QObject *parent=0);
+ QQuickPackage(QObject *parent=nullptr);
virtual ~QQuickPackage();
QQmlListProperty<QObject> data();
diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp
index 32c0c86ff6..80c2d3a4bc 100644
--- a/src/qml/types/qquickworkerscript.cpp
+++ b/src/qml/types/qquickworkerscript.cpp
@@ -203,7 +203,7 @@ private:
QQuickWorkerScriptEnginePrivate::WorkerEngine::WorkerEngine(QQuickWorkerScriptEnginePrivate *parent)
: QV8Engine(nullptr, new QV4::ExecutionEngine), p(parent)
#if QT_CONFIG(qml_network)
-, accessManager(0)
+, accessManager(nullptr)
#endif
{
m_v4Engine->v8Engine = this;
@@ -290,7 +290,7 @@ QNetworkAccessManager *QQuickWorkerScriptEnginePrivate::WorkerEngine::networkAcc
#endif
QQuickWorkerScriptEnginePrivate::QQuickWorkerScriptEnginePrivate(QQmlEngine *engine)
-: workerEngine(0), qmlengine(engine), m_nextId(0)
+: workerEngine(nullptr), qmlengine(engine), m_nextId(0)
{
}
@@ -507,7 +507,7 @@ QQuickWorkerScriptEngine::~QQuickWorkerScriptEngine()
}
QQuickWorkerScriptEnginePrivate::WorkerScript::WorkerScript()
-: id(-1), initialized(false), owner(0)
+: id(-1), initialized(false), owner(nullptr)
{
}
@@ -534,7 +534,7 @@ void QQuickWorkerScriptEngine::removeWorkerScript(int id)
{
QQuickWorkerScriptEnginePrivate::WorkerScript* script = d->workers.value(id);
if (script) {
- script->owner = 0;
+ script->owner = nullptr;
QCoreApplication::postEvent(d, new WorkerRemoveEvent(id));
}
}
@@ -565,7 +565,7 @@ void QQuickWorkerScriptEngine::run()
qDeleteAll(d->workers);
d->workers.clear();
- delete d->workerEngine; d->workerEngine = 0;
+ delete d->workerEngine; d->workerEngine = nullptr;
}
@@ -616,7 +616,7 @@ void QQuickWorkerScriptEngine::run()
{Threaded ListModel Example}
*/
QQuickWorkerScript::QQuickWorkerScript(QObject *parent)
-: QObject(parent), m_engine(0), m_scriptId(-1), m_componentComplete(true)
+: QObject(parent), m_engine(nullptr), m_scriptId(-1), m_componentComplete(true)
{
}
@@ -696,7 +696,7 @@ QQuickWorkerScriptEngine *QQuickWorkerScript::engine()
QQmlEngine *engine = qmlEngine(this);
if (!engine) {
qWarning("QQuickWorkerScript: engine() called without qmlEngine() set");
- return 0;
+ return nullptr;
}
m_engine = QQmlEnginePrivate::get(engine)->getWorkerScriptEngine();
@@ -707,7 +707,7 @@ QQuickWorkerScriptEngine *QQuickWorkerScript::engine()
return m_engine;
}
- return 0;
+ return nullptr;
}
void QQuickWorkerScript::componentComplete()
diff --git a/src/qml/types/qquickworkerscript_p.h b/src/qml/types/qquickworkerscript_p.h
index 8ea630c685..1a8d2ab076 100644
--- a/src/qml/types/qquickworkerscript_p.h
+++ b/src/qml/types/qquickworkerscript_p.h
@@ -67,7 +67,7 @@ class QQuickWorkerScriptEngine : public QThread
{
Q_OBJECT
public:
- QQuickWorkerScriptEngine(QQmlEngine *parent = 0);
+ QQuickWorkerScriptEngine(QQmlEngine *parent = nullptr);
~QQuickWorkerScriptEngine();
int registerWorkerScript(QQuickWorkerScript *);
@@ -91,7 +91,7 @@ class Q_AUTOTEST_EXPORT QQuickWorkerScript : public QObject, public QQmlParserSt
Q_INTERFACES(QQmlParserStatus)
public:
- QQuickWorkerScript(QObject *parent = 0);
+ QQuickWorkerScript(QObject *parent = nullptr);
~QQuickWorkerScript();
QUrl source() const;
diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp
index 7afafec1fe..b4bebb9d5d 100644
--- a/src/qml/util/qqmladaptormodel.cpp
+++ b/src/qml/util/qqmladaptormodel.cpp
@@ -121,8 +121,8 @@ class VDMModelDelegateDataType
public:
VDMModelDelegateDataType(QQmlAdaptorModel *model)
: model(model)
- , metaObject(0)
- , propertyCache(0)
+ , metaObject(nullptr)
+ , propertyCache(nullptr)
, propertyOffset(0)
, signalOffset(0)
, hasModelData(false)
@@ -176,7 +176,7 @@ public:
const int idx = item->modelIndex();
if (idx >= index && idx < index + count) {
for (int i = 0; i < signalIndexes.count(); ++i)
- QMetaObject::activate(item, signalIndexes.at(i), 0);
+ QMetaObject::activate(item, signalIndexes.at(i), nullptr);
}
}
return changed;
@@ -217,8 +217,8 @@ public:
QV4::ExecutionEngine *v4 = data->v4;
QV4::Scope scope(v4);
QV4::ScopedObject proto(scope, v4->newObject());
- proto->defineAccessorProperty(QStringLiteral("index"), get_index, 0);
- proto->defineAccessorProperty(QStringLiteral("hasModelChildren"), get_hasModelChildren, 0);
+ proto->defineAccessorProperty(QStringLiteral("index"), get_index, nullptr);
+ proto->defineAccessorProperty(QStringLiteral("hasModelChildren"), get_hasModelChildren, nullptr);
QV4::ScopedProperty p(scope);
typedef QHash<QByteArray, int>::const_iterator iterator;
@@ -298,11 +298,11 @@ int QQmlDMCachedModelData::metaCall(QMetaObject::Call call, int id, void **argum
const QMetaObject *meta = metaObject();
if (cachedData.count() > 1) {
cachedData[propertyIndex] = *static_cast<QVariant *>(arguments[0]);
- QMetaObject::activate(this, meta, propertyIndex, 0);
+ QMetaObject::activate(this, meta, propertyIndex, nullptr);
} else if (cachedData.count() == 1) {
cachedData[0] = *static_cast<QVariant *>(arguments[0]);
- QMetaObject::activate(this, meta, 0, 0);
- QMetaObject::activate(this, meta, 1, 0);
+ QMetaObject::activate(this, meta, 0, nullptr);
+ QMetaObject::activate(this, meta, 1, nullptr);
}
} else if (*type->model) {
setValue(type->propertyRoles.at(propertyIndex), *static_cast<QVariant *>(arguments[0]));
@@ -336,7 +336,7 @@ bool QQmlDMCachedModelData::resolveIndex(const QQmlAdaptorModel &, int idx)
const QMetaObject *meta = metaObject();
const int propertyCount = type->propertyRoles.count();
for (int i = 0; i < propertyCount; ++i)
- QMetaObject::activate(this, meta, i, 0);
+ QMetaObject::activate(this, meta, i, nullptr);
return true;
} else {
return false;
@@ -381,11 +381,11 @@ QV4::ReturnedValue QQmlDMCachedModelData::set_property(const QV4::FunctionObject
if (!modelData->cachedData.isEmpty()) {
if (modelData->cachedData.count() > 1) {
modelData->cachedData[propertyId] = scope.engine->toVariant(argv[0], QVariant::Invalid);
- QMetaObject::activate(o->d()->item, o->d()->item->metaObject(), propertyId, 0);
+ QMetaObject::activate(o->d()->item, o->d()->item->metaObject(), propertyId, nullptr);
} else if (modelData->cachedData.count() == 1) {
modelData->cachedData[0] = scope.engine->toVariant(argv[0], QVariant::Invalid);
- QMetaObject::activate(o->d()->item, o->d()->item->metaObject(), 0, 0);
- QMetaObject::activate(o->d()->item, o->d()->item->metaObject(), 1, 0);
+ QMetaObject::activate(o->d()->item, o->d()->item->metaObject(), 0, nullptr);
+ QMetaObject::activate(o->d()->item, o->d()->item->metaObject(), 1, nullptr);
}
}
}
@@ -710,7 +710,7 @@ public:
QMetaObjectBuilder builder;
VDMObjectDelegateDataType()
- : metaObject(0)
+ : metaObject(nullptr)
, propertyOffset(0)
, signalOffset(0)
, shared(true)
@@ -720,7 +720,7 @@ public:
VDMObjectDelegateDataType(const VDMObjectDelegateDataType &type)
: QQmlRefCount()
, QQmlAdaptorModel::Accessors()
- , metaObject(0)
+ , metaObject(nullptr)
, propertyOffset(type.propertyOffset)
, signalOffset(type.signalOffset)
, shared(false)
@@ -759,7 +759,7 @@ public:
dataType->initializeMetaType(model);
return index >= 0 && index < model.list.count()
? new QQmlDMObjectData(metaType, dataType, index, qvariant_cast<QObject *>(model.list.at(index)))
- : 0;
+ : nullptr;
}
void initializeMetaType(QQmlAdaptorModel &)
@@ -807,7 +807,7 @@ public:
QMetaObject::metacall(m_data->object, call, id - m_type->propertyOffset + objectPropertyOffset, arguments);
return -1;
} else if (id >= m_type->signalOffset && call == QMetaObject::InvokeMetaMethod) {
- QMetaObject::activate(m_data, this, id - m_type->signalOffset, 0);
+ QMetaObject::activate(m_data, this, id - m_type->signalOffset, nullptr);
return -1;
} else {
return m_data->qt_metacall(call, id, arguments);
@@ -937,10 +937,10 @@ void QQmlAdaptorModel::setModel(const QVariant &variant, QQmlDelegateModel *vdm,
accessors = new VDMObjectDelegateDataType;
} else if (list.type() != QQmlListAccessor::Invalid
&& list.type() != QQmlListAccessor::Instance) { // Null QObject
- setObject(0);
+ setObject(nullptr);
accessors = &qt_vdm_list_accessors;
} else {
- setObject(0);
+ setObject(nullptr);
accessors = &qt_vdm_null_accessors;
}
}
@@ -960,7 +960,7 @@ bool QQmlAdaptorModel::isValid() const
void QQmlAdaptorModel::objectDestroyed(QObject *)
{
- setModel(QVariant(), 0, 0);
+ setModel(QVariant(), nullptr, nullptr);
}
QQmlAdaptorModelEngineData::QQmlAdaptorModelEngineData(QV4::ExecutionEngine *v4)
@@ -968,7 +968,7 @@ QQmlAdaptorModelEngineData::QQmlAdaptorModelEngineData(QV4::ExecutionEngine *v4)
{
QV4::Scope scope(v4);
QV4::ScopedObject proto(scope, v4->newObject());
- proto->defineAccessorProperty(QStringLiteral("index"), get_index, 0);
+ proto->defineAccessorProperty(QStringLiteral("index"), get_index, nullptr);
proto->defineAccessorProperty(QStringLiteral("modelData"),
QQmlDMListAccessorData::get_modelData, QQmlDMListAccessorData::set_modelData);
listItemProto.set(v4, proto);
diff --git a/src/qml/util/qqmladaptormodel_p.h b/src/qml/util/qqmladaptormodel_p.h
index 7bbddcff07..8f773efa20 100644
--- a/src/qml/util/qqmladaptormodel_p.h
+++ b/src/qml/util/qqmladaptormodel_p.h
@@ -74,7 +74,7 @@ public:
inline Accessors() {}
virtual ~Accessors();
virtual int count(const QQmlAdaptorModel &) const { return 0; }
- virtual void cleanup(QQmlAdaptorModel &, QQmlDelegateModel * = 0) const {}
+ virtual void cleanup(QQmlAdaptorModel &, QQmlDelegateModel * = nullptr) const {}
virtual QVariant value(const QQmlAdaptorModel &, int, const QString &) const {
return QVariant(); }
@@ -82,7 +82,7 @@ public:
virtual QQmlDelegateModelItem *createItem(
QQmlAdaptorModel &,
QQmlDelegateModelItemMetaType *,
- int) const { return 0; }
+ int) const { return nullptr; }
virtual bool notify(
const QQmlAdaptorModel &,
diff --git a/src/qml/util/qqmlchangeset.cpp b/src/qml/util/qqmlchangeset.cpp
index 79e3332331..ba876b42e2 100644
--- a/src/qml/util/qqmlchangeset.cpp
+++ b/src/qml/util/qqmlchangeset.cpp
@@ -120,7 +120,7 @@ void QQmlChangeSet::remove(int index, int count)
{
QVector<Change> removes;
removes.append(Change(index, count));
- remove(&removes, 0);
+ remove(&removes, nullptr);
}
/*!
diff --git a/src/qml/util/qqmlchangeset_p.h b/src/qml/util/qqmlchangeset_p.h
index 8e1fa3f9f2..8bc13f1b67 100644
--- a/src/qml/util/qqmlchangeset_p.h
+++ b/src/qml/util/qqmlchangeset_p.h
@@ -119,7 +119,7 @@ public:
void change(int index, int count);
void insert(const QVector<Change> &inserts);
- void remove(const QVector<Change> &removes, QVector<Change> *inserts = 0);
+ void remove(const QVector<Change> &removes, QVector<Change> *inserts = nullptr);
void move(const QVector<Change> &removes, const QVector<Change> &inserts);
void change(const QVector<Change> &changes);
void apply(const QQmlChangeSet &changeSet);
diff --git a/src/qml/util/qqmllistaccessor.cpp b/src/qml/util/qqmllistaccessor.cpp
index 356584abdc..ad55519ad3 100644
--- a/src/qml/util/qqmllistaccessor.cpp
+++ b/src/qml/util/qqmllistaccessor.cpp
@@ -72,7 +72,7 @@ void QQmlListAccessor::setList(const QVariant &v, QQmlEngine *engine)
if (d.userType() == qMetaTypeId<QJSValue>())
d = d.value<QJSValue>().toVariant();
- QQmlEnginePrivate *enginePrivate = engine?QQmlEnginePrivate::get(engine):0;
+ QQmlEnginePrivate *enginePrivate = engine?QQmlEnginePrivate::get(engine):nullptr;
if (!d.isValid()) {
m_type = Invalid;
diff --git a/src/qml/util/qqmllistaccessor_p.h b/src/qml/util/qqmllistaccessor_p.h
index bad5a5803c..bcd079adef 100644
--- a/src/qml/util/qqmllistaccessor_p.h
+++ b/src/qml/util/qqmllistaccessor_p.h
@@ -63,7 +63,7 @@ public:
~QQmlListAccessor();
QVariant list() const;
- void setList(const QVariant &, QQmlEngine * = 0);
+ void setList(const QVariant &, QQmlEngine * = nullptr);
bool isValid() const;
diff --git a/src/qml/util/qqmllistcompositor.cpp b/src/qml/util/qqmllistcompositor.cpp
index 05a4eaac39..8b0b8f48f0 100644
--- a/src/qml/util/qqmllistcompositor.cpp
+++ b/src/qml/util/qqmllistcompositor.cpp
@@ -1253,7 +1253,7 @@ void QQmlListCompositor::listItemsRemoved(
QVector<QQmlChangeSet::Change> removals;
removals.append(QQmlChangeSet::Change(index, count));
- listItemsRemoved(translatedRemovals, list, &removals, 0, 0);
+ listItemsRemoved(translatedRemovals, list, &removals, nullptr, nullptr);
}
/*!
diff --git a/src/qml/util/qqmllistcompositor_p.h b/src/qml/util/qqmllistcompositor_p.h
index 6ae9c47df3..d5723889e1 100644
--- a/src/qml/util/qqmllistcompositor_p.h
+++ b/src/qml/util/qqmllistcompositor_p.h
@@ -87,7 +87,7 @@ public:
class Range
{
public:
- Range() : next(this), previous(this), list(0), index(0), count(0), flags(0) {}
+ Range() : next(this), previous(this), list(nullptr), index(0), count(0), flags(0) {}
Range(Range *next, void *list, int index, int count, uint flags)
: next(next), previous(next->previous), list(list), index(index), count(count), flags(flags) {
next->previous = this; previous->next = this; }
@@ -222,22 +222,22 @@ public:
const iterator &end() { return m_end; }
- void append(void *list, int index, int count, uint flags, QVector<Insert> *inserts = 0);
- void insert(Group group, int before, void *list, int index, int count, uint flags, QVector<Insert> *inserts = 0);
- iterator insert(iterator before, void *list, int index, int count, uint flags, QVector<Insert> *inserts = 0);
+ void append(void *list, int index, int count, uint flags, QVector<Insert> *inserts = nullptr);
+ void insert(Group group, int before, void *list, int index, int count, uint flags, QVector<Insert> *inserts = nullptr);
+ iterator insert(iterator before, void *list, int index, int count, uint flags, QVector<Insert> *inserts = nullptr);
- void setFlags(Group fromGroup, int from, int count, Group group, int flags, QVector<Insert> *inserts = 0);
- void setFlags(iterator from, int count, Group group, uint flags, QVector<Insert> *inserts = 0);
- void setFlags(Group fromGroup, int from, int count, uint flags, QVector<Insert> *inserts = 0) {
+ void setFlags(Group fromGroup, int from, int count, Group group, int flags, QVector<Insert> *inserts = nullptr);
+ void setFlags(iterator from, int count, Group group, uint flags, QVector<Insert> *inserts = nullptr);
+ void setFlags(Group fromGroup, int from, int count, uint flags, QVector<Insert> *inserts = nullptr) {
setFlags(fromGroup, from, count, fromGroup, flags, inserts); }
- void setFlags(const iterator from, int count, uint flags, QVector<Insert> *inserts = 0) {
+ void setFlags(const iterator from, int count, uint flags, QVector<Insert> *inserts = nullptr) {
setFlags(from, count, from.group, flags, inserts); }
- void clearFlags(Group fromGroup, int from, int count, Group group, uint flags, QVector<Remove> *removals = 0);
- void clearFlags(iterator from, int count, Group group, uint flags, QVector<Remove> *removals = 0);
- void clearFlags(Group fromGroup, int from, int count, uint flags, QVector<Remove> *removals = 0) {
+ void clearFlags(Group fromGroup, int from, int count, Group group, uint flags, QVector<Remove> *removals = nullptr);
+ void clearFlags(iterator from, int count, Group group, uint flags, QVector<Remove> *removals = nullptr);
+ void clearFlags(Group fromGroup, int from, int count, uint flags, QVector<Remove> *removals = nullptr) {
clearFlags(fromGroup, from, count, fromGroup, flags, removals); }
- void clearFlags(const iterator &from, int count, uint flags, QVector<Remove> *removals = 0) {
+ void clearFlags(const iterator &from, int count, uint flags, QVector<Remove> *removals = nullptr) {
clearFlags(from, count, from.group, flags, removals); }
bool verifyMoveTo(Group fromGroup, int from, Group toGroup, int to, int count, Group group) const;
@@ -249,8 +249,8 @@ public:
int to,
int count,
Group group,
- QVector<Remove> *removals = 0,
- QVector<Insert> *inserts = 0);
+ QVector<Remove> *removals = nullptr,
+ QVector<Insert> *inserts = nullptr);
void clear();
void listItemsInserted(void *list, int index, int count, QVector<Insert> *inserts);
@@ -289,13 +289,13 @@ private:
QVector<Remove> *translatedRemovals,
void *list,
QVector<QQmlChangeSet::Change> *removals,
- QVector<QQmlChangeSet::Change> *insertions = 0,
- QVector<MovedFlags> *movedFlags = 0);
+ QVector<QQmlChangeSet::Change> *insertions = nullptr,
+ QVector<MovedFlags> *movedFlags = nullptr);
void listItemsInserted(
QVector<Insert> *translatedInsertions,
void *list,
const QVector<QQmlChangeSet::Change> &insertions,
- const QVector<MovedFlags> *movedFlags = 0);
+ const QVector<MovedFlags> *movedFlags = nullptr);
void listItemsChanged(
QVector<Change> *translatedChanges,
void *list,
@@ -309,7 +309,7 @@ Q_DECLARE_TYPEINFO(QQmlListCompositor::Remove, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(QQmlListCompositor::Insert, Q_PRIMITIVE_TYPE);
inline QQmlListCompositor::iterator::iterator()
- : range(0), offset(0), group(Default), groupCount(0) {}
+ : range(nullptr), offset(0), group(Default), groupCount(0) {}
inline QQmlListCompositor::iterator::iterator(const iterator &it)
: range(it.range)
, offset(it.offset)