navigation_panel

Module Contents

NavigationDisplayMode

导航显示模式

NavigationItemPosition

导航菜单项位置

NavigationToolTipFilter

Navigation tool tip filter

NavigationItem

Navigation item

NavigationPanel

侧边导航面板

NavigationItemLayout

导航布局

class NavigationDisplayMode

Bases: enum.Enum

导航显示模式

MINIMAL = 0
COMPACT = 1
EXPAND = 2
MENU = 3
class NavigationItemPosition

Bases: enum.Enum

导航菜单项位置

TOP = 0
SCROLL = 1
BOTTOM = 2
class NavigationToolTipFilter(parent: PyQt5.QtWidgets.QWidget, showDelay=300, position=ToolTipPosition.TOP)

Bases: qfluentwidgets.components.widgets.tool_tip.ToolTipFilter

Navigation tool tip filter

exception RouteKeyError

Bases: Exception

Route key error

class NavigationItem(routeKey: str, parentRouteKey: str, widget: qfluentwidgets.components.navigation.navigation_widget.NavigationWidget)

Navigation item

routeKey
parentRouteKey
widget
class NavigationPanel(parent=None, isMinimalEnabled=False)

Bases: PyQt5.QtWidgets.QFrame

侧边导航面板

displayModeChanged
acrylicBrush
scrollArea
scrollWidget
menuButton
returnButton
vBoxLayout
topLayout
bottomLayout
scrollLayout
items: Dict[str, NavigationItem]
history
expandAni
expandWidth = 322
minimumExpandWidth = 1008
isMinimalEnabled
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)

添加导航菜单项

参数

routeKey: str

导航菜单项的唯一名字

icon: str | QIcon | FluentIconBase

导航菜单项的图标

text: str

导航菜单项的文本

onClick: callable

导航菜单项点击信号的槽函数

position: NavigationItemPosition

导航菜单项的添加位置

selectable: bool

导航菜单项是否可以选中

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)

添加自定义导航小部件

参数

routeKey: str

导航菜单项的唯一名字

widget: NavigationWidget

自定义的导航小部件

onClick: callable

导航菜单项点击信号的槽函数

position: NavigationItemPosition

导航菜单项的添加位置

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

参数

index: int

the insert position of parent widget

routeKey: str

导航菜单项的唯一名字

icon: str | QIcon | FluentIconBase

导航菜单项的图标

text: str

导航菜单项的文本

onClick: callable

导航菜单项点击信号的槽函数

position: NavigationItemPosition

导航菜单项的添加位置

selectable: bool

导航菜单项是否可以选中

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

参数

index: int

insert position

routeKey: str

导航菜单项的唯一名字

widget: NavigationWidget

自定义的导航小部件

onClick: callable

导航菜单项点击信号的槽函数

position: NavigationItemPosition

导航菜单项的添加位置

tooltip: str

the tooltip of widget

parentRouteKey: str

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

addSeparator(position=NavigationItemPosition.TOP)

添加分隔符

参数

position: NavigationPostion

分隔符的添加位置

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

添加分隔符

参数

index: int

insert position

position: NavigationPostion

分隔符的添加位置

removeWidget(routeKey: str)

移除小部件

参数

routeKey: str

导航菜单项的唯一名字

setMenuButtonVisible(isVisible: bool)

设置菜单按钮是否可见

setReturnButtonVisible(isVisible: bool)

set whether the return button is visible

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

设置展开后最大宽度

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)

展开导航面板

collapse()

折叠导航面板

toggle()

切换导航面板的收缩状态

setCurrentItem(routeKey: str)

设置当前选中的导航项

参数

routeKey: str

导航菜单项的唯一名字

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

Bases: PyQt5.QtWidgets.QVBoxLayout

导航布局

setGeometry(rect: PyQt5.QtCore.QRect)