bec_widgets.utils.container_utils ================================= .. py:module:: bec_widgets.utils.container_utils Classes ------- .. autoapisummary:: bec_widgets.utils.container_utils.WidgetContainerUtils Module Contents --------------- .. py:class:: WidgetContainerUtils .. py:method:: find_first_widget_by_class(container: dict, widget_class: Type[qtpy.QtWidgets.QWidget], can_fail: bool = True) -> qtpy.QtWidgets.QWidget | None :staticmethod: Find the first widget of a given class in the figure. :param container: The container of widgets. :type container: dict :param widget_class: The class of the widget to find. :type widget_class: Type :param can_fail: If True, the method will return None if no widget is found. If False, it will raise an error. :type can_fail: bool :returns: The widget of the given class. :rtype: widget .. py:method:: generate_unique_name(name: str, list_of_names: list[str] | None = None) -> str :staticmethod: Generate a unique ID. :param name: The name of the widget. :type name: str :returns: The unique name :rtype: tuple (str) .. py:method:: has_name_valid_chars(name: str) -> bool :staticmethod: Check if the name is valid. :param name: The name to be checked. :type name: str :returns: True if the name is valid, False otherwise. :rtype: bool .. py:method:: name_is_protected(name: str, container: Any = None) -> bool :staticmethod: Check if the name is not protected. :param name: The name to be checked. :type name: str :returns: True if the name is not protected, False otherwise. :rtype: bool .. py:method:: raise_for_invalid_name(name: str, container: Any = None) -> None :staticmethod: Check if the name is valid. If not, raise a ValueError. :param name: The name to be checked. :type name: str :raises ValueError: If the name is not valid.