Skip to content

Layout Shortcuts

app.ui.qt.shared.layout_shortcuts

View source code

Module for layout shortcuts; implements the Qt presentation components.

See Also

Layer: Presentation. Context: Implements the qt presentation components at this architectural boundary.

Margins = tuple[int, int, int, int] module-attribute

OrderedWidgets = list[QtWidgets.QWidget] | tuple[QtWidgets.QWidget, ...] module-attribute

create_hbox_layout(parent: QtWidgets.QWidget | None = None, *, margins: Margins | None = None, spacing: int | None = None, widgets: OrderedWidgets | None = None) -> QtWidgets.QHBoxLayout

Create a horizontal layout with optional margins, spacing, and widgets.

PARAMETER DESCRIPTION
parent

Widget that owns the layout, if any.

TYPE: QWidget | None DEFAULT: None

margins

Optional left, top, right, and bottom content margins.

TYPE: Margins | None DEFAULT: None

spacing

Optional spacing between child widgets.

TYPE: int | None DEFAULT: None

widgets

Optional ordered list or tuple of widgets to add.

TYPE: OrderedWidgets | None DEFAULT: None

RETURNS DESCRIPTION
QHBoxLayout

Configured horizontal layout.

create_vbox_layout(parent: QtWidgets.QWidget | None = None, *, margins: Margins | None = None, spacing: int | None = None, widgets: OrderedWidgets | None = None) -> QtWidgets.QVBoxLayout

Create a vertical layout with optional margins, spacing, and widgets.

PARAMETER DESCRIPTION
parent

Widget that owns the layout, if any.

TYPE: QWidget | None DEFAULT: None

margins

Optional left, top, right, and bottom content margins.

TYPE: Margins | None DEFAULT: None

spacing

Optional spacing between child widgets.

TYPE: int | None DEFAULT: None

widgets

Optional ordered list or tuple of widgets to add.

TYPE: OrderedWidgets | None DEFAULT: None

RETURNS DESCRIPTION
QVBoxLayout

Configured vertical layout.