diff options
Diffstat (limited to 'src/qml/compiler/qqmlpropertycachecreator_p.h')
-rw-r--r-- | src/qml/compiler/qqmlpropertycachecreator_p.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/qml/compiler/qqmlpropertycachecreator_p.h b/src/qml/compiler/qqmlpropertycachecreator_p.h index 3c14abc019..8fc8943366 100644 --- a/src/qml/compiler/qqmlpropertycachecreator_p.h +++ b/src/qml/compiler/qqmlpropertycachecreator_p.h @@ -211,12 +211,12 @@ inline QQmlPropertyCache *QQmlPropertyCacheCreator<ObjectContainer>::propertyCac } else if (context.instantiatingBinding && context.instantiatingBinding->isAttachedProperty()) { auto *typeRef = objectContainer->resolvedTypes.value(context.instantiatingBinding->propertyNameIndex); Q_ASSERT(typeRef); - QQmlType *qmltype = typeRef->type; - if (!qmltype) { + QQmlType qmltype = typeRef->type; + if (!qmltype.isValid()) { QString propertyName = stringAt(context.instantiatingBinding->propertyNameIndex); if (imports->resolveType(propertyName, &qmltype, 0, 0, 0)) { - if (qmltype->isComposite()) { - QQmlTypeData *tdata = enginePrivate->typeLoader.getType(qmltype->sourceUrl()); + if (qmltype.isComposite()) { + QQmlTypeData *tdata = enginePrivate->typeLoader.getType(qmltype.sourceUrl()); Q_ASSERT(tdata); Q_ASSERT(tdata->isComplete()); @@ -228,7 +228,7 @@ inline QQmlPropertyCache *QQmlPropertyCacheCreator<ObjectContainer>::propertyCac } } - const QMetaObject *attachedMo = qmltype ? qmltype->attachedPropertiesType(enginePrivate) : 0; + const QMetaObject *attachedMo = qmltype.attachedPropertiesType(enginePrivate); if (!attachedMo) { *error = QQmlCompileError(context.instantiatingBinding->location, QQmlPropertyCacheCreatorBase::tr("Non-existent attached object")); return nullptr; @@ -395,12 +395,12 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj // lazily resolved type Q_ASSERT(param->type == QV4::CompiledData::Property::Custom); const QString customTypeName = stringAt(param->customTypeNameIndex); - QQmlType *qmltype = 0; + QQmlType qmltype; if (!imports->resolveType(customTypeName, &qmltype, 0, 0, 0)) return QQmlCompileError(s->location, QQmlPropertyCacheCreatorBase::tr("Invalid signal parameter type: %1").arg(customTypeName)); - if (qmltype->isComposite()) { - QQmlTypeData *tdata = enginePrivate->typeLoader.getType(qmltype->sourceUrl()); + if (qmltype.isComposite()) { + QQmlTypeData *tdata = enginePrivate->typeLoader.getType(qmltype.sourceUrl()); Q_ASSERT(tdata); Q_ASSERT(tdata->isComplete()); @@ -410,7 +410,7 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj tdata->release(); } else { - paramTypes[i + 1] = qmltype->typeId(); + paramTypes[i + 1] = qmltype.typeId(); } } } @@ -475,14 +475,14 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj Q_ASSERT(p->type == QV4::CompiledData::Property::CustomList || p->type == QV4::CompiledData::Property::Custom); - QQmlType *qmltype = 0; + QQmlType qmltype; if (!imports->resolveType(stringAt(p->customTypeNameIndex), &qmltype, 0, 0, 0)) { return QQmlCompileError(p->location, QQmlPropertyCacheCreatorBase::tr("Invalid property type")); } - Q_ASSERT(qmltype); - if (qmltype->isComposite()) { - QQmlTypeData *tdata = enginePrivate->typeLoader.getType(qmltype->sourceUrl()); + Q_ASSERT(qmltype.isValid()); + if (qmltype.isComposite()) { + QQmlTypeData *tdata = enginePrivate->typeLoader.getType(qmltype.sourceUrl()); Q_ASSERT(tdata); Q_ASSERT(tdata->isComplete()); @@ -497,9 +497,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj tdata->release(); } else { if (p->type == QV4::CompiledData::Property::Custom) { - propertyType = qmltype->typeId(); + propertyType = qmltype.typeId(); } else { - propertyType = qmltype->qListTypeId(); + propertyType = qmltype.qListTypeId(); } } @@ -675,8 +675,8 @@ inline void QQmlPropertyCacheAliasCreator<ObjectContainer>::propertyDataForAlias auto *typeRef = objectContainer->resolvedTypes.value(targetObject.inheritedTypeNameIndex); Q_ASSERT(typeRef); - if (typeRef->type) - *type = typeRef->type->typeId(); + if (typeRef->type.isValid()) + *type = typeRef->type.typeId(); else *type = typeRef->compilationUnit->metaTypeId; |