aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlbinding.cpp
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/qml/qqmlbinding.cpp
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/qml/qqmlbinding.cpp')
-rw-r--r--src/qml/qml/qqmlbinding.cpp16
1 files changed, 8 insertions, 8 deletions
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;
}