Fix setting the id property when also present in the type itself
Fixes tst_qqmllanguage::idProperty Change-Id: I3051da6a55f29bfca58aa83647fe5d51fb2a67e0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
parent
bbbb33011a
commit
f1901b9289
|
@ -945,6 +945,20 @@ void QmlObjectCreator::setupBindings()
|
|||
bool defaultPropertyQueried = false;
|
||||
QQmlPropertyData *defaultProperty = 0;
|
||||
|
||||
QString id = stringAt(_compiledObject->idIndex);
|
||||
if (!id.isEmpty()) {
|
||||
QQmlPropertyData *idProperty = _propertyCache->property(QStringLiteral("id"), _qobject, context);
|
||||
if (idProperty) {
|
||||
QV4::CompiledData::Binding idBinding;
|
||||
idBinding.propertyNameIndex = 0; // Not used
|
||||
idBinding.flags = 0;
|
||||
idBinding.type = QV4::CompiledData::Binding::Type_String;
|
||||
idBinding.stringIndex = _compiledObject->idIndex;
|
||||
idBinding.location = _compiledObject->location; // ###
|
||||
setPropertyValue(idProperty, &idBinding);
|
||||
}
|
||||
}
|
||||
|
||||
const QV4::CompiledData::Binding *binding = _compiledObject->bindingTable();
|
||||
for (quint32 i = 0; i < _compiledObject->nBindings; ++i, ++binding) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue