Button Widgets¶
Specialized button widgets for date selection, icon display, and loading state management.
DateButton¶
A QToolButton that displays the currently selected date and opens a calendar dialog when clicked.
Signals:
| Signal | Signature | Emitted when |
|---|---|---|
dateChanged |
(QDate) |
The date property changes, whether from user interaction or programmatic assignment |
dateSelected |
(QDate) |
The user confirms a date in the calendar dialog |
Constructor parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
parent |
QWidget \| None |
None |
Parent widget |
date |
QDate \| str \| None |
None |
Initial date; None defaults to today |
date_format |
str |
"dd/MM/yyyy" |
Qt date format string used for display and parsing |
placeholder |
str |
"Select a date" |
Text shown when no valid date is set |
show_calendar_icon |
bool |
True |
Whether to show the calendar icon inside the button |
icon_size |
QSize \| tuple[int, int] |
QSize(16, 16) |
Size of the calendar icon |
min_width |
int \| None |
None |
Minimum width; auto-calculated if None |
min_height |
int \| None |
None |
Minimum height; auto-calculated if None |
Properties:
| Property | Type | Description |
|---|---|---|
date |
QDate |
Gets or sets the selected date; setting to None clears it |
date_string |
str |
Gets or sets the date as a formatted string using date_format |
date_format |
str |
Gets or sets the display/parse format |
placeholder |
str |
Gets or sets the placeholder text |
show_calendar_icon |
bool |
Gets or sets calendar icon visibility |
icon_size |
QSize |
Gets or sets the calendar icon size |
min_width |
int \| None |
Gets or sets the minimum width |
min_height |
int \| None |
Gets or sets the minimum height |
Methods:
| Method | Returns | Description |
|---|---|---|
clearDate() |
None |
Sets the date to an invalid QDate (shows placeholder) |
setToday() |
None |
Sets the date to today's date |
openCalendar() |
None |
Opens the DatePickerDialog programmatically |
refreshStyle() |
None |
Re-applies the QSS stylesheet after dynamic changes |
Example:
from PySide6.QtWidgets import QApplication
from ezqt_widgets import DateButton
app = QApplication([])
btn = DateButton(
date_format="dd/MM/yyyy",
placeholder="Pick a date",
show_calendar_icon=True,
)
btn.dateChanged.connect(lambda d: print(d.toString("dd/MM/yyyy")))
btn.setToday()
btn.show()
app.exec()
DateButton
¶
DateButton(parent: WidgetParent = None, date: QDate | str | None = None, date_format: str = 'dd/MM/yyyy', placeholder: str = 'Select a date', show_calendar_icon: bool = True, icon_size: SizeType = QSize(16, 16), minimum_date: QDate | None = None, maximum_date: QDate | None = None, min_width: int | None = None, min_height: int | None = None, *args: Any, **kwargs: Any)
Bases: QToolButton
Button widget for date selection with integrated calendar.
Features
- Displays current selected date
- Opens calendar dialog on click
- Configurable date format
- Placeholder text when no date selected
- Calendar icon with customizable appearance
- Date validation and parsing
- Optional minimum and maximum date constraints
| PARAMETER | DESCRIPTION |
|---|---|
parent
|
The parent widget (default: None).
TYPE:
|
date
|
Initial date (QDate, date string, or None for current date).
TYPE:
|
date_format
|
Format for displaying the date (default: "dd/MM/yyyy").
TYPE:
|
placeholder
|
Text to display when no date is selected (default: "Select a date").
TYPE:
|
show_calendar_icon
|
Whether to show calendar icon (default: True).
TYPE:
|
icon_size
|
Size of the calendar icon (default: QSize(16, 16)).
TYPE:
|
minimum_date
|
Minimum selectable date (default: None, no constraint).
TYPE:
|
maximum_date
|
Maximum selectable date (default: None, no constraint).
TYPE:
|
min_width
|
Minimum width of the button (default: None, auto-calculated).
TYPE:
|
min_height
|
Minimum height of the button (default: None, auto-calculated).
TYPE:
|
*args
|
Additional arguments passed to QToolButton.
TYPE:
|
**kwargs
|
Additional keyword arguments passed to QToolButton.
TYPE:
|
Signals
dateChanged(QDate): Emitted when the date changes. dateSelected(QDate): Emitted when a date is selected from calendar.
Example
from ezqt_widgets import DateButton btn = DateButton(date_format="dd/MM/yyyy", placeholder="Pick a date") btn.dateChanged.connect(lambda d: print(d.toString("dd/MM/yyyy"))) btn.setToday() btn.show()
Initialize the date button.
Source code in src/ezqt_widgets/widgets/button/date_button.py
date
property
writable
¶
Get or set the selected date.
| RETURNS | DESCRIPTION |
|---|---|
QDate
|
The current selected date. |
date_string
property
writable
¶
Get or set the date as formatted string.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The formatted date string. |
date_format
property
writable
¶
Get or set the date format.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The current date format string. |
placeholder
property
writable
¶
Get or set the placeholder text.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The current placeholder text. |
show_calendar_icon
property
writable
¶
Get or set calendar icon visibility.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if calendar icon is visible, False otherwise. |
icon_size
property
writable
¶
Get or set the icon size.
| RETURNS | DESCRIPTION |
|---|---|
QSize
|
The current icon size. |
minimum_date
property
writable
¶
Get or set the minimum selectable date.
| RETURNS | DESCRIPTION |
|---|---|
QDate | None
|
The minimum date, or None if no constraint is set. |
maximum_date
property
writable
¶
Get or set the maximum selectable date.
| RETURNS | DESCRIPTION |
|---|---|
QDate | None
|
The maximum date, or None if no constraint is set. |
min_width
property
writable
¶
Get or set the minimum width of the button.
| RETURNS | DESCRIPTION |
|---|---|
int | None
|
The minimum width, or None if not set. |
min_height
property
writable
¶
Get or set the minimum height of the button.
| RETURNS | DESCRIPTION |
|---|---|
int | None
|
The minimum height, or None if not set. |
clearDate
¶
setToday
¶
openCalendar
¶
Open the calendar dialog.
Source code in src/ezqt_widgets/widgets/button/date_button.py
setTheme
¶
Update the calendar icon color for the given theme.
Can be connected directly to a theme-change signal to keep the icon in sync with the application's color scheme.
| PARAMETER | DESCRIPTION |
|---|---|
theme
|
The new theme (
TYPE:
|
Source code in src/ezqt_widgets/widgets/button/date_button.py
mousePressEvent
¶
Handle mouse press events.
The left-button press opens the calendar dialog directly. The
clicked signal is emitted only after the user confirms a date
(inside openCalendar), not unconditionally on press.
| PARAMETER | DESCRIPTION |
|---|---|
event
|
The mouse event.
TYPE:
|
Source code in src/ezqt_widgets/widgets/button/date_button.py
sizeHint
¶
Get the recommended size for the button.
| RETURNS | DESCRIPTION |
|---|---|
QSize
|
The recommended size. |
minimumSizeHint
¶
Get the minimum size hint for the button.
| RETURNS | DESCRIPTION |
|---|---|
QSize
|
The minimum size hint. |
Source code in src/ezqt_widgets/widgets/button/date_button.py
refreshStyle
¶
Refresh the widget's style.
Useful after dynamic stylesheet changes.
DatePickerDialog¶
A QDialog containing a QCalendarWidget for date selection. Used internally by DateButton but also available as a standalone dialog.
Constructor parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
parent |
QWidget \| None |
None |
Parent widget |
current_date |
QDate \| None |
None |
Date pre-selected in the calendar |
Methods:
| Method | Returns | Description |
|---|---|---|
selectedDate() |
QDate \| None |
Returns the date clicked in the calendar, or None if none was clicked |
Example:
from PySide6.QtCore import QDate
from ezqt_widgets import DatePickerDialog
dialog = DatePickerDialog(current_date=QDate.currentDate())
if dialog.exec():
date = dialog.selectedDate()
if date:
print(date.toString("dd/MM/yyyy"))
DatePickerDialog
¶
DatePickerDialog(parent: WidgetParent = None, current_date: QDate | None = None, min_date: QDate | None = None, max_date: QDate | None = None)
Bases: QDialog
Dialog for date selection with calendar widget.
Provides a modal dialog with a calendar widget for selecting dates. The dialog emits accepted signal when a date is selected and confirmed.
| PARAMETER | DESCRIPTION |
|---|---|
parent
|
The parent widget (default: None).
TYPE:
|
current_date
|
The current selected date (default: None).
TYPE:
|
min_date
|
The minimum selectable date (default: None).
TYPE:
|
max_date
|
The maximum selectable date (default: None).
TYPE:
|
Example
from ezqt_widgets import DatePickerDialog from PySide6.QtCore import QDate dialog = DatePickerDialog(current_date=QDate.currentDate()) if dialog.exec(): ... date = dialog.selected_date() ... print(date.toString("dd/MM/yyyy"))
Initialize the date picker dialog.
Source code in src/ezqt_widgets/widgets/button/date_button.py
selectedDate
¶
Get the selected date.
| RETURNS | DESCRIPTION |
|---|---|
QDate | None
|
The selected date, or None if no date was selected. |
IconButton¶
A QToolButton that displays an icon from any supported source (file path, URL, SVG, QIcon, or QPixmap) with an optional text label.
Signals:
| Signal | Signature | Emitted when |
|---|---|---|
iconChanged |
(QIcon) |
The icon is updated |
textChanged |
(str) |
The text label changes |
Constructor parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
parent |
QWidget \| None |
None |
Parent widget |
icon |
QIcon \| QPixmap \| str \| None |
None |
Icon source; supports local paths, URLs, and SVG |
text |
str |
"" |
Button label text |
icon_size |
QSize \| tuple[int, int] |
QSize(20, 20) |
Icon display size |
text_visible |
bool |
True |
Whether the text label is initially visible |
spacing |
int |
10 |
Pixels between the icon and the text |
min_width |
int \| None |
None |
Minimum width; auto-calculated if None |
min_height |
int \| None |
None |
Minimum height; auto-calculated if None |
Properties:
| Property | Type | Description |
|---|---|---|
icon |
QIcon \| None |
Gets or sets the button icon |
text |
str |
Gets or sets the button text |
icon_size |
QSize |
Gets or sets the icon size |
text_visible |
bool |
Gets or sets text label visibility |
spacing |
int |
Gets or sets the icon-to-text spacing in pixels |
min_width |
int \| None |
Gets or sets minimum width |
min_height |
int \| None |
Gets or sets minimum height |
Methods:
| Method | Signature | Description |
|---|---|---|
clearIcon() |
() -> None |
Removes the current icon and emits iconChanged with an empty QIcon |
clearText() |
() -> None |
Sets the text to an empty string |
toggleTextVisibility() |
() -> None |
Inverts text_visible |
setIconColor() |
(color: str, opacity: float) -> None |
Applies a color overlay to the current icon pixmap |
refreshStyle() |
() -> None |
Re-applies the QSS stylesheet after dynamic changes |
URL icons
When icon is an HTTP or HTTPS URL, the fetch is asynchronous. The icon
appears after the network response completes; no blocking occurs.
Example:
from PySide6.QtWidgets import QApplication
from ezqt_widgets import IconButton
app = QApplication([])
btn = IconButton(
icon="https://img.icons8.com/?size=100&id=8329&format=png&color=000000",
text="Open file",
icon_size=(24, 24),
text_visible=True,
)
btn.iconChanged.connect(lambda icon: print("icon updated"))
btn.show()
app.exec()
IconButton
¶
IconButton(parent: WidgetParent = None, icon: IconSourceExtended = None, text: str = '', icon_size: SizeType = QSize(20, 20), text_visible: bool = True, spacing: int = 10, min_width: int | None = None, min_height: int | None = None, *args: Any, **kwargs: Any)
Bases: QToolButton
Enhanced button widget with icon and optional text support.
Features
- Icon support from various sources (ThemeIcon, QIcon, QPixmap, path, URL, SVG)
- Optional text display with configurable visibility
- Customizable icon size and spacing
- Property-based access to icon and text
- Signals for icon and text changes
- Hover and click effects
| PARAMETER | DESCRIPTION |
|---|---|
parent
|
The parent widget (default: None).
TYPE:
|
icon
|
The icon to display (ThemeIcon, QIcon, QPixmap, path, resource, URL, or SVG).
TYPE:
|
text
|
The button text (default: "").
TYPE:
|
icon_size
|
Size of the icon (default: QSize(20, 20)).
TYPE:
|
text_visible
|
Whether the text is initially visible (default: True).
TYPE:
|
spacing
|
Spacing between icon and text in pixels (default: 10).
TYPE:
|
min_width
|
Minimum width of the button (default: None, auto-calculated).
TYPE:
|
min_height
|
Minimum height of the button (default: None, auto-calculated).
TYPE:
|
*args
|
Additional arguments passed to QToolButton.
TYPE:
|
**kwargs
|
Additional keyword arguments passed to QToolButton.
TYPE:
|
Signals
iconChanged(QIcon): Emitted when the icon changes. textChanged(str): Emitted when the text changes. iconLoadFailed(str): Emitted when an icon URL fetch fails, with the URL.
Example
from ezqt_widgets import IconButton btn = IconButton(icon="path/to/icon.png", text="Open", icon_size=(20, 20)) btn.iconChanged.connect(lambda icon: print("icon changed")) btn.text_visible = False btn.show()
Initialize the icon button.
Source code in src/ezqt_widgets/widgets/button/icon_button.py
icon
property
writable
¶
Get or set the button icon.
| RETURNS | DESCRIPTION |
|---|---|
QIcon | None
|
The current icon, or None if no icon is set. |
text
property
writable
¶
Get or set the button text.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The current button text. |
icon_size
property
writable
¶
Get or set the icon size.
| RETURNS | DESCRIPTION |
|---|---|
QSize
|
The current icon size. |
text_visible
property
writable
¶
Get or set text visibility.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if text is visible, False otherwise. |
spacing
property
writable
¶
Get or set spacing between icon and text.
| RETURNS | DESCRIPTION |
|---|---|
int
|
The current spacing in pixels. |
min_width
property
writable
¶
Get or set the minimum width of the button.
| RETURNS | DESCRIPTION |
|---|---|
int | None
|
The minimum width, or None if not set. |
min_height
property
writable
¶
Get or set the minimum height of the button.
| RETURNS | DESCRIPTION |
|---|---|
int | None
|
The minimum height, or None if not set. |
setTheme
¶
Update the icon color for the given theme.
Can be connected directly to a theme-change signal to keep the icon in sync with the application's color scheme.
| PARAMETER | DESCRIPTION |
|---|---|
theme
|
The new theme (
TYPE:
|
Source code in src/ezqt_widgets/widgets/button/icon_button.py
clearIcon
¶
clearText
¶
toggleTextVisibility
¶
setIconColor
¶
Apply color and opacity to the current icon.
| PARAMETER | DESCRIPTION |
|---|---|
color
|
The color to apply (default: "#FFFFFF").
TYPE:
|
opacity
|
The opacity level (default: 0.5).
TYPE:
|
Source code in src/ezqt_widgets/widgets/button/icon_button.py
sizeHint
¶
Get the recommended size for the button.
| RETURNS | DESCRIPTION |
|---|---|
QSize
|
The recommended size. |
minimumSizeHint
¶
Get the minimum size hint for the button.
| RETURNS | DESCRIPTION |
|---|---|
QSize
|
The minimum size hint. |
Source code in src/ezqt_widgets/widgets/button/icon_button.py
refreshStyle
¶
Refresh the widget's style.
Useful after dynamic stylesheet changes.
LoaderButton¶
A QToolButton that transitions between a normal state, an animated loading state, a success state, and an error state.
Signals:
| Signal | Signature | Emitted when |
|---|---|---|
loadingStarted |
() |
startLoading() is called |
loadingFinished |
() |
stopLoading(success=True) completes |
loadingFailed |
(str) |
stopLoading(success=False) completes; the string is the error message |
Constructor parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
parent |
QWidget \| None |
None |
Parent widget |
text |
str |
"" |
Label in the normal state |
icon |
QIcon \| QPixmap \| str \| None |
None |
Icon in the normal state |
loading_text |
str |
"Loading..." |
Label shown during loading |
loading_icon |
QIcon \| QPixmap \| str \| None |
None |
Icon during loading; auto-generated spinner if None |
success_icon |
QIcon \| QPixmap \| str \| None |
None |
Icon shown on success; auto-generated checkmark if None |
error_icon |
QIcon \| QPixmap \| str \| None |
None |
Icon shown on error; auto-generated X if None |
animation_speed |
int |
100 |
Spinner frame interval in milliseconds |
auto_reset |
bool |
True |
Whether to return to the normal state after success/error |
success_display_time |
int |
1000 |
Milliseconds to show the success state before auto-reset |
error_display_time |
int |
2000 |
Milliseconds to show the error state before auto-reset |
min_width |
int \| None |
None |
Minimum width; auto-calculated if None |
min_height |
int \| None |
None |
Minimum height; auto-calculated if None |
Properties:
| Property | Type | Description |
|---|---|---|
text |
str |
Normal-state label |
icon |
QIcon \| None |
Normal-state icon |
loading_text |
str |
Text shown during loading |
loading_icon |
QIcon \| None |
Icon shown during loading |
success_icon |
QIcon \| None |
Icon shown on success |
error_icon |
QIcon \| None |
Icon shown on error |
is_loading |
bool |
Read-only; True while loading animation is active |
animation_speed |
int |
Spinner frame interval in milliseconds |
auto_reset |
bool |
Whether to auto-return to normal state after completion |
success_display_time |
int |
Milliseconds the success state is displayed |
error_display_time |
int |
Milliseconds the error state is displayed |
min_width |
int \| None |
Minimum width |
min_height |
int \| None |
Minimum height |
Methods:
| Method | Signature | Description |
|---|---|---|
startLoading() |
() -> None |
Enters the loading state; disables the button and starts the spinner |
stopLoading() |
(success: bool, error_message: str) -> None |
Exits the loading state; shows success or error UI |
refreshStyle() |
() -> None |
Re-applies the QSS stylesheet after dynamic changes |
Calling stopLoading while not loading
stopLoading() is a no-op if is_loading is False.
Example:
from PySide6.QtCore import QTimer
from PySide6.QtWidgets import QApplication
from ezqt_widgets import LoaderButton
app = QApplication([])
btn = LoaderButton(
text="Submit",
loading_text="Sending...",
auto_reset=True,
success_display_time=1500,
)
btn.loadingFinished.connect(lambda: print("done"))
def simulate_request():
btn.startLoading()
QTimer.singleShot(2000, lambda: btn.stopLoading(success=True))
btn.clicked.connect(simulate_request)
btn.show()
app.exec()
LoaderButton
¶
LoaderButton(parent: WidgetParent = None, text: str = '', icon: IconSourceExtended = None, loading_text: str = 'Loading...', loading_icon: IconSourceExtended = None, success_icon: IconSourceExtended = None, error_icon: IconSourceExtended = None, success_text: str = 'Success!', error_text: str = 'Error', icon_size: QSize | tuple[int, int] = QSize(16, 16), animation_speed: AnimationDuration = 100, auto_reset: bool = True, success_display_time: AnimationDuration = 1000, error_display_time: AnimationDuration = 2000, min_width: int | None = None, min_height: int | None = None, *args: Any, **kwargs: Any)
Bases: QToolButton
Button widget with integrated loading animation.
Features
- Loading state with animated spinner
- Success state with checkmark icon
- Error state with X icon
- Configurable loading, success, and error text/icons
- Configurable success and error result texts
- Smooth transitions between states
- Disabled state during loading
- Customizable animation speed
- Progress indication support (0-100)
- Auto-reset after completion with configurable display times
- Configurable spinner icon size
- Safe timer cleanup on widget destruction
| PARAMETER | DESCRIPTION |
|---|---|
parent
|
The parent widget (default: None).
TYPE:
|
text
|
Button text (default: "").
TYPE:
|
icon
|
Button icon (ThemeIcon, QIcon, QPixmap, or path, default: None).
TYPE:
|
loading_text
|
Text to display during loading (default: "Loading...").
TYPE:
|
loading_icon
|
Icon to display during loading (ThemeIcon, QIcon, QPixmap, or path, default: None, auto-generated).
TYPE:
|
success_icon
|
Icon to display on success (ThemeIcon, QIcon, QPixmap, or path, default: None, auto-generated checkmark).
TYPE:
|
error_icon
|
Icon to display on error (ThemeIcon, QIcon, QPixmap, or path, default: None, auto-generated X mark).
TYPE:
|
success_text
|
Text to display when loading succeeds (default: "Success!").
TYPE:
|
error_text
|
Text to display when loading fails (default: "Error").
TYPE:
|
icon_size
|
Size of spinner and state icons (default: QSize(16, 16)).
TYPE:
|
animation_speed
|
Animation speed in milliseconds (default: 100).
TYPE:
|
auto_reset
|
Whether to auto-reset after loading (default: True).
TYPE:
|
success_display_time
|
Time to display success state in milliseconds (default: 1000).
TYPE:
|
error_display_time
|
Time to display error state in milliseconds (default: 2000).
TYPE:
|
min_width
|
Minimum width of the button (default: None, auto-calculated).
TYPE:
|
min_height
|
Minimum height of the button (default: None, auto-calculated).
TYPE:
|
*args
|
Additional arguments passed to QToolButton.
TYPE:
|
**kwargs
|
Additional keyword arguments passed to QToolButton.
TYPE:
|
Signals
loadingStarted(): Emitted when loading starts. loadingFinished(): Emitted when loading finishes successfully. loadingFailed(str): Emitted when loading fails with error message. progressChanged(int): Emitted when progress value changes (0-100).
Example
from ezqt_widgets import LoaderButton btn = LoaderButton(text="Submit", loading_text="Sending...") btn.loadingFinished.connect(lambda: print("done")) btn.startLoading()
After completion:¶
btn.stopLoading(success=True) btn.show()
Initialize the loader button.
Source code in src/ezqt_widgets/widgets/button/loader_button.py
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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | |
text
property
writable
¶
Get or set the button text.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The current button text. |
icon
property
writable
¶
Get or set the button icon.
| RETURNS | DESCRIPTION |
|---|---|
QIcon | None
|
The current button icon, or None if no icon is set. |
loading_text
property
writable
¶
Get or set the loading text.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The current loading text. |
loading_icon
property
writable
¶
Get or set the loading icon.
| RETURNS | DESCRIPTION |
|---|---|
QIcon | None
|
The current loading icon, or None if not set. |
success_icon
property
writable
¶
Get or set the success icon.
| RETURNS | DESCRIPTION |
|---|---|
QIcon | None
|
The current success icon, or None if not set. |
error_icon
property
writable
¶
Get or set the error icon.
| RETURNS | DESCRIPTION |
|---|---|
QIcon | None
|
The current error icon, or None if not set. |
success_text
property
writable
¶
Get or set the text displayed on success.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The current success text. |
error_text
property
writable
¶
Get or set the base text displayed on error.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The current error text. |
icon_size
property
writable
¶
Get or set the spinner and state icon size.
| RETURNS | DESCRIPTION |
|---|---|
QSize
|
The current icon size. |
progress
property
writable
¶
Get or set the current progress value (0-100).
When set during loading, the progress percentage is shown in the text label instead of the generic loading text. The spinner is kept visible. Setting this property outside of loading state is silently ignored.
| RETURNS | DESCRIPTION |
|---|---|
int
|
The current progress value. |
success_display_time
property
writable
¶
Get or set the success display time.
| RETURNS | DESCRIPTION |
|---|---|
AnimationDuration
|
The success display time in milliseconds. |
error_display_time
property
writable
¶
Get or set the error display time.
| RETURNS | DESCRIPTION |
|---|---|
AnimationDuration
|
The error display time in milliseconds. |
is_loading
property
¶
Get the current loading state.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if loading, False otherwise. |
animation_speed
property
writable
¶
Get or set the animation speed.
| RETURNS | DESCRIPTION |
|---|---|
AnimationDuration
|
The animation speed in milliseconds. |
auto_reset
property
writable
¶
Get or set auto-reset behavior.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if auto-reset is enabled, False otherwise. |
min_width
property
writable
¶
Get or set the minimum width of the button.
| RETURNS | DESCRIPTION |
|---|---|
int | None
|
The minimum width, or None if not set. |
min_height
property
writable
¶
Get or set the minimum height of the button.
| RETURNS | DESCRIPTION |
|---|---|
int | None
|
The minimum height, or None if not set. |
startLoading
¶
Start the loading animation.
Source code in src/ezqt_widgets/widgets/button/loader_button.py
stopLoading
¶
Stop the loading animation.
| PARAMETER | DESCRIPTION |
|---|---|
success
|
Whether the operation succeeded (default: True).
TYPE:
|
error_message
|
Error message if operation failed (default: "").
TYPE:
|
Source code in src/ezqt_widgets/widgets/button/loader_button.py
resetLoading
¶
Reset the button to its original state.
Can be called manually when auto_reset is False.
setTheme
¶
Update all icons' color for the given theme.
Can be connected directly to a theme-change signal to keep icons in sync with the application's color scheme.
| PARAMETER | DESCRIPTION |
|---|---|
theme
|
The new theme (
TYPE:
|
Source code in src/ezqt_widgets/widgets/button/loader_button.py
mousePressEvent
¶
Handle mouse press events.
| PARAMETER | DESCRIPTION |
|---|---|
event
|
The mouse event.
TYPE:
|
Source code in src/ezqt_widgets/widgets/button/loader_button.py
sizeHint
¶
Get the recommended size for the button.
| RETURNS | DESCRIPTION |
|---|---|
QSize
|
The recommended size. |
minimumSizeHint
¶
Get the minimum size hint for the button.
| RETURNS | DESCRIPTION |
|---|---|
QSize
|
The minimum size hint. |
Source code in src/ezqt_widgets/widgets/button/loader_button.py
refreshStyle
¶
Refresh the widget's style.
Useful after dynamic stylesheet changes.