diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2011-08-09 15:04:14 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-30 13:18:28 +0200 |
commit | bcf5af7423dc496fd70534f0b32cd2ace3a1a5c8 (patch) | |
tree | 33401756e7d834c7b9f94c45aea88619f1642453 /src/declarative/qml/qdeclarativecompiler.cpp | |
parent | 8a660a7f684f0a0d8aa03a57fad1ad399110e2f5 (diff) |
Set the name of the default property
Change-Id: I4f69b9e4e33a789215941f8021b8937c8aa2e7c1
Reviewed-on: http://codereview.qt.nokia.com/3783
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/declarative/qml/qdeclarativecompiler.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativecompiler.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 6c4bbb4d8f..c920a33852 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -873,7 +873,7 @@ bool QDeclarativeCompiler::buildObject(QDeclarativeParser::Object *obj, const Bi } } - if (!explicitProperty) + if (!explicitProperty) defaultProperty->setName(r); } else { @@ -1578,6 +1578,13 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeParser::Property *prop, prop->value->metatype = type->attachedPropertiesType(); } else { // Setup regular property data + if (prop->isDefault) { + QMetaProperty p = QDeclarativeMetaType::defaultProperty(metaObject); + + if (p.name()) + prop->setName(p.name()); + } + bool notInRevision = false; QDeclarativePropertyCache::Data *d = prop->name().isEmpty()?0:property(obj, prop->name(), ¬InRevision); |