navigation_bar ============== .. py:module:: qfluentwidgets.components.navigation.navigation_bar Module Contents --------------- .. autoapisummary:: qfluentwidgets.components.navigation.navigation_bar.IconSlideAnimation qfluentwidgets.components.navigation.navigation_bar.NavigationBarPushButton qfluentwidgets.components.navigation.navigation_bar.NavigationBar .. py:class:: IconSlideAnimation(parent=None) Bases: :py:obj:`PyQt5.QtCore.QPropertyAnimation` Icon sliding animation .. py:attribute:: maxOffset :value: 6 .. py:method:: getOffset() .. py:method:: setOffset(value: float) .. py:method:: slideDown() slide down .. py:method:: slideUp() slide up .. py:attribute:: offset .. 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)