Skip to content

Widget Factories

app.ui.qt.shared.widget_factories

View source code

Module for widget factories; implements the Qt presentation components.

See Also

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

create_qhbox_with_widgets(widgets: list[QWidget] | tuple[QWidget, ...]) -> QHBoxLayout

Create a horizontal layout containing the supplied widgets.

PARAMETER DESCRIPTION
widgets

Widgets to add to the layout in order.

TYPE: list[QWidget] | tuple[QWidget, ...]

RETURNS DESCRIPTION
QHBoxLayout

Horizontal layout containing widgets.

create_progress_bar(minimum: int, maximum: int, text_visible: bool = False, visible: bool = True) -> QProgressBar

Create and configure a Qt progress bar.

PARAMETER DESCRIPTION
minimum

Lower end of the displayed progress range.

TYPE: int

maximum

Upper end of the displayed progress range.

TYPE: int

text_visible

Whether Qt should display progress text inside the bar.

TYPE: bool DEFAULT: False

visible

Initial visibility of the bar.

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
QProgressBar

Progress bar configured with the requested range and visibility.

create_spinbox(min_val: float, max_val: float, step: float, default: float) -> QDoubleSpinBox

Create a two-decimal floating-point spin box.

PARAMETER DESCRIPTION
min_val

Minimum permitted value.

TYPE: float

max_val

Maximum permitted value.

TYPE: float

step

Increment for arrow-button adjustments.

TYPE: float

default

Initial value, clamped by Qt to the configured range.

TYPE: float

RETURNS DESCRIPTION
QDoubleSpinBox

Configured QDoubleSpinBox.

create_int_spinbox(min_val: int, max_val: int, step: int, default: int) -> QSpinBox

Create an integer spin box with an explicit inclusive range.

PARAMETER DESCRIPTION
min_val

Smallest accepted integer.

TYPE: int

max_val

Largest accepted integer.

TYPE: int

step

Increment used by the spin-box arrows.

TYPE: int

default

Initial value, clamped by Qt to the supplied range.

TYPE: int

RETURNS DESCRIPTION
QSpinBox

A configured QSpinBox.

Note

Use this for settings whose values represent discrete pixels or frames.

Example

gap = create_int_spinbox(1, 60, 1, 25)

create_blur_strength_spinbox(default: float) -> QDoubleSpinBox

Create blur strength spinbox.

PARAMETER DESCRIPTION
default

Initial blur-strength value, clamped to [0, 255].

TYPE: float

RETURNS DESCRIPTION
QDoubleSpinBox

QDoubleSpinBox with range 0–255 and unit increments.

post_data_table_init(data_table: QTableWidget) -> None

Apply standard setup after the data table is created.

PARAMETER DESCRIPTION
data_table

Table to configure for read-only extended row selection.

TYPE: QTableWidget