Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.7.0
-
None
-
-
c9d7620bc (dev), bd75b606c (6.8), 3b4ec8930 (6.7), ed3a38733 (tqtc/lts-6.5), b0a0eb700 (tqtc/lts-6.2)
Description
Normally I would expect that changing the height of the width from the outside would also overwrite the internal binding. But in this case, the internal binding intervenes and the height and width are exceeded again.
Main.qml
import QtQuickWindow { width: 640 height: 480 visible: true title: qsTr("Hello Binding") SimpleWidget { width: 20 height: 400 } }
SimpleWidget.qml
import QtQuickItem { id: outer Rectangle { id: inner color: "green" width: style.width height: style.height } width: inner.width height: inner.height onWidthChanged: { if (width !== inner.width) { inner.width = width #overwrite binding } } onHeightChanged: { if (height !== inner.height) { inner.height = height #overwrite binding } } QtObject { id: style property int width: 50 property int height: 50 } }
Logging of size changes from the inner Rectangle:
qml: inner rectangle height change: 400
qml: inner rectangle width change: 20
qml: inner rectangle height change: 50
qml: inner rectangle width change: 50
It feels a little bit like QTBUG-122962