import QtQuick 2.12 import QtQuick.Layouts 1.12 import QtQuick.Window 2.12 Window { id: win visible: true width: 540 height: 100 title: "GridLayoutTest" color: "black" GridLayout { id: grid anchors.fill: parent columnSpacing: 10 rowSpacing: 10 Rectangle { Layout.fillHeight: true Layout.fillWidth: true Layout.column: 0 Layout.row: 0 Text { text: "width = " + parent.width } } Rectangle { Layout.fillHeight: true Layout.fillWidth: true Layout.column: 1 Layout.columnSpan: 4 Layout.row: 0 Text { text: "width = " + parent.width } } // dummy cells /* Item { Layout.fillWidth: true Layout.column: 2 // Layout.row: 1 } */ /* Item { Layout.fillWidth: true Layout.column: 4 // Layout.row: 1 } */ } }