From: Roberto Raggi Date: Tue, 9 Aug 2011 13:04:14 +0000 (+0200) Subject: Set the name of the default property X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=bcf5af7423dc496fd70534f0b32cd2ace3a1a5c8;p=konrad%2Fqtdeclarative.git Set the name of the default property Change-Id: I4f69b9e4e33a789215941f8021b8937c8aa2e7c1 Reviewed-on: http://codereview.qt.nokia.com/3783 Reviewed-by: Roberto Raggi --- diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 6c4bbb4..c920a33 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);