-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
6.8.3, 6.9.2
-
None
Given the following code
MyObject.qml
import QtQuick QtObject { property var foo: "bla" }
Main.qml
import QtQuick import QtQuick.Controls Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Control { anchors.fill: parent MyObject { id: my foo: foo } property Item myprop: Item { id: foo } contentItem: Text { text: String(my.foo) } } }
According to Qt documentation, the line "foo: foo" should set the property "foo" to the object with "id: foo". The expected behavior is then that the window should display something like "QQuickItem(0x...)".
However when cachegen is enabled, the line "foo: foo" binds the property "foo" to itself, creating a binding loop. And the window displays "bla".
When "NO_CACHEGEN" is set in qt_add_qml_module(), the expected behavior occurs.
This seems to happen only when the object with the "foo: foo" binding and the object with "id: foo' are separated by a property assignation.
Binding loop
MyItem { id: my foo: foo // Binding loop, they are "separated" by the contentItem } contentItem: Text { text: String(my.foo) Item { id: foo } }
No binding loop
contentItem: Text { text: String(my.foo) Item { id: foo } MyItem { id: my foo: foo //No binding loop, they are both inside the contenItem } }
For Gerrit Dashboard: QTBUG-140041 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
676004,1 | WIP: Test for QTBUG-140041 | dev | qt/qtdeclarative | Status: NEW | -2 | 0 |