navigation_interface ==================== .. py:module:: qfluentwidgets.components.navigation.navigation_interface Module Contents --------------- .. autoapisummary:: qfluentwidgets.components.navigation.navigation_interface.NavigationInterface .. py:class:: NavigationInterface(parent=None, showMenuButton=True, showReturnButton=False, collapsible=True) Bases: :py:obj:`PyQt5.QtWidgets.QWidget` Navigation interface .. py:attribute:: displayModeChanged .. py:attribute:: panel .. py:method:: addItem(routeKey: str, icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase], text: str, onClick=None, selectable=True, position=NavigationItemPosition.TOP, tooltip: str = None, parentRouteKey: str = None) -> qfluentwidgets.components.navigation.navigation_widget.NavigationTreeWidget add navigation item Parameters ---------- routKey: str the unique name of item icon: str | QIcon | FluentIconBase the icon of navigation item text: str the text of navigation item onClick: callable the slot connected to item clicked signal selectable: bool whether the item is selectable position: NavigationItemPosition where the button is added tooltip: str the tooltip of item parentRouteKey: str the route key of parent item, the parent item should be `NavigationTreeWidgetBase` .. py:method:: addWidget(routeKey: str, widget: qfluentwidgets.components.navigation.navigation_panel.NavigationWidget, onClick=None, position=NavigationItemPosition.TOP, tooltip: str = None, parentRouteKey: str = None) add custom widget Parameters ---------- routKey: str the unique name of item widget: NavigationWidget the custom widget to be added onClick: callable the slot connected to item clicked signal position: NavigationItemPosition where the widget is added tooltip: str the tooltip of widget parentRouteKey: str the route key of parent item, the parent item should be `NavigationTreeWidgetBase` .. py:method:: insertItem(index: int, routeKey: str, icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase], text: str, onClick=None, selectable=True, position=NavigationItemPosition.TOP, tooltip: str = None, parentRouteKey: str = None) -> qfluentwidgets.components.navigation.navigation_widget.NavigationTreeWidget insert navigation item Parameters ---------- index: int insert position routKey: str the unique name of item icon: str | QIcon | FluentIconBase the icon of navigation item text: str the text of navigation item onClick: callable the slot connected to item clicked signal selectable: bool whether the item is selectable position: NavigationItemPosition where the item is added tooltip: str the tooltip of item parentRouteKey: str the route key of parent item, the parent item should be `NavigationTreeWidgetBase` .. py:method:: insertWidget(index: int, routeKey: str, widget: qfluentwidgets.components.navigation.navigation_panel.NavigationWidget, onClick=None, position=NavigationItemPosition.TOP, tooltip: str = None, parentRouteKey: str = None) insert custom widget Parameters ---------- index: int insert position routKey: str the unique name of item widget: NavigationWidget the custom widget to be added onClick: callable the slot connected to item clicked signal position: NavigationItemPosition where the widget is added tooltip: str the tooltip of widget parentRouteKey: str the route key of parent item, the parent item should be `NavigationTreeWidgetBase` .. py:method:: addSeparator(position=NavigationItemPosition.TOP) add separator Parameters ---------- position: NavigationPostion where to add the separator .. py:method:: addItemHeader(text: str, position=NavigationItemPosition.TOP) add item header for grouping navigation items Parameters ---------- text: str header text to display position: NavigationItemPosition where the header is added Returns ------- NavigationItemHeader created header widget .. py:method:: insertItemHeader(index: int, text: str, position=NavigationItemPosition.TOP) insert item header for grouping navigation items Parameters ---------- index: int insert position text: str header text to display position: NavigationItemPosition where the header is added Returns ------- NavigationItemHeader created header widget .. py:method:: addUserCard(routeKey: str, avatar: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase] = None, title: str = '', subtitle: str = '', onClick=None, position=NavigationItemPosition.TOP, aboveMenuButton: bool = False) add user card to navigation panel Parameters ---------- routeKey: str the unique name of user card avatar: str | QIcon | FluentIconBase avatar image or icon title: str user name or title text subtitle: str subtitle text (e.g., email, status) onClick: callable the slot connected to card clicked signal position: NavigationItemPosition where the card is added aboveMenuButton: bool whether to place the card above the menu button (expand/collapse button) Returns ------- NavigationUserCard created user card widget .. py:method:: insertSeparator(index: int, position=NavigationItemPosition.TOP) add separator Parameters ---------- index: int insert position position: NavigationPostion where to add the separator .. py:method:: removeWidget(routeKey: str) remove widget Parameters ---------- routKey: str the unique name of item .. py:method:: setCurrentItem(name: str) set current selected item Parameters ---------- name: str the unique name of item .. py:method:: expand(useAni=True) expand navigation panel .. py:method:: toggle() toggle navigation panel .. py:method:: setExpandWidth(width: int) set the maximum width .. py:method:: setMinimumExpandWidth(width: int) Set the minimum window width that allows panel to be expanded .. py:method:: setMenuButtonVisible(isVisible: bool) set whether the menu button is visible .. py:method:: setReturnButtonVisible(isVisible: bool) set whether the return button is visible .. py:method:: setCollapsible(collapsible: bool) .. py:method:: isAcrylicEnabled() .. py:method:: setAcrylicEnabled(isEnabled: bool) set whether the acrylic background effect is enabled .. py:method:: isIndicatorAnimationEnabled() .. py:method:: setIndicatorAnimationEnabled(isEnabled: bool) set whether the indicator sliding animation is enabled .. py:method:: isUpdateIndicatorPosOnCollapseFinished() .. py:method:: setUpdateIndicatorPosOnCollapseFinished(update: bool) set whether to update indicator position when collapese finished .. py:method:: widget(routeKey: str) .. py:method:: eventFilter(obj, e: PyQt5.QtCore.QEvent) .. py:method:: resizeEvent(e: PyQt5.QtGui.QResizeEvent)