navigation_bar

Module Contents

IconSlideAnimation

Icon sliding animation

NavigationBarPushButton

Navigation bar push button

NavigationBar

class IconSlideAnimation(parent=None)

Bases: PyQt5.QtCore.QPropertyAnimation

Icon sliding animation

offset
getOffset()
setOffset(value: float)
slideDown()

slide down

slideUp()

slide up

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