QGroupBox

Inheritance diagram of PySide2.QtWidgets.QGroupBox

Synopsis

Functions

Slots

Signals

Detailed Description

The PySide2.QtWidgets.QGroupBox widget provides a group box frame with a title.

../../_images/windows-groupbox.png

A group box provides a frame, a title on top, a keyboard shortcut, and displays various other widgets inside itself. The keyboard shortcut moves keyboard focus to one of the group box’s child widgets.

PySide2.QtWidgets.QGroupBox also lets you set the PySide2.QtWidgets.QGroupBox.title() (normally set in the constructor) and the title’s alignment . Group boxes can be checkable() . Child widgets in checkable group boxes are enabled or disabled depending on whether or not the group box is checked() .

You can minimize the space consumption of a group box by enabling the flat() property. In most styles , enabling this property results in the removal of the left, right and bottom edges of the frame.

PySide2.QtWidgets.QGroupBox doesn’t automatically lay out the child widgets (which are often PySide2.QtWidgets.QCheckBox es or PySide2.QtWidgets.QRadioButton s but can be any widgets). The following example shows how we can set up a PySide2.QtWidgets.QGroupBox with a layout:

groupBox = QGroupBox("Exclusive Radio Buttons")

radio1 = QRadioButton("&Radio button 1")
radio2 = QRadioButton("R&adio button 2")
radio3 = QRadioButton("Ra&dio button 3")

radio1.setChecked(True)


vbox = QVBoxLayout()
vbox.addWidget(radio1)
vbox.addWidget(radio2)
vbox.addWidget(radio3)
vbox.addStretch(1)
groupBox.setLayout(vbox)
class PySide2.QtWidgets.QGroupBox([parent=nullptr])
class PySide2.QtWidgets.QGroupBox(title[, parent=nullptr])
Parameters:

Constructs a group box widget with the given parent but with no title.

Constructs a group box with the given title and parent .

PySide2.QtWidgets.QGroupBox.alignment()
Return type:PySide2.QtCore.Qt.Alignment
PySide2.QtWidgets.QGroupBox.clicked([checked=false])
Parameters:checkedPySide2.QtCore.bool
PySide2.QtWidgets.QGroupBox.initStyleOption(option)
Parameters:optionPySide2.QtWidgets.QStyleOptionGroupBox

Initialize option with the values from this PySide2.QtWidgets.QGroupBox . This method is useful for subclasses when they need a PySide2.QtWidgets.QStyleOptionGroupBox , but don’t want to fill in all the information themselves.

PySide2.QtWidgets.QGroupBox.isCheckable()
Return type:PySide2.QtCore.bool
PySide2.QtWidgets.QGroupBox.isChecked()
Return type:PySide2.QtCore.bool
PySide2.QtWidgets.QGroupBox.isFlat()
Return type:PySide2.QtCore.bool
PySide2.QtWidgets.QGroupBox.setAlignment(alignment)
Parameters:alignmentPySide2.QtCore.int
PySide2.QtWidgets.QGroupBox.setCheckable(checkable)
Parameters:checkablePySide2.QtCore.bool
PySide2.QtWidgets.QGroupBox.setChecked(checked)
Parameters:checkedPySide2.QtCore.bool
PySide2.QtWidgets.QGroupBox.setFlat(flat)
Parameters:flatPySide2.QtCore.bool
PySide2.QtWidgets.QGroupBox.setTitle(title)
Parameters:title – unicode
PySide2.QtWidgets.QGroupBox.title()
Return type:unicode
PySide2.QtWidgets.QGroupBox.toggled(arg__1)
Parameters:arg__1PySide2.QtCore.bool