diff options
Diffstat (limited to 'src/qml/util/qqmladaptormodel.cpp')
-rw-r--r-- | src/qml/util/qqmladaptormodel.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp index b59e11c5ec..1cc347d6bc 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])); @@ -335,7 +335,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; @@ -380,11 +380,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); } } } @@ -750,7 +750,7 @@ public: QMetaObjectBuilder builder; VDMObjectDelegateDataType() - : metaObject(0) + : metaObject(nullptr) , propertyOffset(0) , signalOffset(0) , shared(true) @@ -760,7 +760,7 @@ public: VDMObjectDelegateDataType(const VDMObjectDelegateDataType &type) : QQmlRefCount() , QQmlAdaptorModel::Accessors() - , metaObject(0) + , metaObject(nullptr) , propertyOffset(type.propertyOffset) , signalOffset(type.signalOffset) , shared(false) @@ -804,7 +804,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 &) @@ -852,7 +852,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); @@ -982,10 +982,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; } } @@ -1036,7 +1036,7 @@ int QQmlAdaptorModel::columnAt(int index) const void QQmlAdaptorModel::objectDestroyed(QObject *) { - setModel(QVariant(), 0, 0); + setModel(QVariant(), nullptr, nullptr); } QQmlAdaptorModelEngineData::QQmlAdaptorModelEngineData(QV4::ExecutionEngine *v4) @@ -1044,7 +1044,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); |