diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-02-28 13:06:28 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-02 20:52:46 +0100 |
commit | 735cbe15c20f3a3fde23987b0e1a596d64324f20 (patch) | |
tree | 97790ac814e893d7987dddd50a0e77e03b7e17c6 /src/qml/qml/qqmlobjectcreator.cpp | |
parent | a283fab5bec49cc1588125b3130867796b04e0d0 (diff) |
[new compiler] Fix for tst_qqmlconnections
Make sure to pass onFooChanged handlers to QQmlConnection's custom parser by
not relying on the signal handler converter to set the
IsSignalHandlerExpression flag. That should only be set for real signal
handlers, the custom parser gets the raw bindings.
Also don't try to initialize bindings at creation time the custom parser
covers.
Change-Id: Iae22bc886c312843136f073959e59da440f4184c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 5f0b5f79be..5d6cbba910 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -561,7 +561,7 @@ static QQmlType *qmlTypeForObject(QObject *object) return type; } -void QQmlObjectCreator::setupBindings() +void QQmlObjectCreator::setupBindings(const QBitArray &bindingsToSkip) { QQmlListProperty<void> savedList; qSwap(_currentList, savedList); @@ -641,6 +641,9 @@ void QQmlObjectCreator::setupBindings() } + if (static_cast<int>(i) < bindingsToSkip.size() && bindingsToSkip.testBit(i)) + continue; + if (!setPropertyBinding(property, binding)) return; } @@ -1031,10 +1034,13 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent) if (idEntry != objectIndexToId.constEnd()) context->setIdProperty(idEntry.value(), instance); + QBitArray bindingsToSkip; if (customParser) { - QHash<int, QByteArray>::ConstIterator entry = compiledData->customParserData.find(index); - if (entry != compiledData->customParserData.constEnd()) - customParser->setCustomData(instance, *entry); + QHash<int, QQmlCompiledData::CustomParserData>::ConstIterator entry = compiledData->customParserData.find(index); + if (entry != compiledData->customParserData.constEnd()) { + customParser->setCustomData(instance, entry->compilationArtifact); + bindingsToSkip = entry->bindings; + } } if (isComponent) @@ -1056,7 +1062,7 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent) qSwap(_qmlContext, qmlContext); - bool result = populateInstance(index, instance, cache, /*binding target*/instance, /*value type property*/0, installPropertyCache); + bool result = populateInstance(index, instance, cache, /*binding target*/instance, /*value type property*/0, installPropertyCache, bindingsToSkip); qSwap(_qmlContext, qmlContext); qSwap(_scopeObject, scopeObject); @@ -1136,7 +1142,7 @@ QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interru return sharedState->rootContext; } -bool QQmlObjectCreator::populateInstance(int index, QObject *instance, QQmlRefPointer<QQmlPropertyCache> cache, QObject *bindingTarget, QQmlPropertyData *valueTypeProperty, bool installPropertyCache) +bool QQmlObjectCreator::populateInstance(int index, QObject *instance, QQmlRefPointer<QQmlPropertyCache> cache, QObject *bindingTarget, QQmlPropertyData *valueTypeProperty, bool installPropertyCache, const QBitArray &bindingsToSkip) { const QV4::CompiledData::Object *obj = qmlUnit->objectAt(index); @@ -1177,7 +1183,7 @@ bool QQmlObjectCreator::populateInstance(int index, QObject *instance, QQmlRefPo QVector<QQmlAbstractBinding*> createdBindings(_compiledObject->nBindings, 0); setupFunctions(); - setupBindings(); + setupBindings(bindingsToSkip); qSwap(_vmeMetaObject, vmeMetaObject); qSwap(_bindingTarget, bindingTarget); |