QML Layouts: How to give weights to items in a row or column layout?
问题 I'm trying to figure out a way to layout items proportionally by specifying a kind of weight for each item. For example the way Android does their layouts. The way I'm trying to achieve it is like so: import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 GridLayout { columns: 4 width: 640 height: 480 Rectangle { color: "red" Layout.fillHeight: true Layout.fillWidth: true Layout.columnSpan: 1 } Rectangle { color: "#80000000" Layout.fillHeight: true Layout.fillWidth: true