Skip to content

API: Shared Widgets

Cross-kit UI base classes and components.

hydra_suite.widgets.workers

BaseWorker — standard QThread base class for all background tasks.

BaseWorker

Bases: QThread

Base class for all background task workers.

Subclasses implement execute() only. run() is owned by this class and guarantees: - Unhandled exceptions in execute() emit error instead of crashing the thread silently. - Qt automatically emits the inherited QThread.finished signal when run() returns, whether execution succeeded or failed. Do not redefine finished in subclasses — it would shadow Qt's mechanism and cause missed or double emissions.

Standard signals

progress(int) — 0–100 completion percentage status(str) — human-readable status update error(str) — error message; emitted only on exception finished() — inherited from QThread; emitted automatically by Qt when run() returns (success or failure)

run()

Wrap execute() in error handling, emitting the error signal on failure.

execute()

Override in subclasses with the actual work.

hydra_suite.widgets.dialogs

BaseDialog — standard QDialog base class for all kit dialogs.

BaseDialog

Bases: QDialog

Base class for all kit dialogs.

Subclasses call add_content(widget) to insert their UI above the button box. The button box is always created automatically in the correct position.

Parameters

title: Window title shown in the title bar. parent: Parent widget (passed to QDialog). buttons: QDialogButtonBox.StandardButtons flags. Defaults to Ok | Cancel. apply_dark_style: Whether to apply the shared dark stylesheet. Default True.

add_content(widget)

Insert widget above the button box.

hydra_suite.widgets.welcome_page

Shared welcome/splash page widget for hydra-suite applications.

ButtonDef dataclass

Definition for a single action button on the welcome page.

WelcomeConfig dataclass

Declarative configuration for a WelcomePage instance.

WelcomePage

Bases: QWidget

Shared welcome/splash page for all hydra-suite applications.

refresh_recents()

Reload and redisplay the recent items list.

hydra_suite.widgets.recents

Persistent recent-items store for hydra-suite applications.

RecentItemsStore

JSON-backed recent-items list for a specific app.

Storage location respects HYDRA_DATA_DIR via hydra_suite.paths.

load()

Return recent items, most-recent first.

add(path)

Add path to the top, de-duplicating and trimming to max.

remove(path)

Remove path from the list.

clear()

Remove all recent items.