navigation_widget

Module Contents

NavigationWidget

Navigation widget

NavigationPushButton

Navigation push button

NavigationToolButton

Navigation tool button

NavigationSeparator

Navigation Separator

NavigationItemHeader

Navigation item header for grouping items

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

NavigationUserCard

Navigation user card widget

NavigationIndicator

Navigation indicator

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
isAboutSelected = False
isSelectable
treeParent = None
nodeDepth = 0
lightTextColor
darkTextColor
lightIndicatorColor
darkIndicatorColor
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

setAboutSelected(selected: bool)
indicatorRect()

get the indicator geometry

setIndicatorColor(light, dark)
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 NavigationItemHeader(text: str, parent=None)

Bases: NavigationWidget

Navigation item header for grouping items

lightTextColor
darkTextColor
heightAni
text()
setText(text: str)
setCompacted(isCompacted: bool)

set whether the widget is compacted

mousePressEvent(e)
mouseReleaseEvent(e)
enterEvent(e)
leaveEvent(e)
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)
treeWidget() NavigationTreeWidget
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

abstract setRememberExpandState(remember: bool)

set whether to remember expand state

abstract saveExpandState()

save current expand state

abstract restoreExpandState(ani=True)

restore saved expand state

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

setIndicatorColor(light, dark)

set the indicator 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

setAboutSelected(selected: bool)
setRememberExpandState(remember: bool)

set whether to remember expand state

saveExpandState()

save current expand state

restoreExpandState(ani=True)

restore saved expand state

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

Bases: NavigationWidget

Avatar widget

name
avatar
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()
class NavigationUserCard(parent=None)

Bases: NavigationAvatarWidget

Navigation user card widget

setAvatarIcon(icon: qfluentwidgets.common.icon.FluentIcon)

set avatar icon when no image is set

setAvatarBackgroundColor(light: PyQt5.QtGui.QColor, dark: PyQt5.QtGui.QColor)

set avatar background color in light/dark theme mode

title()

get user card title

setTitle(title: str)

set user card title

subtitle()

get user card subtitle

setSubtitle(subtitle: str)

set user card subtitle

setTitleFontSize(size: int)

set title font size

setSubtitleFontSize(size: int)

set subtitle font size

setAnimationDuration(duration: int)

set animation duration in milliseconds

setCompacted(isCompacted: bool)

set whether the widget is compacted

paintEvent(e)
textOpacity()
subtitleColor()
class NavigationIndicator(parent=None)

Bases: PyQt5.QtWidgets.QWidget

Navigation indicator

aniFinished
lightColor
darkColor
scaleSlideAni
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

stopAnimation()

Stop animation

setIndicatorColor(light, dark)
paintEvent(e)