Skip to content

loading_spinner

_loading_spinner

Animated loading indicator widget.

Classes:

Name Description
FXLoadingOverlay

A loading overlay that blocks the parent widget.

FXLoadingSpinner

A themeable animated loading indicator.

Classes

FXLoadingOverlay

FXLoadingOverlay(
    parent: Optional[QWidget] = None, message: Optional[str] = None
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets._loading_spinner.FXLoadingOverlay[FXLoadingOverlay]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets._loading_spinner.FXLoadingOverlay
                


              click fxgui.fxwidgets._loading_spinner.FXLoadingOverlay href "" "fxgui.fxwidgets._loading_spinner.FXLoadingOverlay"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A loading overlay that blocks the parent widget.

This widget creates a semi-transparent overlay with a loading spinner, useful for indicating that a long operation is in progress.

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget to overlay.

None
message
Optional[str]

Optional message to display below the spinner.

None

Examples:

>>> overlay = FXLoadingOverlay(my_widget, "Loading assets...")
>>> overlay.show()
>>> # ... do some work ...
>>> overlay.hide()

Methods:

Name Description
hide

Hide the overlay and stop the spinner.

paintEvent

Paint the semi-transparent background.

resizeEvent

Handle parent resize.

show

Show the overlay and start the spinner.

Functions
hide
hide() -> None

Hide the overlay and stop the spinner.

paintEvent
paintEvent(event) -> None

Paint the semi-transparent background.

resizeEvent
resizeEvent(event) -> None

Handle parent resize.

show
show() -> None

Show the overlay and start the spinner.

FXLoadingSpinner

FXLoadingSpinner(
    parent: Optional[QWidget] = None,
    size: int = 32,
    line_width: int = 3,
    color: Optional[str] = None,
    style: str = "spinner",
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets._loading_spinner.FXLoadingSpinner[FXLoadingSpinner]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets._loading_spinner.FXLoadingSpinner
                


              click fxgui.fxwidgets._loading_spinner.FXLoadingSpinner href "" "fxgui.fxwidgets._loading_spinner.FXLoadingSpinner"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A themeable animated loading indicator.

This widget provides a modern spinning/pulsing loading indicator with customizable colors and animation styles.

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
size
int

Size of the spinner in pixels.

32
line_width
int

Width of the spinner lines.

3
color
Optional[str]

Spinner color. If None, uses theme accent.

None
style
str

Animation style ('spinner', 'dots', 'pulse').

'spinner'

Examples:

>>> spinner = FXLoadingSpinner(size=32)
>>> spinner.start()
>>> # ... do some work ...
>>> spinner.stop()

Methods:

Name Description
angle

Set the rotation angle.

is_spinning

Return whether the spinner is currently animating.

paintEvent

Paint the loading spinner.

set_color

Set the spinner color.

set_style

Set the animation style.

start

Start the loading animation.

stop

Stop the loading animation.

Functions
angle
angle(value: int) -> None

Set the rotation angle.

is_spinning
is_spinning() -> bool

Return whether the spinner is currently animating.

paintEvent
paintEvent(event) -> None

Paint the loading spinner.

set_color
set_color(color: str) -> None

Set the spinner color.

Parameters:

Name Type Description Default
color str

Color string (hex, rgb, etc.).

required
set_style
set_style(style: str) -> None

Set the animation style.

Parameters:

Name Type Description Default
style str

Animation style ('spinner', 'dots', 'pulse').

required
start
start() -> None

Start the loading animation.

stop
stop() -> None

Stop the loading animation.