Binding Loop Width/Height
Solved
QML and Qt Quick
-
Hello,
DeviceFactory.qml
import QtQuick 6.0 import QtQuick.Layouts 6.0 import QtQuick.Controls 6.0 Item { id: root Component.onCompleted: { console.log("ITEM WIDTH " + width) console.log("ITEM HEIGHT " + height) } width: childrenRect.width height: childrenRect.height Repeater { model: privateProperties.devicesPopulated ? privateProperties.devices.length : 0 Label { anchors.centerIn: parent text:"TEST" } } QtObject { id: privateProperties property bool devicesPopulated: false property var devices: { let list = [] for (var i = 0; i < 5; i++) { list.push(1) } devicesPopulated = true return list } } }
QML DeviceFactory: Binding loop detected for property "width"
QML DeviceFactory: Binding loop detected for property "height"
Why is that a binding loop?
I use the DeviceFactories width/height in the parent component of DeviceFactory. If I do not set width/height like in my example, the parent component always ready width/height = 0.
-
From the above code it does not seem like a binding loop. Show us the code where you are using this.
-