属性
import QtQuick.Layouts
ColumnLayout {
currentIndex: int
//当前可见项的索引
Item {
Layout.minimumWidth(Height): real
//项目最小宽/高度,默认:项目隐式最小宽/高
Layout.maximumWidth(Height): real
//项目最大宽/高度,默认:项目隐式最大宽/高
Layout.preferredWidth(Height): real
//项目首选宽/高度,默认:-1
//值为 -1 时,此属性会失效,布局将用 implicitWidth 代替
Layout.fillWidth(Height): bool
//项目尽可能宽/高,默认:true
//值为 false 时,项目的固定宽/高度为 首选宽/高度
}
}
只读属性
import QtQuick.Layouts
ColumnLayout {
count: int
//布局的项目数量
Item {
StackLayout.index: int
//每个子项的索引
StackLayout.isCurrentItem: bool
//该项目是否为当前项目
StackLayout.layout: StackLayout
//项目所在的 StackLayout 的对象
//可以用 StackLayout 的 id 与返回值进行比较
}
}