import QtQuick.Layouts
GridLayout {
rowSpacing: real
//每行间距,默认:5
columnSpacing: real
//每列间距,默认:5
rows: int
//行数,默认:无限制
//若 flow 值为 GridLayout.TopToBottom,则该属性为定位项目的列限制
columns: int
//列数,默认:无限制
//若 flow 值为 GridLayout.LeftToRight,则该属性为定位项目的列限制
flow: enumeration //流排列方式,与 columns 或rows 属性一起使用
flow: GridLayout.LeftToRight //优先横向排列,行满切换到下一行,默认
flow: GridLayout.TopToBottom //优先纵向排列,列满切换到下一列
layoutDirection: enumeration //网格排列方式
layoutDirection: Qt.LeftToRight //项目从左到右排列,默认
layoutDirection: Qt.RightToLeft //项目从右向左排列
uniformCellWidths(Heights) : bool
//强制所有单元格(非项目)具有统一宽/高,默认:false
Item {
Layout.row: int
//项目的行位置,默认:0
Layout.column: int
//项目的列位置,默认:0
Layout.rowSpan: int
//合并行数,默认:1
Layout.columnSpan: int
//合并列数,默认:1
Layout.minimumWidth(Height): real
//项目最小宽/高度,默认:项目隐式最小宽/高
Layout.maximumWidth(Height): real
//项目最大宽/高度,默认:项目隐式最大宽/高
Layout.preferredWidth(Height): real
//项目首选宽/高度,默认:-1
//值为 -1 时,此属性会失效,布局将用 implicitWidth 代替
Layout.fillWidth(Height): bool
//项目尽可能宽/高,默认:项目隐式内置的尺寸策略
//值为 false 时,项目的固定宽/高度为 首选宽/高度
//对齐方式
Layout.alignment: Qt.Alignment
Layout.alignment: Qt.AlignTop
Layout.alignment: Qt.AlignBottom
Layout.alignment: Qt.AlignLeft
Layout.alignment: Qt.AlignRight
Layout.alignment: Qt.AlignHCenter //水平居中
Layout.alignment: Qt.AlignVCenter //垂直居中
Layout.alignment: Qt.AlignCenter //水平、垂直居中
Layout.alignment: Qt.AlignBaseline //与基线对齐
//margin
Layout.margins: real //默认:0
Layout.topMargin: real //默认使用 Layout.margins 值
Layout.bottomMargin: real //默认使用 Layout.margins 值
Layout.leftMargin: real //默认使用 Layout.margins 值
Layout.rightMargin: real //默认使用 Layout.margins 值
Layout.horizontalStretchFactor: int
//水平拉伸因子,默认项目具有相同大小
//若第一个项目为 1 ,第二个项目为 2 ,则总空间为 3
//默认:-1,即不使用拉伸因子
//启用前,需设置 Layout.fillWidth 值为 true
Layout.verticalStretchFactor: int
//垂直拉伸因子,默认项目具有相同大小
//若第一个项目为 1 ,第二个项目为 2 ,则总空间为 3
//默认:-1,即不使用拉伸因子
//启用前,需设置 Layout.fillHeight 值为 true
}
}