GroupBox QML Type
A group box control. More...
Import Statement: | import Qt.labs.controls 1.0 |
Inherits: |
Properties
Detailed Description
GroupBox is used to layout a logical group of controls together, within a titled visual frame. GroupBox does not provide a layout of its own, but requires you to position its contents, for instance by creating a RowLayout or a ColumnLayout.
If only a single item is used within a GroupBox, it will resize to fit the implicit size of its contained item. This makes it particularly suitable for use together with layouts.
GroupBox { title: qsTr("Synchronize") ColumnLayout { anchors.fill: parent CheckBox { text: qsTr("E-mail") } CheckBox { text: qsTr("Calendar") } CheckBox { text: qsTr("Contacts") } } }
Checkable GroupBox
Even though GroupBox has no built-in check box, it is straightforward to create a checkable GroupBox by pairing it with a CheckBox.
It is a common pattern to enable or disable the groupbox's children when its check box is toggled on/off, respectively, but the semantics of the check box is left to the application to decide.
GroupBox { label: CheckBox { id: checkBox checked: true text: qsTr("Synchronize") } ColumnLayout { anchors.fill: parent enabled: checkBox.checked CheckBox { text: qsTr("E-mail") } CheckBox { text: qsTr("Calendar") } CheckBox { text: qsTr("Contacts") } } }
Note: Types in the Qt.labs module are not guaranteed to remain compatible in future versions.
See also CheckBox, Customizing GroupBox, and Container Controls.
Property Documentation
label : Item |
This property holds the label item that visualizes title.
See also Customizing GroupBox.
© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.