navigation_widget

Module Contents

NavigationWidget

Navigation widget

NavigationPushButton

Navigation push button

NavigationToolButton

Navigation tool button

NavigationSeparator

Navigation Separator

NavigationTreeItem

Navigation tree item widget

NavigationTreeWidgetBase

Navigation tree widget base class

NavigationTreeWidget

Navigation tree widget

NavigationAvatarWidget

Avatar widget

NavigationItemInfoBadgeManager

Navigation item info badge manager

NavigationFlyoutMenu

Navigation flyout menu

class NavigationWidget(isSelectable: bool, parent=None)

Bases: PyQt5.QtWidgets.QWidget

Navigation widget

clicked
selectedChanged
EXPAND_WIDTH = 312
isCompacted = True
isSelected = False
isPressed = False
isEnter = False
isSelectable
treeParent = None
nodeDepth = 0
lightTextColor
darkTextColor
enterEvent(e)
leaveEvent(e)
mousePressEvent(e)
mouseReleaseEvent(e)
click()
setCompacted(isCompacted: bool)

set whether the widget is compacted

setSelected(isSelected: bool)

set whether the button is selected

Parameters

isSelected: bool

whether the button is selected

textColor()
setLightTextColor(color)

set the text color in light theme mode

setDarkTextColor(color)

set the text color in dark theme mode

setTextColor(light, dark)

set the text color in light/dark theme mode

class NavigationPushButton(icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIcon, text: str, isSelectable: bool, parent=None)

Bases: NavigationWidget

Navigation push button

text()
setText(text: str)
icon()
setIcon(icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIcon)
paintEvent(e)
class NavigationToolButton(icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIcon, parent=None)

Bases: NavigationPushButton

Navigation tool button

setCompacted(isCompacted: bool)

set whether the widget is compacted

class NavigationSeparator(parent=None)

Bases: NavigationWidget

Navigation Separator

setCompacted(isCompacted: bool)

set whether the widget is compacted

paintEvent(e)
class NavigationTreeItem(icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIcon, text: str, isSelectable: bool, parent=None)

Bases: NavigationPushButton

Navigation tree item widget

itemClicked
rotateAni
setExpanded(isExpanded: bool)
mouseReleaseEvent(e)
paintEvent(e)
getArrowAngle()
setArrowAngle(angle)
arrowAngle
class NavigationTreeWidgetBase(isSelectable: bool, parent=None)

Bases: NavigationWidget

Navigation tree widget base class

abstract addChild(child)

add child

Parameters

child: NavigationTreeWidgetBase

child item

abstract insertChild(index: int, child: NavigationWidget)

insert child

Parameters

child: NavigationTreeWidgetBase

child item

abstract removeChild(child: NavigationWidget)

remove child

Parameters

child: NavigationTreeWidgetBase

child item

isRoot()

is root node

isLeaf()

is leaf node

abstract setExpanded(isExpanded: bool)

set the expanded status

Parameters

isExpanded: bool

whether to expand node

abstract childItems() list

return child items

class NavigationTreeWidget(icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIcon, text: str, isSelectable: bool, parent=None)

Bases: NavigationTreeWidgetBase

Navigation tree widget

expanded
treeChildren: List[NavigationTreeWidget] = []
isExpanded = False
itemWidget
vBoxLayout
expandAni
addChild(child)

add child

Parameters

child: NavigationTreeWidgetBase

child item

text()
icon()
setText(text)
setIcon(icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIcon)
textColor()
setLightTextColor(color)

set the text color in light theme mode

setDarkTextColor(color)

set the text color in dark theme mode

setTextColor(light, dark)

set the text color in light/dark theme mode

setFont(font: PyQt5.QtGui.QFont)
clone()
suitableWidth()
insertChild(index, child)

insert child

Parameters

child: NavigationTreeWidgetBase

child item

removeChild(child)

remove child

Parameters

child: NavigationTreeWidgetBase

child item

childItems() list

return child items

setExpanded(isExpanded: bool, ani=False)

set the expanded status

isRoot()

is root node

isLeaf()

is leaf node

setSelected(isSelected: bool)

set whether the button is selected

Parameters

isSelected: bool

whether the button is selected

mouseReleaseEvent(e)
setCompacted(isCompacted: bool)

set whether the widget is compacted

class NavigationAvatarWidget(name: str, avatar: str | PyQt5.QtGui.QPixmap | PyQt5.QtGui.QImage, parent=None)

Bases: NavigationWidget

Avatar widget

name
setName(name: str)
setAvatar(avatar: str | PyQt5.QtGui.QPixmap | PyQt5.QtGui.QImage)
paintEvent(e)
class NavigationItemInfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge)

Bases: qfluentwidgets.components.widgets.info_badge.InfoBadgeManager

Navigation item info badge manager

eventFilter(obj, e: PyQt5.QtCore.QEvent)
position()

return the position of info badge

class NavigationFlyoutMenu(tree: NavigationTreeWidget, parent=None)

Bases: qfluentwidgets.components.widgets.scroll_area.ScrollArea

Navigation flyout menu

expanded
view
treeWidget
treeChildren = []
vBoxLayout
visibleTreeNodes()