navigation ========== .. py:module:: qfluentwidgets.components.navigation .. toctree:: :titlesonly: :maxdepth: 1 breadcrumb/index.rst navigation_bar/index.rst navigation_interface/index.rst navigation_panel/index.rst navigation_widget/index.rst pivot/index.rst segmented_widget/index.rst Package Contents ---------------- .. autoapisummary:: qfluentwidgets.components.navigation.NavigationWidget qfluentwidgets.components.navigation.NavigationPushButton qfluentwidgets.components.navigation.NavigationSeparator qfluentwidgets.components.navigation.NavigationToolButton qfluentwidgets.components.navigation.NavigationTreeWidget qfluentwidgets.components.navigation.NavigationTreeWidgetBase qfluentwidgets.components.navigation.NavigationAvatarWidget qfluentwidgets.components.navigation.NavigationItemHeader qfluentwidgets.components.navigation.NavigationUserCard qfluentwidgets.components.navigation.NavigationPanel qfluentwidgets.components.navigation.NavigationItemPosition qfluentwidgets.components.navigation.NavigationDisplayMode qfluentwidgets.components.navigation.NavigationInterface qfluentwidgets.components.navigation.NavigationBarPushButton qfluentwidgets.components.navigation.NavigationBar qfluentwidgets.components.navigation.Pivot qfluentwidgets.components.navigation.PivotItem qfluentwidgets.components.navigation.SegmentedItem qfluentwidgets.components.navigation.SegmentedWidget qfluentwidgets.components.navigation.SegmentedToolItem qfluentwidgets.components.navigation.SegmentedToolWidget qfluentwidgets.components.navigation.SegmentedToggleToolItem qfluentwidgets.components.navigation.SegmentedToggleToolWidget qfluentwidgets.components.navigation.BreadcrumbBar qfluentwidgets.components.navigation.BreadcrumbItem .. py:class:: NavigationWidget(isSelectable: bool, parent=None) Bases: :py:obj:`PyQt5.QtWidgets.QWidget` Navigation widget .. py:attribute:: clicked .. py:attribute:: selectedChanged .. py:attribute:: EXPAND_WIDTH :value: 312 .. py:attribute:: isCompacted :value: True .. py:attribute:: isSelected :value: False .. py:attribute:: isPressed :value: False .. py:attribute:: isEnter :value: False .. py:attribute:: isAboutSelected :value: False .. py:attribute:: isSelectable .. py:attribute:: treeParent :value: None .. py:attribute:: nodeDepth :value: 0 .. py:attribute:: lightTextColor .. py:attribute:: darkTextColor .. py:attribute:: lightIndicatorColor .. py:attribute:: darkIndicatorColor .. py:method:: enterEvent(e) .. py:method:: leaveEvent(e) .. py:method:: mousePressEvent(e) .. py:method:: mouseReleaseEvent(e) .. py:method:: click() .. py:method:: setCompacted(isCompacted: bool) set whether the widget is compacted .. py:method:: setSelected(isSelected: bool) set whether the button is selected Parameters ---------- isSelected: bool whether the button is selected .. py:method:: textColor() .. py:method:: setLightTextColor(color) set the text color in light theme mode .. py:method:: setDarkTextColor(color) set the text color in dark theme mode .. py:method:: setTextColor(light, dark) set the text color in light/dark theme mode .. py:method:: setAboutSelected(selected: bool) .. py:method:: indicatorRect() get the indicator geometry .. py:method:: setIndicatorColor(light, dark) .. py:class:: NavigationPushButton(icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIcon], text: str, isSelectable: bool, parent=None) Bases: :py:obj:`NavigationWidget` Navigation push button .. py:method:: text() .. py:method:: setText(text: str) .. py:method:: icon() .. py:method:: setIcon(icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIcon]) .. py:method:: paintEvent(e) .. py:class:: NavigationSeparator(parent=None) Bases: :py:obj:`NavigationWidget` Navigation Separator .. py:method:: setCompacted(isCompacted: bool) set whether the widget is compacted .. py:method:: paintEvent(e) .. py:class:: NavigationToolButton(icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIcon], parent=None) Bases: :py:obj:`NavigationPushButton` Navigation tool button .. py:method:: setCompacted(isCompacted: bool) set whether the widget is compacted .. py:class:: NavigationTreeWidget(icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIcon], text: str, isSelectable: bool, parent=None) Bases: :py:obj:`NavigationTreeWidgetBase` Navigation tree widget .. py:attribute:: expanded .. py:attribute:: treeChildren :type: List[NavigationTreeWidget] :value: [] .. py:attribute:: isExpanded :value: False .. py:attribute:: itemWidget .. py:attribute:: vBoxLayout .. py:attribute:: expandAni .. py:method:: addChild(child) add child Parameters ---------- child: NavigationTreeWidgetBase child item .. py:method:: text() .. py:method:: icon() .. py:method:: setText(text) .. py:method:: setIcon(icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIcon]) .. py:method:: textColor() .. py:method:: setLightTextColor(color) set the text color in light theme mode .. py:method:: setDarkTextColor(color) set the text color in dark theme mode .. py:method:: setTextColor(light, dark) set the text color in light/dark theme mode .. py:method:: setIndicatorColor(light, dark) set the indicator color in light/dark theme mode .. py:method:: setFont(font: PyQt5.QtGui.QFont) .. py:method:: clone() .. py:method:: suitableWidth() .. py:method:: insertChild(index, child) insert child Parameters ---------- child: NavigationTreeWidgetBase child item .. py:method:: removeChild(child) remove child Parameters ---------- child: NavigationTreeWidgetBase child item .. py:method:: childItems() -> list return child items .. py:method:: setExpanded(isExpanded: bool, ani=False) set the expanded status .. py:method:: isRoot() is root node .. py:method:: isLeaf() is leaf node .. py:method:: setSelected(isSelected: bool) set whether the button is selected Parameters ---------- isSelected: bool whether the button is selected .. py:method:: mouseReleaseEvent(e) .. py:method:: setCompacted(isCompacted: bool) set whether the widget is compacted .. py:method:: setAboutSelected(selected: bool) .. py:method:: setRememberExpandState(remember: bool) set whether to remember expand state .. py:method:: saveExpandState() save current expand state .. py:method:: restoreExpandState(ani=True) restore saved expand state .. py:class:: NavigationTreeWidgetBase(isSelectable: bool, parent=None) Bases: :py:obj:`NavigationWidget` Navigation tree widget base class .. py:method:: addChild(child) :abstractmethod: add child Parameters ---------- child: NavigationTreeWidgetBase child item .. py:method:: insertChild(index: int, child: NavigationWidget) :abstractmethod: insert child Parameters ---------- child: NavigationTreeWidgetBase child item .. py:method:: removeChild(child: NavigationWidget) :abstractmethod: remove child Parameters ---------- child: NavigationTreeWidgetBase child item .. py:method:: isRoot() is root node .. py:method:: isLeaf() is leaf node .. py:method:: setExpanded(isExpanded: bool) :abstractmethod: set the expanded status Parameters ---------- isExpanded: bool whether to expand node .. py:method:: childItems() -> list :abstractmethod: return child items .. py:method:: setRememberExpandState(remember: bool) :abstractmethod: set whether to remember expand state .. py:method:: saveExpandState() :abstractmethod: save current expand state .. py:method:: restoreExpandState(ani=True) :abstractmethod: restore saved expand state .. py:class:: NavigationAvatarWidget(name: str, avatar: Union[str, PyQt5.QtGui.QPixmap, PyQt5.QtGui.QImage] = None, parent=None) Bases: :py:obj:`NavigationWidget` Avatar widget .. py:attribute:: name .. py:attribute:: avatar .. py:method:: setName(name: str) .. py:method:: setAvatar(avatar: Union[str, PyQt5.QtGui.QPixmap, PyQt5.QtGui.QImage]) .. py:method:: paintEvent(e) .. py:class:: NavigationItemHeader(text: str, parent=None) Bases: :py:obj:`NavigationWidget` Navigation item header for grouping items .. py:attribute:: lightTextColor .. py:attribute:: darkTextColor .. py:attribute:: heightAni .. py:method:: text() .. py:method:: setText(text: str) .. py:method:: setCompacted(isCompacted: bool) set whether the widget is compacted .. py:method:: mousePressEvent(e) .. py:method:: mouseReleaseEvent(e) .. py:method:: enterEvent(e) .. py:method:: leaveEvent(e) .. py:method:: paintEvent(e) .. py:class:: NavigationUserCard(parent=None) Bases: :py:obj:`NavigationAvatarWidget` Navigation user card widget .. py:method:: setAvatarIcon(icon: qfluentwidgets.common.icon.FluentIcon) set avatar icon when no image is set .. py:method:: setAvatarBackgroundColor(light: PyQt5.QtGui.QColor, dark: PyQt5.QtGui.QColor) set avatar background color in light/dark theme mode .. py:method:: title() get user card title .. py:method:: setTitle(title: str) set user card title .. py:method:: subtitle() get user card subtitle .. py:method:: setSubtitle(subtitle: str) set user card subtitle .. py:method:: setTitleFontSize(size: int) set title font size .. py:method:: setSubtitleFontSize(size: int) set subtitle font size .. py:method:: setAnimationDuration(duration: int) set animation duration in milliseconds .. py:method:: setCompacted(isCompacted: bool) set whether the widget is compacted .. py:method:: paintEvent(e) .. py:method:: textOpacity() .. py:method:: subtitleColor() .. py:class:: NavigationPanel(parent=None, isMinimalEnabled=False) Bases: :py:obj:`PyQt5.QtWidgets.QFrame` Navigation panel .. py:attribute:: displayModeChanged .. py:attribute:: indicator .. 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 :value: False .. py:method:: isIndicatorAnimationEnabled() .. py:method:: setIndicatorAnimationEnabled(isEnabled: bool) .. py:method:: isUpdateIndicatorPosOnCollapseFinished() .. py:method:: setUpdateIndicatorPosOnCollapseFinished(update: bool) .. 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:: addItemHeader(text: str, position=NavigationItemPosition.TOP) add item header Parameters ---------- text: str header text position: NavigationItemPosition where to add the header Returns ------- NavigationItemHeader created header widget .. py:method:: insertItemHeader(index: int, text: str, position=NavigationItemPosition.TOP) insert item header Parameters ---------- index: int insert position text: str header text position: NavigationItemPosition where to add the header Returns ------- NavigationItemHeader created header widget .. 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:: currentItem() .. py:method:: isCollapsed() .. py:method:: eventFilter(obj, e: PyQt5.QtCore.QEvent) .. py:method:: layoutMinHeight() .. py:method:: paintEvent(e) .. 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:: 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:: 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) .. py:class:: NavigationBarPushButton(icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIcon], text: str, isSelectable: bool, selectedIcon=None, parent=None) Bases: :py:obj:`qfluentwidgets.components.navigation.navigation_widget.NavigationPushButton` Navigation bar push button .. py:attribute:: iconAni .. py:attribute:: lightSelectedColor .. py:attribute:: darkSelectedColor .. py:method:: setSelectedColor(light, dark) .. py:method:: selectedIcon() .. py:method:: setSelectedIcon(icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIcon]) .. py:method:: setSelectedTextVisible(isVisible) .. py:method:: indicatorRect() get the indicator geometry .. py:method:: paintEvent(e) .. py:method:: setSelected(isSelected: bool) set whether the button is selected Parameters ---------- isSelected: bool whether the button is selected .. py:class:: NavigationBar(parent=None) Bases: :py:obj:`PyQt5.QtWidgets.QWidget` .. py:attribute:: indicator .. py:attribute:: lightSelectedColor .. py:attribute:: darkSelectedColor .. py:attribute:: scrollArea .. py:attribute:: scrollWidget .. py:attribute:: vBoxLayout .. py:attribute:: topLayout .. py:attribute:: bottomLayout .. py:attribute:: scrollLayout .. py:attribute:: items :type: Dict[str, qfluentwidgets.components.navigation.navigation_widget.NavigationWidget] .. py:attribute:: history .. 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, selectedIcon=None, position=NavigationItemPosition.TOP) 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 selectable: bool whether the item is selectable selectedIcon: str | QIcon | FluentIconBase the icon of navigation item in selected state position: NavigationItemPosition where the button is added .. py:method:: addWidget(routeKey: str, widget: qfluentwidgets.components.navigation.navigation_widget.NavigationWidget, onClick=None, position=NavigationItemPosition.TOP) 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 .. py:method:: insertItem(index: int, routeKey: str, icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase], text: str, onClick=None, selectable=True, selectedIcon=None, position=NavigationItemPosition.TOP) 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 selectable: bool whether the item is selectable selectedIcon: str | QIcon | FluentIconBase the icon of navigation item in selected state position: NavigationItemPosition where the button is added .. py:method:: insertWidget(index: int, routeKey: str, widget: qfluentwidgets.components.navigation.navigation_widget.NavigationWidget, onClick=None, position=NavigationItemPosition.TOP) 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 .. py:method:: removeWidget(routeKey: str) remove widget Parameters ---------- routeKey: str the unique name of item .. py:method:: currentItem() .. py:method:: setCurrentItem(routeKey: str) set current selected item Parameters ---------- routeKey: str the unique name of item .. py:method:: setFont(font: PyQt5.QtGui.QFont) set the font of navigation item .. py:method:: setSelectedTextVisible(isVisible: bool) set whether the text is visible when button is selected .. py:method:: isSelectedTextVisible() .. py:method:: setSelectedColor(light, dark) set the selected color of all items .. py:method:: buttons() .. py:method:: isIndicatorAnimationEnabled() .. py:method:: setIndicatorAnimationEnabled(isEnabled: bool) .. py:class:: Pivot(parent=None) Bases: :py:obj:`PyQt5.QtWidgets.QWidget` Pivot .. py:attribute:: currentItemChanged .. py:attribute:: items :type: Dict[str, PivotItem] .. py:attribute:: lightIndicatorColor .. py:attribute:: darkIndicatorColor .. py:attribute:: hBoxLayout .. py:attribute:: slideAni .. py:method:: addItem(routeKey: str, text: str, onClick=None, icon=None) add item Parameters ---------- routeKey: str the unique name of item text: str the text of navigation item onClick: callable the slot connected to item clicked signal icon: str the icon of navigation item .. py:method:: addWidget(routeKey: str, widget: PivotItem, onClick=None) add widget Parameters ---------- routeKey: str the unique name of item widget: PivotItem navigation widget onClick: callable the slot connected to item clicked signal .. py:method:: insertItem(index: int, routeKey: str, text: str, onClick=None, icon=None) insert item Parameters ---------- index: int insert position routeKey: str the unique name of item text: str the text of navigation item onClick: callable the slot connected to item clicked signal icon: str the icon of navigation item .. py:method:: insertWidget(index: int, routeKey: str, widget: PivotItem, onClick=None) insert item Parameters ---------- index: int insert position routeKey: str the unique name of item widget: PivotItem navigation widget onClick: callable the slot connected to item clicked signal .. py:method:: removeWidget(routeKey: str) remove widget Parameters ---------- routeKey: str the unique name of item .. py:method:: clear() clear all navigation items .. py:method:: currentItem() Returns the current selected item .. py:method:: currentRouteKey() .. py:method:: setCurrentItem(routeKey: str) set current selected item Parameters ---------- routeKey: str the unique name of item .. py:method:: showEvent(e) .. py:method:: setIndicatorLength(len: int) .. py:method:: indicatorLength() .. py:method:: setItemFontSize(size: int) set the pixel font size of items .. py:method:: setItemText(routeKey: str, text: str) set the text of item .. py:method:: setIndicatorColor(light, dark) .. py:method:: widget(routeKey: str) .. py:method:: resizeEvent(e) -> None .. py:method:: currentIndicatorGeometry() .. py:method:: paintEvent(e) .. py:class:: PivotItem(parent: PyQt5.QtWidgets.QWidget = None) Bases: :py:obj:`qfluentwidgets.components.widgets.button.PushButton` Pivot item .. py:attribute:: itemClicked .. py:method:: setSelected(isSelected: bool) .. py:class:: SegmentedItem(parent: PyQt5.QtWidgets.QWidget = None) Bases: :py:obj:`qfluentwidgets.components.navigation.pivot.PivotItem` Segmented item .. py:class:: SegmentedWidget(parent=None) Bases: :py:obj:`qfluentwidgets.components.navigation.pivot.Pivot` Segmented widget .. py:attribute:: slideAni .. py:method:: insertItem(index: int, routeKey: str, text: str, onClick=None, icon=None) insert item Parameters ---------- index: int insert position routeKey: str the unique name of item text: str the text of navigation item onClick: callable the slot connected to item clicked signal icon: str the icon of navigation item .. py:method:: paintEvent(e) .. py:method:: currentIndicatorGeometry() .. py:class:: SegmentedToolItem(parent: PyQt5.QtWidgets.QWidget = None) Bases: :py:obj:`qfluentwidgets.components.widgets.button.ToolButton` Pivot item .. py:attribute:: itemClicked .. py:method:: setSelected(isSelected: bool) .. py:class:: SegmentedToolWidget(parent=None) Bases: :py:obj:`SegmentedWidget` Segmented tool widget .. py:method:: addItem(routeKey: str, icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase], onClick=None) add item Parameters ---------- routeKey: str the unique name of item icon: str | QIcon | FluentIconBase the icon of navigation item onClick: callable the slot connected to item clicked signal .. py:method:: insertItem(index: int, routeKey: str, icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase], onClick=None) insert item Parameters ---------- index: int insert position routeKey: str the unique name of item text: str the text of navigation item onClick: callable the slot connected to item clicked signal icon: str the icon of navigation item .. py:class:: SegmentedToggleToolItem(parent: PyQt5.QtWidgets.QWidget = None) Bases: :py:obj:`qfluentwidgets.components.widgets.button.TransparentToolButton` Transparent background tool button Constructors ------------ * TransparentToolButton(`parent`: QWidget = None) * TransparentToolButton(`icon`: QIcon | str | FluentIconBase, `parent`: QWidget = None) .. py:attribute:: itemClicked .. py:method:: setSelected(isSelected: bool) .. py:class:: SegmentedToggleToolWidget(parent=None) Bases: :py:obj:`SegmentedToolWidget` Segmented toggle tool widget .. py:method:: paintEvent(e) .. py:class:: BreadcrumbBar(parent=None) Bases: :py:obj:`PyQt5.QtWidgets.QWidget` Breadcrumb bar .. py:attribute:: currentItemChanged .. py:attribute:: currentIndexChanged .. py:attribute:: itemMap :type: Dict[BreadcrumbItem] .. py:attribute:: items :type: List[BreadcrumbItem] :value: [] .. py:attribute:: hiddenItems :type: List[BreadcrumbItem] :value: [] .. py:attribute:: elideButton .. py:method:: addItem(routeKey: str, text: str) add item Parameters ---------- routeKey: str unique key of item text: str the text of item .. py:method:: setCurrentIndex(index: int) .. py:method:: setCurrentItem(routeKey: str) .. py:method:: setItemText(routeKey: str, text: str) .. py:method:: item(routeKey: str) -> BreadcrumbItem .. py:method:: itemAt(index: int) .. py:method:: currentIndex() .. py:method:: currentItem() -> BreadcrumbItem .. py:method:: resizeEvent(e) .. py:method:: clear() clear all items .. py:method:: popItem() pop trailing item .. py:method:: count() Returns the number of items .. py:method:: updateGeometry() .. py:method:: isElideVisible() .. py:method:: setFont(font: PyQt5.QtGui.QFont) .. py:method:: getSpacing() .. py:method:: setSpacing(spacing: int) .. py:attribute:: spacing .. py:class:: BreadcrumbItem(routeKey: str, text: str, index: int, parent=None) Bases: :py:obj:`BreadcrumbWidget` Breadcrumb item .. py:attribute:: text .. py:attribute:: routeKey .. py:attribute:: isHover :value: False .. py:attribute:: isPressed :value: False .. py:attribute:: isSelected :value: False .. py:attribute:: index .. py:attribute:: spacing :value: 5 .. py:method:: setText(text: str) .. py:method:: isRoot() .. py:method:: setSelected(isSelected: bool) .. py:method:: setFont(font: PyQt5.QtGui.QFont) .. py:method:: setSpacing(spacing: int) .. py:method:: paintEvent(e)