tab_view

Module Contents

TabCloseButtonDisplayMode

Tab close button display mode

TabToolButton

Tab tool button

TabItem

Tab item

TabBar

Tab bar

checkIndex(*default)

decorator for index checking

class TabCloseButtonDisplayMode

Bases: enum.Enum

Tab close button display mode

ALWAYS = 0
ON_HOVER = 1
NEVER = 2
checkIndex(*default)

decorator for index checking

Parameters

*default:

the default value returned when an index overflow

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

Bases: qfluentwidgets.components.widgets.button.TransparentToolButton

Tab tool button

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

Bases: qfluentwidgets.components.widgets.button.PushButton

Tab item

closed
slideTo(x: int, duration=250)
setShadowEnabled(isEnabled: bool)

set whether the shadow is enabled

setRouteKey(key: str)
routeKey()
setBorderRadius(radius: int)
setSelected(isSelected: bool)
setCloseButtonDisplayMode(mode: TabCloseButtonDisplayMode)

set close button display mode

setTextColor(color: PyQt5.QtGui.QColor)
setSelectedBackgroundColor(light: PyQt5.QtGui.QColor, dark: PyQt5.QtGui.QColor)

set background color in selected state

resizeEvent(e)
enterEvent(e)
leaveEvent(e)
mousePressEvent(e)
mouseMoveEvent(e)
mouseReleaseEvent(e)
sizeHint()
paintEvent(e)
class TabBar(parent=None)

Bases: qfluentwidgets.components.widgets.scroll_area.SingleDirectionScrollArea

Tab bar

currentChanged
tabBarClicked
tabCloseRequested
tabAddRequested
movable
scrollable
tabMaxWidth
tabMinWidth
tabShadowEnabled
setAddButtonVisible(isVisible: bool)
addTab(routeKey: str, text: str, icon: PyQt5.QtGui.QIcon | str | qfluentwidgets.common.icon.FluentIconBase = None, onClick=None)

add tab

Parameters

routeKey: str

the unique name of tab item

text: str

the text of tab item

text: str

the icon of tab item

onClick: callable

the slot connected to item clicked signal

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

insert tab

Parameters

index: int

the insert position of tab item

routeKey: str

the unique name of tab item

text: str

the text of tab item

text: str

the icon of tab item

onClick: callable

the slot connected to item clicked signal

removeTab(index: int)
removeTabByKey(routeKey: str)
setCurrentIndex(index: int)

set current index

setCurrentTab(routeKey: str)
currentIndex()
currentTab()
setCloseButtonDisplayMode(mode: TabCloseButtonDisplayMode)

set close button display mode

tabItem(index: int)
tab(routeKey: str)
tabRegion() PyQt5.QtCore.QRect

return the bounding rect of all tabs

tabRect(index: int)

return the visual rectangle of the tab at position index

tabText(index: int)
tabIcon(index: int)
tabToolTip(index: int)
setTabsClosable(isClosable: bool)

set whether the tab is closable

tabsClosable()
setTabIcon(index: int, icon: PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase | str)

set tab icon

setTabText(index: int, text: str)

set tab text

setTabVisible(index: int, isVisible: bool)

set the visibility of tab

setTabTextColor(index: int, color: PyQt5.QtGui.QColor)

set the text color of tab item

setTabToolTip(index: int, toolTip: str)

set tool tip of tab

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

set the background in selected state

setTabShadowEnabled(isEnabled: bool)

set whether the shadow of tab is enabled

isTabShadowEnabled()
paintEvent(e)
setMovable(movable: bool)
isMovable()
setScrollable(scrollable: bool)
setTabMaximumWidth(width: int)

set the maximum width of tab

setTabMinimumWidth(width: int)

set the minimum width of tab

tabMaximumWidth()
tabMinimumWidth()
isScrollable()
count()

returns the number of tabs

mousePressEvent(e: PyQt5.QtGui.QMouseEvent)
mouseMoveEvent(e: PyQt5.QtGui.QMouseEvent)
mouseReleaseEvent(e)