bec_widgets.utils.widget_state_manager ====================================== .. py:module:: bec_widgets.utils.widget_state_manager Attributes ---------- .. autoapisummary:: bec_widgets.utils.widget_state_manager.PROPERTY_TO_SKIP Classes ------- .. autoapisummary:: bec_widgets.utils.widget_state_manager.ExampleApp bec_widgets.utils.widget_state_manager.WidgetStateManager Module Contents --------------- .. py:class:: ExampleApp Bases: :py:obj:`qtpy.QtWidgets.QWidget` .. py:attribute:: check_box .. py:attribute:: check_box_skip .. py:attribute:: line_edit .. py:attribute:: load_button .. py:attribute:: panel_checkbox .. py:attribute:: panel_edit .. py:attribute:: panel_label .. py:attribute:: save_button .. py:attribute:: side_panel .. py:attribute:: spin_box .. py:attribute:: state_manager .. py:class:: WidgetStateManager(widget, *, serialize_from_root: bool = False, root_id: str | None = None) Manage saving and loading widget state to/from an INI file. :param widget: Root widget whose subtree will be serialized. :type widget: QWidget :param serialize_from_root: When True, build group names relative to this root and ignore parents above it. This keeps profiles portable between different host window hierarchies. :type serialize_from_root: bool :param root_id: Optional stable label to use for the root in the settings key path. When omitted and `serialize_from_root` is True, the class name of `widget` is used, falling back to its objectName and finally to "root". :type root_id: str | None .. py:method:: _get_full_widget_name(widget: qtpy.QtWidgets.QWidget) -> str Build a group key for *widget*. When `serialize_from_root` is False (default), this preserves the original behavior and walks all parents up to the top-level widget. When `serialize_from_root` is True, the key is built relative to `self.widget` and parents above the managed root are ignored. The first path segment is either `root_id` (when provided) or a stable label derived from the root widget (class name, then objectName, then "root"). :param widget: The widget to build the key for. :type widget: QWidget .. py:method:: _load_widget_state_qsettings(widget: qtpy.QtWidgets.QWidget, settings: qtpy.QtCore.QSettings, recursive: bool = True) Load the state of the widget from QSettings. :param widget: The widget to load the state for. :type widget: QWidget :param settings: The QSettings object to load the state from. :type settings: QSettings :param recursive: Whether to recursively load the state of child widgets. :type recursive: bool .. py:method:: _save_widget_state_qsettings(widget: qtpy.QtWidgets.QWidget, settings: qtpy.QtCore.QSettings, recursive: bool = True) Save the state of the widget to QSettings. :param widget: The widget to save the state for. :type widget: QWidget :param settings: The QSettings object to save the state to. :type settings: QSettings :param recursive: Whether to recursively save the state of child widgets. :type recursive: bool .. py:method:: load_state(filename: str | None = None, settings: qtpy.QtCore.QSettings | None = None) Load the state of the widget from an INI file. :param filename: The filename to load the state from. :type filename: str :param settings: Optional QSettings object to load the state from. :type settings: QSettings .. py:method:: save_state(filename: str | None = None, settings: qtpy.QtCore.QSettings | None = None) Save the state of the widget to an INI file. :param filename: The filename to save the state to. :type filename: str :param settings: Optional QSettings object to save the state to. :type settings: QSettings .. py:attribute:: widget .. py:data:: PROPERTY_TO_SKIP :value: ['palette', 'font', 'windowIcon', 'windowIconText', 'locale', 'styleSheet', 'updatesEnabled',...