PropertyResolver propertyResolver(propertyCache);
- bool defaultPropertyQueried = false;
- QQmlPropertyData *defaultProperty = 0;
+ QQmlPropertyData *defaultProperty = obj->indexOfDefaultProperty != -1 ? propertyCache->parent()->defaultProperty() : propertyCache->defaultProperty();
for (QtQml::Binding *binding = obj->bindings->first; binding; binding = binding->next) {
if (binding->type != QV4::CompiledData::Binding::Type_Object)
bool notInRevision = false;
pd = propertyResolver.property(propertyName, ¬InRevision);
} else {
- if (!defaultPropertyQueried) {
- defaultProperty = propertyCache->defaultProperty();
- defaultPropertyQueried = true;
- }
pd = defaultProperty;
}
if (!pd || !pd->isQObject())
PropertyResolver propertyResolver(propertyCache);
- QQmlPropertyData *defaultProperty = propertyCache->defaultProperty();
+ QQmlPropertyData *defaultProperty = obj->indexOfDefaultProperty != -1 ? propertyCache->parent()->defaultProperty() : propertyCache->defaultProperty();
const QV4::CompiledData::Binding *binding = obj->bindingTable();
for (quint32 i = 0; i < obj->nBindings; ++i, ++binding) {
// it will be the name of the attached type.
quint32 inheritedTypeNameIndex;
quint32 idIndex;
- quint32 indexOfDefaultProperty;
+ qint32 indexOfDefaultProperty; // -1 means no default property declared in this object
quint32 nFunctions;
quint32 offsetToFunctions;
quint32 nProperties;
qSwap(_currentList, savedList);
QQmlPropertyData *property = 0;
- bool defaultPropertyQueried = false;
- QQmlPropertyData *defaultProperty = 0;
+ QQmlPropertyData *defaultProperty = _compiledObject->indexOfDefaultProperty != -1 ? _propertyCache->parent()->defaultProperty() : _propertyCache->defaultProperty();
QString id = stringAt(_compiledObject->idIndex);
if (!id.isEmpty()) {
if (!property || (i > 0 && (binding - 1)->propertyNameIndex != binding->propertyNameIndex)) {
if (!name.isEmpty())
property = _propertyCache->property(name, _qobject, context);
- else {
- if (!defaultPropertyQueried) {
- defaultProperty = _propertyCache->defaultProperty();
- defaultPropertyQueried = true;
- }
+ else
property = defaultProperty;
- }
if (property && property->isQList()) {
void *argv[1] = { (void*)&_currentList };