navigation

Package Contents

NavigationWidget

Navigation widget

NavigationPushButton

Navigation push button

NavigationSeparator

Navigation Separator

NavigationToolButton

Navigation tool button

NavigationTreeWidget

Navigation tree widget

NavigationTreeWidgetBase

Navigation tree widget base class

NavigationAvatarWidget

Avatar widget

NavigationPanel

Navigation panel

NavigationItemPosition

Navigation item position

NavigationDisplayMode

Navigation display mode

NavigationInterface

Navigation interface

NavigationBarPushButton

Navigation bar push button

NavigationBar

Pivot

Pivot

PivotItem

Pivot item

SegmentedItem

Segmented item

SegmentedWidget

Segmented widget

SegmentedToolItem

Pivot item

SegmentedToolWidget

Segmented tool widget

SegmentedToggleToolItem

Transparent background tool button

SegmentedToggleToolWidget

Segmented toggle tool widget

BreadcrumbBar

Breadcrumb bar

BreadcrumbItem

Breadcrumb item

class NavigationWidget(isSelectable: bool, parent=None)

Bases: PyQt5.QtWidgets.QWidget

Navigation widget

clicked
selectedChanged
EXPAND_WIDTH = 312
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

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 NavigationSeparator(parent=None)

Bases: NavigationWidget

Navigation Separator

setCompacted(isCompacted: bool)

set whether the widget is compacted

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 NavigationTreeWidget(icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIcon, text: str, isSelectable: bool, parent=None)

Bases: NavigationTreeWidgetBase

Navigation tree widget

expanded
addChild(child)

add child

Parameters

child: NavigationTreeWidgetBase

child item

text()
icon()
setText(text)
setIcon(icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIcon)
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 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 NavigationAvatarWidget(name: str, avatar: str | PyQt5.QtGui.QPixmap | PyQt5.QtGui.QImage, parent=None)

Bases: NavigationWidget

Avatar widget

setName(name: str)
setAvatar(avatar: str | PyQt5.QtGui.QPixmap | PyQt5.QtGui.QImage)
paintEvent(e)
class NavigationPanel(parent=None, isMinimalEnabled=False)

Bases: PyQt5.QtWidgets.QFrame

Navigation panel

displayModeChanged
widget(routeKey: str)
addItem(routeKey: str, icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase, text: str, onClick=None, selectable=True, position=NavigationItemPosition.TOP, tooltip: str = None, parentRouteKey: str = None)

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

position: NavigationItemPosition

where the button is added

selectable: bool

whether the item is selectable

tooltip: str

the tooltip of item

parentRouteKey: str

the route key of parent item, the parent widget should be NavigationTreeWidget

addWidget(routeKey: str, widget: qfluentwidgets.components.navigation.navigation_widget.NavigationWidget, onClick=None, position=NavigationItemPosition.TOP, tooltip: str = None, parentRouteKey: str = None)

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

tooltip: str

the tooltip of widget

parentRouteKey: str

the route key of parent item, the parent item should be NavigationTreeWidget

insertItem(index: int, routeKey: str, icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase, text: str, onClick=None, selectable=True, position=NavigationItemPosition.TOP, tooltip: str = None, parentRouteKey=None)

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

position: NavigationItemPosition

where the button is added

selectable: bool

whether the item is selectable

tooltip: str

the tooltip of item

parentRouteKey: str

the route key of parent item, the parent item should be NavigationTreeWidget

insertWidget(index: int, routeKey: str, widget: qfluentwidgets.components.navigation.navigation_widget.NavigationWidget, onClick=None, position=NavigationItemPosition.TOP, tooltip: str = None, parentRouteKey: str = None)

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

tooltip: str

the tooltip of widget

parentRouteKey: str

the route key of parent item, the parent item should be NavigationTreeWidget

addSeparator(position=NavigationItemPosition.TOP)

add separator

Parameters

position: NavigationPostion

where to add the separator

insertSeparator(index: int, position=NavigationItemPosition.TOP)

add separator

Parameters

index: int

insert position

position: NavigationPostion

where to add the separator

removeWidget(routeKey: str)

remove widget

Parameters

routeKey: str

the unique name of item

setMenuButtonVisible(isVisible: bool)

set whether the menu button is visible

setReturnButtonVisible(isVisible: bool)

set whether the return button is visible

setCollapsible(on: bool)
setExpandWidth(width: int)

set the maximum width

setMinimumExpandWidth(width: int)

Set the minimum window width that allows panel to be expanded

setAcrylicEnabled(isEnabled: bool)
isAcrylicEnabled()

whether the acrylic effect is enabled

expand(useAni=True)

expand navigation panel

collapse()

collapse navigation panel

toggle()

toggle navigation panel

setCurrentItem(routeKey: str)

