From 76f5e9e7d1eea8d688d5459b7b7b2bfa3f9057ed Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 8 Apr 2010 14:19:28 +1000 Subject: Don't optimized extended type construction --- src/declarative/qml/qdeclarativecompiler.cpp | 2 +- src/declarative/qml/qdeclarativemetatype.cpp | 7 +++++++ src/declarative/qml/qdeclarativemetatype_p.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index b12d6f4..f20ffa6 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -882,7 +882,7 @@ void QDeclarativeCompiler::genObject(QDeclarativeParser::Object *obj) // Create the object if (obj->custom.isEmpty() && output->types.at(obj->type).type && - obj != compileState.root) { + !output->types.at(obj->type).type->isExtendedType() && obj != compileState.root) { QDeclarativeInstruction create; create.type = QDeclarativeInstruction::CreateSimpleObject; diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp index 56cc219..7b71608 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/declarative/qml/qdeclarativemetatype.cpp @@ -328,6 +328,13 @@ bool QDeclarativeType::isCreatable() const return d->m_newFunc != 0; } +bool QDeclarativeType::isExtendedType() const +{ + d->init(); + + return !d->m_metaObjects.isEmpty(); +} + bool QDeclarativeType::isInterface() const { return d->m_isInterface; diff --git a/src/declarative/qml/qdeclarativemetatype_p.h b/src/declarative/qml/qdeclarativemetatype_p.h index 96e3c74..70b7c90 100644 --- a/src/declarative/qml/qdeclarativemetatype_p.h +++ b/src/declarative/qml/qdeclarativemetatype_p.h @@ -122,6 +122,7 @@ public: QDeclarativeCustomParser *customParser() const; bool isCreatable() const; + bool isExtendedType() const; bool isInterface() const; int typeId() const; -- cgit v0.12