bec_widgets.utils.busy_loader ============================= .. py:module:: bec_widgets.utils.busy_loader Classes ------- .. autoapisummary:: bec_widgets.utils.busy_loader.BusyLoaderOverlay bec_widgets.utils.busy_loader._OverlayEventFilter Functions --------- .. autoapisummary:: bec_widgets.utils.busy_loader.install_busy_loader Module Contents --------------- .. py:class:: BusyLoaderOverlay(parent: qtpy.QtWidgets.QWidget, opacity: float = 0.35, **kwargs) Bases: :py:obj:`qtpy.QtWidgets.QWidget` A semi-transparent scrim with centered text and an animated spinner. Call show()/hide() directly, or use via `install_busy_loader(...)`. :param parent: The parent widget to overlay. :type parent: QWidget :param text: Initial text to display. :type text: str :param opacity: Overlay opacity (0..1). :type opacity: float :returns: The overlay instance. :rtype: BusyLoaderOverlay .. py:method:: _update_palette() Update colors from the current application theme. .. py:method:: cleanup() Cleanup resources used by the overlay. .. py:method:: foreground_color() -> qtpy.QtGui.QColor The overlay foreground color (text, spinner). .. py:method:: hideEvent(e) .. py:method:: resizeEvent(e) .. py:method:: scrim_color() -> qtpy.QtGui.QColor The overlay scrim color. .. py:method:: set_filter(filt: _OverlayEventFilter) Set an event filter to keep the overlay sized and stacked over its target. :param filt: The event filter instance. :type filt: QObject .. py:method:: set_opacity(opacity: float) Set the overlay opacity. Only values between 0.0 and 1.0 are accepted. If a value outside this range is provided, it will be clamped. :param opacity: The opacity value between 0.0 (fully transparent) and 1.0 (fully opaque). :type opacity: float .. py:method:: set_widget(widget: qtpy.QtWidgets.QWidget) Set a custom widget as an overlay for the busy overlay. :param widget: The custom widget to display. :type widget: QWidget .. py:method:: showEvent(e) .. py:attribute:: foreground_color_changed .. py:attribute:: scrim_color_changed .. py:class:: _OverlayEventFilter(target: qtpy.QtWidgets.QWidget, overlay: qtpy.QtWidgets.QWidget) Bases: :py:obj:`qtpy.QtCore.QObject` Keeps the overlay sized and stacked over its target widget. .. py:method:: eventFilter(obj, event) .. py:function:: install_busy_loader(target: qtpy.QtWidgets.QWidget, start_loading: bool = False, opacity: float = 0.35) -> BusyLoaderOverlay Attach a BusyLoaderOverlay to `target` and keep it sized and stacked. :param target: The widget to overlay. :type target: QWidget :param start_loading: If True, show the overlay immediately. :type start_loading: bool :param opacity: Overlay opacity (0..1). :type opacity: float :returns: The overlay instance. :rtype: BusyLoaderOverlay