FluentUI/example/qml/page/T_GroupBox.qml

81 lines
2.0 KiB
QML
Raw Permalink Normal View History

2024-03-31 10:59:15 +08:00
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "../component"
FluScrollablePage{
title: qsTr("GroupBox")
FluGroupBox {
title: qsTr("CheckBox Group")
ColumnLayout {
spacing: 10
anchors.fill: parent
FluCheckBox { text: qsTr("E-mail") }
FluCheckBox { text: qsTr("Calendar") }
FluCheckBox { text: qsTr("Contacts") }
}
}
FluGroupBox {
title: qsTr("RadioButton Group")
Layout.fillWidth: true
Layout.preferredHeight: 150
Layout.topMargin: 20
2024-03-31 10:59:15 +08:00
FluRadioButtons {
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
2024-03-31 10:59:15 +08:00
spacing: 10
disabled: radio_button_switch.checked
2024-03-31 10:59:15 +08:00
FluRadioButton { text: qsTr("E-mail") }
FluRadioButton { text: qsTr("Calendar") }
FluRadioButton { text: qsTr("Contacts") }
}
FluToggleSwitch{
id: radio_button_switch
anchors{
right: parent.right
verticalCenter: parent.verticalCenter
}
text: qsTr("Disabled")
}
2024-03-31 10:59:15 +08:00
}
2024-03-31 10:59:15 +08:00
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: 4
code:`
FluGroupBox {
2024-03-31 10:59:15 +08:00
title: qsTr("CheckBox Group")
ColumnLayout {
spacing: 10
anchors.fill: parent
FluCheckBox { text: qsTr("E-mail") }
FluCheckBox { text: qsTr("Calendar") }
FluCheckBox { text: qsTr("Contacts") }
}
}
FluGroupBox {
title: qsTr("RadioButton Group")
FluRadioButtons {
spacing: 10
disabled: true // 禁用所有FluRadioButton子组件
manuallyDisabled: true // 是否指定每个FluRadioButton上的disabled选项
FluRadioButton { text: qsTr("E-mail") }
FluRadioButton { text: qsTr("Calendar") }
FluRadioButton { text: qsTr("Contacts") }
}
}
`
2024-03-31 10:59:15 +08:00
}
}