navigation_panel#
Module Contents#
导航显示模式 |
|
导航菜单项位置 |
|
Navigation tool tip filter |
|
Navigation item |
|
侧边导航面板 |
|
导航布局 |
- class NavigationDisplayMode#
Bases:
enum.Enum
导航显示模式
- MINIMAL = 0#
- COMPACT = 1#
- EXPAND = 2#
- MENU = 3#
- 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
- class NavigationPanel(parent=None, isMinimalEnabled=False)#
Bases:
PyQt5.QtWidgets.QFrame
侧边导航面板
- 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)#
添加导航菜单项
参数#
- 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
- insertSeparator(index: int, position=NavigationItemPosition.TOP)#
添加分隔符
参数#
- index: int
insert position
- position: NavigationPostion
分隔符的添加位置
- 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()#
切换导航面板的收缩状态
- isCollapsed()#
- resizeEvent(e: PyQt5.QtGui.QResizeEvent)#
- eventFilter(obj, e: PyQt5.QtCore.QEvent)#
- layoutMinHeight()#
- paintEvent(e)#