Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.0
-
None
-
57e272fbd (dev), 91d512789 (6.5)
Description
With 6.5, setting a 'color' property to a Qt.binding() in initial properties silently fails and the binding is never evaluated. The same assignment works normally after construction. Only certain property types like 'color' are affected; qreal and string properties are fine.
Example:
import QtQuick Item { id: root Component { id: rectangle Rectangle { } } Component.onCompleted: { let colorCalled = false let radiusCalled = false let obj = rectangle.createObject(root, { color: Qt.binding(() => { colorCalled = true; return '#ff0000' }), radius: Qt.binding(() => { radiusCalled = true; return 5 }) }) console.warn("color", obj.color, "evaluated", colorCalled) console.warn("radius", obj.radius, "evaluated", radiusCalled) } }
Output with 6.5.0:
qml: color #000000 evaluated false qml: radius 5 evaluated true
Expected output:
qml: color #ff0000 evaluated true qml: radius 5 evaluated true