Class: QgsTabWidget

class qgis.gui.QgsTabWidget

Bases: PyQt5.QtWidgets.QTabWidget

The QgsTabWidget class is the same as the QTabWidget but with additional methods to temporarily hide/show tabs.

New in version 3.0.

QgsTabWidget(parent: QWidget = None) Create a new QgsTabWidget with the optionally provided parent.

New in version 3.0:

Methods

actionEvent

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

hideTab

Hides the tab with the given widget

initPainter

initStyleOption

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

realTabIndex

Returns the index of the tab with the given widget.

receivers

resizeEvent

sender

senderSignalIndex

setTabBar

setTabStyle

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

setTabVisible

Control the visibility for the tab with the given widget.

sharedPainter

showEvent

showTab

Shows the tab with the given widget

tabInserted

Is called internally whenever a new tab has been inserted.

tabRemoved

Is called internally whenever a tab has been removed.

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

actionEvent(self, QActionEvent)
changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
event(self, QEvent) bool
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
hideEvent(self, QHideEvent)
hideTab(self, tab: QWidget)

Hides the tab with the given widget

New in version 3.0.

Parameters

tab (QWidget) –

initPainter(self, QPainter)
initStyleOption(self, QStyleOptionTabWidgetFrame)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod) bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
metric(self, QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int]
paintEvent(self, QPaintEvent)
realTabIndex(self, widget: QWidget) int

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.

New in version 3.0.

Parameters

widget (QWidget) –

Return type

int

receivers(self, PYQT_SIGNAL) int
resizeEvent(self, QResizeEvent)
sender(self) QObject
senderSignalIndex(self) int
setTabBar(self, QTabBar)
setTabStyle(self, tabIndex: int, labelStyle: QgsAttributeEditorElement.LabelStyle)

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

New in version 3.26.

Parameters
setTabVisible(self, tab: QWidget, visible: bool)

Control the visibility for the tab with the given widget.

New in version 3.0.

Parameters
  • tab (QWidget) –

  • visible (bool) –

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
showTab(self, tab: QWidget)

Shows the tab with the given widget

New in version 3.0.

Parameters

tab (QWidget) –

tabInserted(self, index: int)

Is called internally whenever a new tab has been inserted.

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

New in version 3.0.

Parameters

index (int) –

tabRemoved(self, index: int)

Is called internally whenever a tab has been removed.

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

New in version 3.0.

Parameters

index (int) –

tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)