Skip to content

Preferences

app.ui.qt.dialogs.preferences

View source code

Module for preferences; implements the Qt presentation components.

See Also

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

PreferencesDialog

Bases: QDialog

Collect persistent app preferences and default per-session settings.

Layer: Presentation. Context: Supports user interaction and delegates application work through presentation contracts.

__init__(preferences: AppPreferences, available_models: list[ModelSelectionViewModel], parent: QWidget | None = None) -> None

PARAMETER DESCRIPTION
preferences

Current persisted preferences.

TYPE: AppPreferences

available_models

Detection models offered by the application.

TYPE: list[ModelSelectionViewModel]

parent

Optional parent widget.

TYPE: QWidget | None DEFAULT: None

Note

Session defaults apply to sessions opened after the preferences are saved.

Example

dialog = PreferencesDialog(preferences, available_models)

get_preferences() -> AppPreferences

Create a preference value object from the current controls.

RETURNS DESCRIPTION
AppPreferences

Updated preferences ready to persist.

Note

Labels are split and whitespace-trimmed before storing.

Example

updated = dialog.get_preferences()