QML - How to correctly set an implicitWith to a GridLayout
问题 I'm using Qml 5.12 and basically trying to set an implicitWidth to a GridLayout. For that, I have a purple rectangle and set the rectangle's width to the GridLayout. The red rectangle fit with the GridLayout so I can see the width of my GridLayout. Here's my code: Rectangle { anchors.fill: gl; color: "red"; opacity: 0.22 } Rectangle { id: rect; width: 350; height: 30; color: "purple"; } GridLayout { id: gl y: 35 implicitWidth: rect.width columns: 2 Label { text: "This is a test" } SpinBox {