pyqtribbon.tabbar module

class pyqtribbon.tabbar.RibbonTabBar(parent=None)[source]

Bases: QTabBar

The TabBar for the title widget.

Create a new tab bar.

Parameters:

parent – The parent widget.

addAssociatedTabs(name: str, texts: List[str], color: QColor) List[int][source]

Add associated multiple tabs which have the same color to the tab bar.

Parameters:
  • name – The name of the context category.

  • texts – The texts of the tabs.

  • color – The color of the tabs.

Returns:

The indices of the tabs.

addTab(text: str, color: QColor | None = None, *args, **kwargs) int[source]

Add a new tab to the tab bar.

Parameters:
  • text – The text of the tab.

  • color – The color of the tab.

Returns:

The index of the tab.

changeColor(inx: int) None[source]

Change tab’s color.

currentTabColor() QColor[source]

Current tab color

Returns:

Current tab color

indexOf(tabName: str) int[source]

Return the index of the tab with the given name.

Parameters:

tabName – The name of the tab.

Returns:

The index of the tab.

removeAssociatedTabs(titles: List[str]) None[source]

Remove tabs with the given titles.

Parameters:

titles – The titles of the tabs to remove.

tabTitles() List[str][source]

Return the titles of all tabs.

Returns:

The titles of all tabs.