-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.8.3, 6.9.2
-
None
-
-
ecf78f319 (dev), 5580964be (6.10), 0c42a786f (tqtc/lts-6.8)
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,9 | QmlCompiler: Properly handle uncertain component status | dev | qt/qtdeclarative | Status: MERGED | +2 | +1 |
| 677213,2 | QmlCompiler: Properly handle uncertain component status | 6.10 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 677255,3 | QmlCompiler: Properly handle uncertain component status | tqtc/lts-6.8 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |