navigation_widget ================= .. py:module:: qfluentwidgets.components.navigation.navigation_widget Module Contents --------------- .. autoapisummary:: qfluentwidgets.components.navigation.navigation_widget.NavigationWidget qfluentwidgets.components.navigation.navigation_widget.NavigationPushButton qfluentwidgets.components.navigation.navigation_widget.NavigationToolButton qfluentwidgets.components.navigation.navigation_widget.NavigationSeparator qfluentwidgets.components.navigation.navigation_widget.NavigationItemHeader qfluentwidgets.components.navigation.navigation_widget.NavigationTreeItem qfluentwidgets.components.navigation.navigation_widget.NavigationTreeWidgetBase qfluentwidgets.components.navigation.navigation_widget.NavigationTreeWidget qfluentwidgets.components.navigation.navigation_widget.NavigationAvatarWidget qfluentwidgets.components.navigation.navigation_widget.NavigationItemInfoBadgeManager qfluentwidgets.components.navigation.navigation_widget.NavigationFlyoutMenu qfluentwidgets.components.navigation.navigation_widget.NavigationUserCard qfluentwidgets.components.navigation.navigation_widget.NavigationIndicator .. 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:: 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:: 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:: 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:: NavigationTreeItem(icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIcon], text: str, isSelectable: bool, parent=None) Bases: :py:obj:`NavigationPushButton` Navigation tree item widget .. py:attribute:: itemClicked .. py:attribute:: rotateAni .. py:method:: setExpanded(isExpanded: bool) .. py:method:: mouseReleaseEvent(e) .. py:method:: paintEvent(e) .. py:method:: treeWidget() -> NavigationTreeWidget .. py:method:: getArrowAngle() .. py:method:: setArrowAngle(angle) .. py:attribute:: arrowAngle .. 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:: 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:: 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:: NavigationItemInfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge) Bases: :py:obj:`qfluentwidgets.components.widgets.info_badge.InfoBadgeManager` Navigation item info badge manager .. py:method:: eventFilter(obj, e: PyQt5.QtCore.QEvent) .. py:method:: position() return the position of info badge .. py:class:: NavigationFlyoutMenu(tree: NavigationTreeWidget, parent=None) Bases: :py:obj:`qfluentwidgets.components.widgets.scroll_area.ScrollArea` Navigation flyout menu .. py:attribute:: expanded .. py:attribute:: view .. py:attribute:: treeWidget .. py:attribute:: treeChildren :value: [] .. py:attribute:: vBoxLayout .. py:method:: visibleTreeNodes() .. 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:: NavigationIndicator(parent=None) Bases: :py:obj:`PyQt5.QtWidgets.QWidget` Navigation indicator .. py:attribute:: aniFinished .. py:attribute:: lightColor .. py:attribute:: darkColor .. py:attribute:: scaleSlideAni .. py:method:: startAnimation(startRect: PyQt5.QtCore.QRectF, endRect: PyQt5.QtCore.QRectF, useCrossFade=False) Start indicator animation Parameters ----------- endRect: QRectF the final geometry of indicator useCrossFade: bool whether to use cross fade animation .. py:method:: stopAnimation() Stop animation .. py:method:: setIndicatorColor(light, dark) .. py:method:: paintEvent(e)