diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-04-11 14:14:10 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-06-04 11:13:35 +0200 |
commit | 632f88c5a66d325fb159423dcaa572fdbc49ae87 (patch) | |
tree | 68688b26836f9bca9c928c4199048d7353afb95f /src/qml | |
parent | 70912a34836001d93f611586aa363003bce8cae3 (diff) |
QML: Reset the binding name when synthesizing components
The binding that creates the element inside of a Component has no name.
Fixes: QTBUG-101655
(cherry picked from commit 45dcac12e53fe08018501ec651ec9c5423cfbff9)
Change-Id: I7023aa6b014dfc54b3ff84de03e4d5822a2738cb
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/qml/qqmltypecompiler.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/qml/qqmltypecompiler.cpp b/src/qml/qml/qqmltypecompiler.cpp index 439987af47..a6a8b9126e 100644 --- a/src/qml/qml/qqmltypecompiler.cpp +++ b/src/qml/qml/qqmltypecompiler.cpp @@ -855,6 +855,10 @@ void QQmlComponentAndAliasResolver::findAndRegisterImplicitComponents(const QmlI QmlIR::Binding *syntheticBinding = pool->New<QmlIR::Binding>(); *syntheticBinding = *binding; + + // The synthetic binding inside Component has no name. It's just "Component { Foo {} }". + syntheticBinding->propertyNameIndex = 0; + syntheticBinding->type = QV4::CompiledData::Binding::Type_Object; QString error = syntheticComponent->appendBinding(syntheticBinding, /*isListBinding*/false); Q_ASSERT(error.isEmpty()); |