aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index 2cacb0e546..24a8327722 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -588,8 +588,7 @@ void QmlObjectCreator::setupBindings()
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()) {
@@ -615,13 +614,8 @@ void QmlObjectCreator::setupBindings()
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 };