UI Services and Widgets¶
UI orchestration services and reusable widget containers.
ThemeService¶
ThemeService
¶
Service responsible for loading and applying QSS themes.
Theme variables are declared without prefix in theme config files
(e.g. main_surface) and referenced in QSS files using the
standard CSS custom property notation var(--variable_name).
The service resolves each reference to its palette value before
applying the stylesheet.
apply_theme
staticmethod
¶
Load all QSS files from the themes directory and apply the merged stylesheet.
All .qss files found under <app_root>/bin/themes/ are loaded in
alphabetical order and concatenated before palette variables are resolved.
When that directory is absent or empty, the package's own
resources/themes/ directory is used as fallback.
| PARAMETER | DESCRIPTION |
|---|---|
window
|
The application window whose
TYPE:
|
Source code in src/ezqt_app/services/ui/theme_service.py
get_available_themes
staticmethod
¶
Return available theme options as (display_label, internal_value) pairs.
Reads palette keys from theme.config.yaml and generates one entry
per preset × variant combination, e.g.
("Blue Gray - Dark", "blue_gray:dark").
| RETURNS | DESCRIPTION |
|---|---|
list[tuple[str, str]]
|
List of |
Source code in src/ezqt_app/services/ui/theme_service.py
MenuService¶
MenuService
¶
Service responsible for menu item selection state and style refresh.
select_menu
staticmethod
¶
Set active class on a menu button identified by its object name.
Source code in src/ezqt_app/services/ui/menu_service.py
deselect_menu
staticmethod
¶
Set inactive class on all menu buttons except the selected one.
Source code in src/ezqt_app/services/ui/menu_service.py
refresh_style
staticmethod
¶
Re-apply widget style after dynamic property changes.
PanelService¶
PanelService
¶
Service responsible for menu and settings panel animations.
toggle_menu_panel
staticmethod
¶
Animate the left menu panel between shrink and extended widths.
Source code in src/ezqt_app/services/ui/panel_service.py
toggle_settings_panel
staticmethod
¶
Animate the right settings panel and synchronize theme toggle.
Source code in src/ezqt_app/services/ui/panel_service.py
WindowService¶
WindowService
¶
Service responsible for maximize/restore and window state flags.
maximize_restore
staticmethod
¶
Toggle between maximized and restored window state.
Source code in src/ezqt_app/services/ui/window_service.py
get_status
staticmethod
¶
set_status
staticmethod
¶
UiComponentFactory¶
UiComponentFactory
¶
Core Widgets¶
EzApplication
¶
Bases: QApplication
Extended main application with theme and UTF-8 encoding support.
This class inherits from QApplication and adds functionality for theme management and UTF-8 encoding.
Initialize the application with UTF-8 and high resolution support.
Parameters¶
args : Any Positional arguments passed to QApplication. *kwargs : Any Keyword arguments passed to QApplication.
Source code in src/ezqt_app/widgets/core/ez_app.py
create_for_testing
classmethod
¶
create_for_testing(*args: Any, **kwargs: Any) -> EzApplication
Create an EzApplication instance for testing, bypassing singleton checks.
Source code in src/ezqt_app/widgets/core/ez_app.py
Header
¶
Header(app_name: str = '', description: str = '', parent: QWidget | None = None, *args: Any, **kwargs: Any)
Bases: QFrame
Application header with logo, name and control buttons.
This class provides a customizable header bar with the application logo, its name, description and window control buttons (minimize, maximize, close).
Initialize the application header.
| PARAMETER | DESCRIPTION |
|---|---|
app_name
|
Application name (default: "").
TYPE:
|
description
|
Application description (default: "").
TYPE:
|
parent
|
The parent widget (default: None).
TYPE:
|
*args
|
Additional positional arguments.
TYPE:
|
**kwargs
|
Additional keyword arguments.
TYPE:
|
Source code in src/ezqt_app/widgets/core/header.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |
set_app_name
¶
Set the application name in the header.
| PARAMETER | DESCRIPTION |
|---|---|
app_name
|
The new application name.
TYPE:
|
Source code in src/ezqt_app/widgets/core/header.py
set_app_description
¶
Set the application description in the header.
| PARAMETER | DESCRIPTION |
|---|---|
description
|
The new application description.
TYPE:
|
Source code in src/ezqt_app/widgets/core/header.py
retranslate_ui
¶
Apply current translations to all owned text labels and tooltips.
Source code in src/ezqt_app/widgets/core/header.py
changeEvent
¶
Handle Qt change events, triggering UI retranslation on language change.
| PARAMETER | DESCRIPTION |
|---|---|
event
|
The QEvent instance.
TYPE:
|
Source code in src/ezqt_app/widgets/core/header.py
set_app_logo
¶
Set the application logo in the header.
| PARAMETER | DESCRIPTION |
|---|---|
logo
|
The logo to display (file path or QPixmap).
TYPE:
|
y_shrink
|
Vertical reduction of the logo (default: 0).
TYPE:
|
y_offset
|
Vertical offset of the logo (default: 0).
TYPE:
|
Source code in src/ezqt_app/widgets/core/header.py
set_settings_panel_open
¶
Update the open dynamic property on the settings button.
The property is used by QSS to apply an accent background when the settings panel is visible. Calling this method forces Qt to re-evaluate the style rules for the button immediately.
| PARAMETER | DESCRIPTION |
|---|---|
is_open
|
TYPE:
|
Source code in src/ezqt_app/widgets/core/header.py
update_all_theme_icons
¶
Update all button icons according to current theme.
Source code in src/ezqt_app/widgets/core/header.py
Menu
¶
Bases: QFrame
Menu container with expansion/reduction support.
This class provides a menu container with a toggle button to expand or reduce the menu width. The menu contains an upper section for menu items and a lower section for the toggle button.
Initialize the menu container.
Parameters¶
parent : QWidget, optional The parent widget (default: None). shrink_width : int, optional Width when menu is shrunk (default: 60). extended_width : int, optional Width when menu is extended (default: 240).
Source code in src/ezqt_app/widgets/core/menu.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
retranslate_ui
¶
Apply current translations to all owned text labels and tooltips.
Source code in src/ezqt_app/widgets/core/menu.py
changeEvent
¶
Handle Qt change events, triggering UI retranslation on language change.
add_menu
¶
Add a menu item to the container.
Source code in src/ezqt_app/widgets/core/menu.py
update_all_theme_icons
¶
Update theme icons for all buttons.
Source code in src/ezqt_app/widgets/core/menu.py
sync_all_menu_states
¶
Sync all menu buttons to the given state.
Source code in src/ezqt_app/widgets/core/menu.py
get_menu_state
¶
get_shrink_width
¶
PageContainer
¶
Bases: QFrame
Page container with stacked widget management.
This class provides a container to manage multiple pages within a central receptacle using a QStackedWidget.
Initialize the page container.
Parameters¶
parent : QWidget, optional The parent widget (default: None).
Source code in src/ezqt_app/widgets/core/page_container.py
add_page
¶
Add a new page to the container.
Parameters¶
name : str The name of the page to add.
Returns¶
QWidget The created page widget.
Source code in src/ezqt_app/widgets/core/page_container.py
set_current_widget
¶
get_stacked_widget
¶
Access the internal stacked widget.
Note: Use set_current_widget for standard navigation.
SettingsPanel
¶
Bases: QFrame
This class is used to create a settings panel. It contains a top border, a content settings frame and a theme settings container. The settings panel is used to display the settings.
Source code in src/ezqt_app/widgets/core/settings_panel.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
load_settings_from_yaml
¶
Load settings from YAML file.
Source code in src/ezqt_app/widgets/core/settings_panel.py
add_setting_from_config
¶
Add a setting based on its YAML configuration.
Source code in src/ezqt_app/widgets/core/settings_panel.py
add_toggle_setting
¶
add_toggle_setting(key: str, label: str, default: bool = False, description: str = '', enabled: bool = True)
Add a toggle setting.
Source code in src/ezqt_app/widgets/core/settings_panel.py
add_select_setting
¶
add_select_setting(key: str, label: str, options: list[str], default: str | None = None, description: str = '', enabled: bool = True)
Add a selection setting.
Source code in src/ezqt_app/widgets/core/settings_panel.py
add_slider_setting
¶
add_slider_setting(key: str, label: str, min_val: int, max_val: int, default: int, unit: str = '', description: str = '', enabled: bool = True)
Add a slider setting.
Source code in src/ezqt_app/widgets/core/settings_panel.py
add_text_setting
¶
add_text_setting(key: str, label: str, default: str = '', description: str = '', enabled: bool = True)
Add a text setting.
Source code in src/ezqt_app/widgets/core/settings_panel.py
add_checkbox_setting
¶
add_checkbox_setting(key: str, label: str, default: bool = False, description: str = '', enabled: bool = True)
Add a checkbox setting.
Source code in src/ezqt_app/widgets/core/settings_panel.py
get_setting_value
¶
set_setting_value
¶
get_all_settings
¶
save_all_settings_to_yaml
¶
Stage all current setting values.
Source code in src/ezqt_app/widgets/core/settings_panel.py
retranslate_ui
¶
Apply current translations to all owned text labels.
Source code in src/ezqt_app/widgets/core/settings_panel.py
changeEvent
¶
get_width
¶
set_width
¶
get_theme_selector
¶
update_all_theme_icons
¶
Update theme icons for all widgets that support it.
Source code in src/ezqt_app/widgets/core/settings_panel.py
add_setting_widget
¶
Add a new setting widget to the settings panel.
Source code in src/ezqt_app/widgets/core/settings_panel.py
add_setting_section
¶
Add a new settings section with optional title.
Source code in src/ezqt_app/widgets/core/settings_panel.py
scroll_to_top
¶
scroll_to_bottom
¶
Scroll to bottom of settings panel.
scroll_to_widget
¶
Scroll to a specific widget in the settings panel.
Source code in src/ezqt_app/widgets/core/settings_panel.py
Extended Widgets¶
setting_widgets
¶
Setting widget components: toggle, select, slider, text, checkbox.
BaseSettingWidget
¶
Bases: QWidget
Base class for all setting widgets.
Source code in src/ezqt_app/widgets/extended/setting_widgets.py
set_key
¶
SettingToggle
¶
Bases: BaseSettingWidget
Widget for toggle settings (on/off).
Source code in src/ezqt_app/widgets/extended/setting_widgets.py
retranslate_ui
¶
Update strings after language change.
SettingSelect
¶
SettingSelect(label: str, description: str = '', options: list | None = None, default: str | None = None)
Bases: BaseSettingWidget
Widget for selection settings.
Source code in src/ezqt_app/widgets/extended/setting_widgets.py
SettingSlider
¶
SettingSlider(label: str, description: str = '', min_val: int = 0, max_val: int = 100, default: int = 50, unit: str = '')
Bases: BaseSettingWidget
Widget for numeric settings with slider.
Source code in src/ezqt_app/widgets/extended/setting_widgets.py
SettingText
¶
Bases: BaseSettingWidget
Widget for text settings.
Source code in src/ezqt_app/widgets/extended/setting_widgets.py
SettingCheckbox
¶
Bases: BaseSettingWidget
Widget for checkbox settings (on/off).