构建一个网站需要什么,自己的网站服务器,建行网站,手机网站seo软件一.ColumnLayout讲解 QML中的ColumnLayout是一种布局元素#xff0c;用于在垂直列中排列其子元素。它的主要使用下列附加属性: Layout.minimumWidth Layout.minimumHeight Layout.preferredWidth Layout.preferredHeight Layout.maximumWidth Layout.maximumHeight Layout.fil…一.ColumnLayout讲解 QML中的ColumnLayout是一种布局元素用于在垂直列中排列其子元素。它的主要使用下列附加属性: Layout.minimumWidth Layout.minimumHeight Layout.preferredWidth Layout.preferredHeight Layout.maximumWidth Layout.maximumHeight Layout.fillWidth Layout.fillHeight Layout.alignment 二.ColumnLayout使用示例
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Layouts 1.12Window {visible: truewidth: 640height: 480title: qsTr(ColumnLayout Example)ColumnLayout {anchors.fill: parentanchors.margins: 10spacing: 10Rectangle {color: redLayout.preferredWidth: 100Layout.preferredHeight: 100}//填充布局区域所在的宽和高Rectangle {color: greenLayout.fillWidth: true;Layout.fillHeight: true;}Rectangle {color: blueLayout.preferredWidth: 100Layout.preferredHeight: 100}}
}
运行结果