set current selected item

Parameters

routeKey: str

the unique name of item

isCollapsed()
resizeEvent(e: PyQt5.QtGui.QResizeEvent)
eventFilter(obj, e: PyQt5.QtCore.QEvent)
layoutMinHeight()
paintEvent(e)
class NavigationItemPosition

Bases: enum.Enum

Navigation item position

TOP = 0
SCROLL = 1
BOTTOM = 2
class NavigationDisplayMode

Bases: enum.Enum

Navigation display mode

MINIMAL = 0
COMPACT = 1
EXPAND = 2
MENU = 3
class NavigationInterface(parent=None, showMenuButton=True, showReturnButton=False, collapsible=True)

Bases: PyQt5.QtWidgets.QWidget

Navigation interface

displayModeChanged
addItem(routeKey: str, icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase, text: str, onClick=None, selectable=True, position=NavigationItemPosition.TOP, tooltip: str = None, parentRouteKey: str = None) qfluentwidgets.components.navigation.navigation_widget.NavigationTreeWidget

add navigation item

Parameters

routKey: 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

position: NavigationItemPosition

where the button is added

tooltip: str

the tooltip of item

parentRouteKey: str

the route key of parent item, the parent item should be NavigationTreeWidgetBase

addWidget(routeKey: str, widget: qfluentwidgets.components.navigation.navigation_panel.NavigationWidget, onClick=None, position=NavigationItemPosition.TOP, tooltip: str = None, parentRouteKey: str = None)

add custom widget

Parameters

routKey: 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 widget is added

tooltip: str

the tooltip of widget

parentRouteKey: str

the route key of parent item, the parent item should be NavigationTreeWidgetBase

insertItem(index: int, routeKey: str, icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase, text: str, onClick=None, selectable=True, position=NavigationItemPosition.TOP, tooltip: str = None, parentRouteKey: str = None) qfluentwidgets.components.navigation.navigation_widget.NavigationTreeWidget

insert navigation item

Parameters

index: int

insert position

routKey: 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

position: NavigationItemPosition

where the item is added

tooltip: str

the tooltip of item

parentRouteKey: str

the route key of parent item, the parent item should be NavigationTreeWidgetBase

insertWidget(index: int, routeKey: str, widget: qfluentwidgets.components.navigation.navigation_panel.NavigationWidget, onClick=None, position=NavigationItemPosition.TOP, tooltip: str = None, parentRouteKey: str = None)

insert custom widget

Parameters

index: int

insert position

routKey: 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 widget is added

tooltip: str

the tooltip of widget

parentRouteKey: str

the route key of parent item, the parent item should be NavigationTreeWidgetBase

addSeparator(position=NavigationItemPosition.TOP)

add separator

Parameters

position: NavigationPostion

where to add the separator

insertSeparator(index: int, position=NavigationItemPosition.TOP)

add separator

Parameters

index: int

insert position

position: NavigationPostion

where to add the separator

removeWidget(routeKey: str)

remove widget

Parameters

routKey: str

the unique name of item

setCurrentItem(name: str)

set current selected item

Parameters

name: str

the unique name of item

expand(useAni=True)

expand navigation panel

toggle()

toggle navigation panel

setExpandWidth(width: int)

set the maximum width

setMinimumExpandWidth(width: int)

Set the minimum window width that allows panel to be expanded

setMenuButtonVisible(isVisible: bool)

set whether the menu button is visible

setReturnButtonVisible(isVisible: bool)

set whether the return button is visible

setCollapsible(collapsible: bool)
isAcrylicEnabled()
setAcrylicEnabled(isEnabled: bool)

set whether the acrylic background effect is enabled

widget(routeKey: str)
eventFilter(obj, e: PyQt5.QtCore.QEvent)
resizeEvent(e: PyQt5.QtGui.QResizeEvent)
class NavigationBarPushButton(icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIcon, text: str, isSelectable: bool, selectedIcon=None, parent=None)

Bases: qfluentwidgets.components.navigation.navigation_widget.NavigationPushButton

Navigation bar push button

selectedIcon()
setSelectedIcon(icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIcon)
setSelectedTextVisible(isVisible)
paintEvent(e)
setSelected(isSelected: bool)

set whether the button is selected

Parameters

isSelected: bool

whether the button is selected

class NavigationBar(parent=None)

Bases: PyQt5.QtWidgets.QWidget

