Skip to content

GroupBox

Qt Base Class: QGroupBox

Signature: QGroupBox(self, parent: Optional[PySide6.QtWidgets.QWidget] = None) -> None QGroupBox(self, title: str, parent: Optional[PySide6.QtWidgets.QWidget] = None) -> None

Base classes

Name Children Inherits
WidgetMixin
prettyqt.widgets.widget
QGroupBox
PySide6.QtWidgets
QGroupBox(self, parent: Optional[PySide6.QtWidgets.QWidget] \= None) -> None

Subclasses

Class Module Description
OptionalWidget prettyqt.custom_widgets.optionalwidget
FlagSelectionWidget prettyqt.custom_widgets.editors.flagselectionwidget
StringOrNumberWidget prettyqt.custom_widgets.editors.stringornumberwidget
SelectionWidget prettyqt.custom_widgets.editors.selectionwidget

⋔ Inheritance diagram

graph TD
  1473296374960["widgets.GroupBox"]
  1473293688240["widgets.WidgetMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473245548480["gui.PaintDeviceMixin"]
  1473290638864["QtWidgets.QGroupBox"]
  1473290849680["QtWidgets.QWidget"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473300082368["QtGui.QPaintDevice"]
  1473293688240 --> 1473296374960
  1473299815024 --> 1473293688240
  140713234304496 --> 1473299815024
  1473245548480 --> 1473293688240
  140713234304496 --> 1473245548480
  1473290638864 --> 1473296374960
  1473290849680 --> 1473290638864
  1473288842240 --> 1473290849680
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208
  1473300082368 --> 1473290849680
  1473291690208 --> 1473300082368

🛈 DocStrings

Bases: WidgetMixin, QGroupBox

Group box frame with a title.

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.

Source code in prettyqt\widgets\groupbox.py
class GroupBox(widgets.WidgetMixin, widgets.QGroupBox):
    """Group box frame with a title.

    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.
    """

    def __repr__(self):
        return get_repr(self, self.title())

    def set_title(self, title: str):
        self.setTitle(title)

    def set_alignment(
        self, alignment: constants.HorizontalAlignmentStr | constants.AlignmentFlag
    ):
        """Set the title alignment of the groupbox.

        Args:
            alignment: title alignment for the groupbox
        """
        self.setAlignment(constants.H_ALIGNMENT.get_enum_value(alignment))

    def get_alignment(self) -> constants.HorizontalAlignmentStr:
        """Return current title alignment.

        Returns:
            title alignment
        """
        return constants.H_ALIGNMENT.inverse[self.alignment()]

    def set_enabled(self, state):
        for widget in self.layout():
            widget.setEnabled(state)

get_alignment() -> constants.HorizontalAlignmentStr

Return current title alignment.

Source code in prettyqt\widgets\groupbox.py
def get_alignment(self) -> constants.HorizontalAlignmentStr:
    """Return current title alignment.

    Returns:
        title alignment
    """
    return constants.H_ALIGNMENT.inverse[self.alignment()]

set_alignment(alignment: constants.HorizontalAlignmentStr | constants.AlignmentFlag)

Set the title alignment of the groupbox.

Parameters:

Name Type Description Default
alignment HorizontalAlignmentStr | AlignmentFlag

title alignment for the groupbox

required
Source code in prettyqt\widgets\groupbox.py
def set_alignment(
    self, alignment: constants.HorizontalAlignmentStr | constants.AlignmentFlag
):
    """Set the title alignment of the groupbox.

    Args:
        alignment: title alignment for the groupbox
    """
    self.setAlignment(constants.H_ALIGNMENT.get_enum_value(alignment))

⌗ Property table

Qt Property Type Doc
objectName QString
modal bool
windowModality Qt::WindowModality
enabled bool
geometry QRect
frameGeometry QRect
normalGeometry QRect
x int
y int
pos QPoint
frameSize QSize
size QSize
width int
height int
rect QRect
childrenRect QRect
childrenRegion QRegion
sizePolicy QSizePolicy
minimumSize QSize
maximumSize QSize
minimumWidth int
minimumHeight int
maximumWidth int
maximumHeight int
sizeIncrement QSize
baseSize QSize
palette QPalette
font QFont
cursor QCursor
mouseTracking bool
tabletTracking bool
isActiveWindow bool
focusPolicy Qt::FocusPolicy
focus bool
contextMenuPolicy Qt::ContextMenuPolicy
updatesEnabled bool
visible bool
minimized bool
maximized bool
fullScreen bool
sizeHint QSize
minimumSizeHint QSize
acceptDrops bool
windowTitle QString
windowIcon QIcon
windowIconText QString
windowOpacity double
windowModified bool
toolTip QString
toolTipDuration int
statusTip QString
whatsThis QString
accessibleName QString
accessibleDescription QString
layoutDirection Qt::LayoutDirection
autoFillBackground bool
styleSheet QString
locale QLocale
windowFilePath QString
inputMethodHints QFlags
title QString
alignment QFlags
flat bool
checkable bool
checked bool