bec_widgets.utils.layout_manager ================================ .. py:module:: bec_widgets.utils.layout_manager Classes ------- .. autoapisummary:: bec_widgets.utils.layout_manager.GridLayoutManager Module Contents --------------- .. py:class:: GridLayoutManager(layout: qtpy.QtWidgets.QGridLayout) GridLayoutManager class is used to manage widgets in a QGridLayout and extend its functionality. The GridLayoutManager class provides methods to add, move, and check the position of widgets in a QGridLayout. It also provides a method to get the positions of all widgets in the layout. :param layout: The layout to manage. :type layout: QGridLayout .. py:method:: add_widget(widget: qtpy.QtWidgets.QWidget, row=None, col=0, rowspan=1, colspan=1, shift: Literal['down', 'up', 'left', 'right'] = 'down') Add a widget to the layout at the specified position. :param widget: The widget to add. :type widget: QWidget :param row: The row to add the widget to. If None, the widget will be added to the next available row. :type row: int :param col: The column to add the widget to. Default is 0. :type col: int :param rowspan: The number of rows the widget will span. Default is 1. :type rowspan: int :param colspan: The number of columns the widget will span. Default is 1. :type colspan: int :param shift: The direction to shift the widgets if the position is occupied. Can be "down", "up", "left", or "right". :type shift: str .. py:method:: get_widgets_positions() -> dict Get the positions of all widgets in the layout. :returns: A dictionary with the positions of the widgets in the layout. :rtype: dict .. py:method:: is_position_occupied(row: int, col: int) -> bool Check if the position in the layout is occupied by a widget. :param row: The row to check. :type row: int :param col: The column to check. :type col: int :returns: True if the position is occupied, False otherwise. :rtype: bool .. py:method:: move_widget(widget: qtpy.QtWidgets.QWidget, new_row: int, new_col: int) Move a widget to a new position in the layout. :param widget: The widget to move. :type widget: QWidget :param new_row: The new row to move the widget to. :type new_row: int :param new_col: The new column to move the widget to. :type new_col: int .. py:method:: shift_widgets(direction: Literal['down', 'up', 'left', 'right'] = 'down', start_row: int = 0, start_col: int = 0) Shift widgets in the layout in the specified direction starting from the specified position. :param direction: The direction to shift the widgets. Can be "down", "up", "left", or "right". :type direction: str :param start_row: The row to start shifting from. Default is 0. :type start_row: int :param start_col: The column to start shifting from. Default is 0. :type start_col: int .. py:attribute:: layout