bec_widgets.applications.main_app ================================= .. py:module:: bec_widgets.applications.main_app Classes ------- .. autoapisummary:: bec_widgets.applications.main_app.BECMainApp Functions --------- .. autoapisummary:: bec_widgets.applications.main_app.main Module Contents --------------- .. py:class:: BECMainApp(parent=None, *args, anim_duration: int = ANIMATION_DURATION, show_examples: bool = False, **kwargs) Bases: :py:obj:`bec_widgets.widgets.containers.main_window.main_window.BECMainWindow` Mixin class for all BEC widgets, to handle cleanup Base class for all BEC widgets. This class should be used as a mixin class for all BEC widgets, e.g.: >>> class MyWidget(BECWidget, QWidget): >>> def __init__(self, parent=None, client=None, config=None, gui_id=None): >>> super().__init__(parent=parent, client=client, config=config, gui_id=gui_id) :param client: The BEC client. :type client: BECClient, optional :param config: The connection configuration. :type config: ConnectionConfig, optional :param gui_id: The GUI ID. :type gui_id: str, optional :param theme_update: Whether to subscribe to theme updates. Defaults to False. When set to True, the widget's apply_theme method will be called when the theme changes. :type theme_update: bool, optional .. py:method:: _add_guided_tour_to_menu() Add a 'Guided Tour' action to the Help menu. .. py:method:: _add_views() .. py:method:: _on_view_selected(vid: str) -> None .. py:method:: _setup_guided_tour() Setup the guided tour for the main application. Registers key UI components and delegates to views for their internal components. .. py:method:: add_dark_mode_item(id: str = 'dark_mode', position: int | None = None) .. py:method:: add_section(title: str, id: str, position: int | None = None) .. py:method:: add_separator() .. py:method:: add_view(*, icon: str, title: str, view_id: str | None = None, widget: qtpy.QtWidgets.QWidget, mini_text: str | None = None, position: int | None = None, from_top: bool = True, toggleable: bool = True, exclusive: bool = True) -> bec_widgets.applications.navigation_centre.side_bar_components.NavigationItem Register a view in the stack and create a matching nav item in the sidebar. :param icon: Icon name for the nav item. :type icon: str :param title: Title for the nav item. :type title: str :param view_id: Unique ID for the view/item. If omitted, uses mini_text; if mini_text is also omitted, uses title. :type view_id: str, optional :param widget: The widget to add to the stack. :type widget: QWidget :param mini_text: Short text for the nav item when sidebar is collapsed. :type mini_text: str, optional :param position: Position to insert the nav item. :type position: int, optional :param from_top: Whether to count position from the top or bottom. :type from_top: bool, optional :param toggleable: Whether the nav item is toggleable. :type toggleable: bool, optional :param exclusive: Whether the nav item is exclusive. :type exclusive: bool, optional :returns: The created navigation item. :rtype: NavigationItem .. py:method:: cleanup() Cleanup the widget. .. py:method:: set_current(id: str) -> None .. py:method:: start_guided_tour() Public method to start the guided tour. This can be called programmatically or connected to a menu/button action. .. py:attribute:: PLUGIN :value: False .. py:attribute:: RPC :value: False .. py:attribute:: guided_tour .. py:attribute:: sidebar .. py:attribute:: stack .. py:function:: main() Main function to run the BEC main application, exposed as a script entry point through pyproject.toml.