Layout Shortcuts
app.ui.qt.shared.layout_shortcutsModule for layout shortcuts; implements the Qt presentation components.
See Also
widget_factories— combines reusable layouts with widget constructorsCollapsiblePanel— uses the shared layout helpers
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:
|
margins
|
Optional left, top, right, and bottom content margins.
TYPE:
|
spacing
|
Optional spacing between child widgets.
TYPE:
|
widgets
|
Optional ordered list or tuple of widgets to add.
TYPE:
|
| 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:
|
margins
|
Optional left, top, right, and bottom content margins.
TYPE:
|
spacing
|
Optional spacing between child widgets.
TYPE:
|
widgets
|
Optional ordered list or tuple of widgets to add.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
QVBoxLayout
|
Configured vertical layout. |