widget(routeKey: str)
addItem(routeKey: str, icon: 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

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

insertItem(index: int, routeKey: str, icon: 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

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

removeWidget(routeKey: str)

remove widget

Parameters

routeKey: str

the unique name of item

setCurrentItem(routeKey: str)

set current selected item

Parameters

routeKey: str

the unique name of item

setFont(font: PyQt5.QtGui.QFont)

set the font of navigation item

setSelectedTextVisible(isVisible: bool)

set whether the text is visible when button is selected

buttons()
class Pivot(parent=None)

Bases: PyQt5.QtWidgets.QWidget

Pivot

addItem(routeKey: str, text: str, onClick=None, icon=None)

add item

Parameters

routeKey: str

the unique name of item

text: str

the text of navigation item

onClick: callable

the slot connected to item clicked signal

icon: str

the icon of navigation item

addWidget(routeKey: str, widget: PivotItem, onClick=None)

add widget

Parameters

routeKey: str

the unique name of item

widget: PivotItem

navigation widget

onClick: callable

the slot connected to item clicked signal

insertItem(index: int, routeKey: str, text: str, onClick=None, icon=None)

insert item

Parameters

index: int

insert position

routeKey: str

the unique name of item

text: str

the text of navigation item

onClick: callable

the slot connected to item clicked signal

icon: str

the icon of navigation item

insertWidget(index: int, routeKey: str, widget: PivotItem, onClick=None)

insert item

Parameters

index: int

insert position

routeKey: str

the unique name of item

widget: PivotItem

navigation widget

onClick: callable

the slot connected to item clicked signal

removeWidget(routeKey: str)

remove widget

Parameters

routeKey: str

the unique name of item

clear()

clear all navigation items

currentItem()

Returns the current selected item

setCurrentItem(routeKey: str)

set current selected item

Parameters

routeKey: str

the unique name of item

setItemFontSize(size: int)

set the pixel font size of items

widget(routeKey: str)
resizeEvent(e) None
paintEvent(e)
class PivotItem(parent: PyQt5.QtWidgets.QWidget = None)

Bases: qfluentwidgets.components.widgets.button.PushButton

Pivot item

itemClicked
setSelected(isSelected: bool)
class SegmentedItem(parent: PyQt5.QtWidgets.QWidget = None)

Bases: qfluentwidgets.components.navigation.pivot.PivotItem

Segmented item

class SegmentedWidget(parent=None)

Bases: qfluentwidgets.components.navigation.pivot.Pivot

Segmented widget

insertItem(index: int, routeKey: str, text: str, onClick=None, icon=None)

insert item

Parameters

index: int

insert position

routeKey: str

the unique name of item

text: str

the text of navigation item

onClick: callable

the slot connected to item clicked signal

icon: str

the icon of navigation item

paintEvent(e)
class SegmentedToolItem(parent: PyQt5.QtWidgets.QWidget = None)

Bases: qfluentwidgets.components.widgets.button.ToolButton

Pivot item

itemClicked
setSelected(isSelected: bool)
class SegmentedToolWidget(parent=None)

Bases: SegmentedWidget

Segmented tool widget

addItem(routeKey: str, icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase, onClick=None)

add item

Parameters

routeKey: str

the unique name of item

icon: str | QIcon | FluentIconBase

the icon of navigation item

onClick: callable

the slot connected to item clicked signal

insertItem(index: int, routeKey: str, icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase, onClick=None)

insert item

Parameters

index: int

insert position

routeKey: str

the unique name of item

text: str

the text of navigation item

onClick: callable

the slot connected to item clicked signal

icon: str

the icon of navigation item

class SegmentedToggleToolItem(parent: PyQt5.QtWidgets.QWidget = None)

Bases: qfluentwidgets.components.widgets.button.TransparentToolButton

Transparent background tool button

Constructors

  • TransparentToolButton(parent: QWidget = None)

  • TransparentToolButton(icon: QIcon | str | FluentIconBase, parent: QWidget = None)

itemClicked
setSelected(isSelected: bool)
class SegmentedToggleToolWidget(parent=None)

Bases: SegmentedToolWidget

Segmented toggle tool widget

paintEvent(e)
class BreadcrumbBar(parent=None)

Bases: PyQt5.QtWidgets.QWidget

Breadcrumb bar

currentItemChanged
currentIndexChanged
spacing
addItem(routeKey: str, text: str)

add item

Parameters

routeKey: str

unique key of item

text: str

the text of item

setCurrentIndex(index: int)
setCurrentItem(routeKey: str)
item(routeKey: str)
currentIndex()
currentItem() BreadcrumbItem
resizeEvent(e)
clear()

clear all items

popItem()

pop trailing item

count()

Returns the number of items

updateGeometry()
isElideVisible()
setFont(font: PyQt5.QtGui.QFont)
getSpacing()
setSpacing(spacing: int)
class BreadcrumbItem(routeKey: str, text: str, index: int, parent=None)

Bases: BreadcrumbWidget

Breadcrumb item

setText(text: str)
isRoot()
setSelected(isSelected: bool)
setFont(font: PyQt5.QtGui.QFont)
setSpacing(spacing: int)
paintEvent(e)