navigation_panel ================ .. py:module:: qfluentwidgets.components.navigation.navigation_panel Module Contents --------------- .. autoapisummary:: qfluentwidgets.components.navigation.navigation_panel.NavigationDisplayMode qfluentwidgets.components.navigation.navigation_panel.NavigationItemPosition qfluentwidgets.components.navigation.navigation_panel.NavigationToolTipFilter qfluentwidgets.components.navigation.navigation_panel.NavigationItem qfluentwidgets.components.navigation.navigation_panel.NavigationPanel qfluentwidgets.components.navigation.navigation_panel.NavigationItemLayout .. py:class:: NavigationDisplayMode Bases: :py:obj:`enum.Enum` Navigation display mode .. py:attribute:: MINIMAL :value: 0 .. py:attribute:: COMPACT :value: 1 .. py:attribute:: EXPAND :value: 2 .. py:attribute:: MENU :value: 3 .. py:class:: NavigationItemPosition Bases: :py:obj:`enum.Enum` Navigation item position .. py:attribute:: TOP :value: 0 .. py:attribute:: SCROLL :value: 1 .. py:attribute:: BOTTOM :value: 2 .. py:class:: NavigationToolTipFilter(parent: PyQt5.QtWidgets.QWidget, showDelay=300, position=ToolTipPosition.TOP) Bases: :py:obj:`qfluentwidgets.components.widgets.tool_tip.ToolTipFilter` Navigation tool tip filter .. py:exception:: RouteKeyError Bases: :py:obj:`Exception` Route key error .. py:class:: NavigationItem(routeKey: str, parentRouteKey: str, widget: qfluentwidgets.components.navigation.navigation_widget.NavigationWidget) Navigation item .. py:attribute:: routeKey .. py:attribute:: parentRouteKey .. py:attribute:: widget .. py:class:: NavigationPanel(parent=None, isMinimalEnabled=False) Bases: :py:obj:`PyQt5.QtWidgets.QFrame` Navigation panel .. py:attribute:: displayModeChanged .. py:attribute:: acrylicBrush .. py:attribute:: scrollArea .. py:attribute:: scrollWidget .. py:attribute:: menuButton .. py:attribute:: returnButton .. py:attribute:: vBoxLayout .. py:attribute:: topLayout .. py:attribute:: bottomLayout .. py:attribute:: scrollLayout .. py:attribute:: items :type: Dict[str, NavigationItem] .. py:attribute:: history .. py:attribute:: expandAni .. py:attribute:: expandWidth :value: 322 .. py:attribute:: minimumExpandWidth :value: 1008 .. py:attribute:: isMinimalEnabled .. py:method:: widget(routeKey: str) .. 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) add navigation item Parameters ---------- routeKey: 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 position: NavigationItemPosition where the button is added selectable: bool whether the item is selectable tooltip: str the tooltip of item parentRouteKey: str the route key of parent item, the parent widget should be `NavigationTreeWidget` .. py:method:: addWidget(routeKey: str, widget: qfluentwidgets.components.navigation.navigation_widget.NavigationWidget, onClick=None, position=NavigationItemPosition.TOP, tooltip: str = None, parentRouteKey: str = None) add custom widget Parameters ---------- routeKey: 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 button is added tooltip: str the tooltip of widget parentRouteKey: str the route key of parent item, the parent item should be `NavigationTreeWidget` .. 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=None) insert navigation tree item Parameters ---------- index: int the insert position of parent widget routeKey: 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 position: NavigationItemPosition where the button is added selectable: bool whether the item is selectable tooltip: str the tooltip of item parentRouteKey: str the route key of parent item, the parent item should be `NavigationTreeWidget` .. py:method:: insertWidget(index: int, routeKey: str, widget: qfluentwidgets.components.navigation.navigation_widget.NavigationWidget, onClick=None, position=NavigationItemPosition.TOP, tooltip: str = None, parentRouteKey: str = None) insert custom widget Parameters ---------- index: int insert position routeKey: 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 button is added tooltip: str the tooltip of widget parentRouteKey: str the route key of parent item, the parent item should be `NavigationTreeWidget` .. py:method:: addSeparator(position=NavigationItemPosition.TOP) add separator Parameters ---------- position: NavigationPostion where to add the separator .. 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 ---------- routeKey: str the unique name of item .. 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(on: bool) .. 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:: setAcrylicEnabled(isEnabled: bool) .. py:method:: isAcrylicEnabled() whether the acrylic effect is enabled .. py:method:: expand(useAni=True) expand navigation panel .. py:method:: collapse() collapse navigation panel .. py:method:: toggle() toggle navigation panel .. py:method:: setCurrentItem(routeKey: str) set current selected item Parameters ---------- routeKey: str the unique name of item .. py:method:: isCollapsed() .. py:method:: resizeEvent(e: PyQt5.QtGui.QResizeEvent) .. py:method:: eventFilter(obj, e: PyQt5.QtCore.QEvent) .. py:method:: layoutMinHeight() .. py:method:: paintEvent(e) .. py:class:: NavigationItemLayout Bases: :py:obj:`PyQt5.QtWidgets.QVBoxLayout` Navigation layout .. py:method:: setGeometry(rect: PyQt5.QtCore.QRect)