navigation_widget

Module Contents

NavigationWidget

导航小部件基类

NavigationPushButton

导航按钮

NavigationToolButton

导航工具按钮

NavigationSeparator

导航分隔符

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

导航小部件基类

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)

设置小部件是否被折叠

setSelected(isSelected: bool)

设置是否被选中

参数

isSelected: bool

是否被选中

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

导航按钮

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

导航工具按钮

setCompacted(isCompacted: bool)

设置小部件是否被折叠

class NavigationSeparator(parent=None)

Bases: NavigationWidget

导航分隔符

setCompacted(isCompacted: bool)

设置小部件是否被折叠

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

参数

child: NavigationTreeWidgetBase

child item

abstract insertChild(index: int, child: NavigationWidget)

insert child

参数

child: NavigationTreeWidgetBase

child item

abstract removeChild(child: NavigationWidget)

remove child

参数

child: NavigationTreeWidgetBase

child item

isRoot()

is root node

isLeaf()

is leaf node

abstract setExpanded(isExpanded: bool)

set the expanded status

参数

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

参数

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

参数

child: NavigationTreeWidgetBase

child item

removeChild(child)

remove child

参数

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)

设置是否被选中

参数

isSelected: bool

是否被选中

mouseReleaseEvent(e)
setCompacted(isCompacted: bool)

设置小部件是否被折叠

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()