Class: QgsTabWidget

A QTabWidget with additional methods to temporarily hide/show tabs.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsTabWidget

Base classes

QTabWidget

QWidget

QObject

QPaintDevice

class qgis.gui.QgsTabWidget[source]

Bases: QTabWidget

__init__(parent: QWidget | None = None)

Create a new QgsTabWidget with the optionally provided parent.

Parameters:

parent (Optional[QWidget] = None)

hideTab(self, tab: QWidget | None)[source]

Hides the tab with the given widget

Parameters:

tab (Optional[QWidget])

realTabIndex(self, widget: QWidget | None) int[source]

Returns the index of the tab with the given widget. This index is not the same as the one provided to insertTab and removeTab since these methods are not aware of hidden tabs.

Parameters:

widget (Optional[QWidget])

Return type:

int

setTabStyle(self, tabIndex: int, labelStyle: QgsAttributeEditorElement.LabelStyle)[source]

Sets the optional custom labelStyle for the tab identified by tabIndex.

Added in version 3.26.

Parameters:
setTabVisible(self, tab: QWidget | None, visible: bool)[source]

Control the visibility for the tab with the given widget.

Parameters:
  • tab (Optional[QWidget])

  • visible (bool)

showTab(self, tab: QWidget | None)[source]

Shows the tab with the given widget

Parameters:

tab (Optional[QWidget])

virtual tabInserted(self, index: int)[source]

Is called internally whenever a new tab has been inserted.

Is used to keep track of currently available and visible tabs.

Parameters:

index (int)

virtual tabRemoved(self, index: int)[source]

Is called internally whenever a tab has been removed.

Is used to keep track of currently available and visible tabs.

Parameters:

index (int)