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
Hides the tab with the given widget
Returns the index of the tab with the given widget.
Sets the optional custom
labelStyle
for the tab identified bytabIndex
.Control the visibility for the tab with the given widget.
Shows the tab with the given widget
Is called internally whenever a new tab has been inserted.
Is called internally whenever a tab has been removed.
- 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 bytabIndex
.New in version 3.26.
- Parameters:
tabIndex (int) –
labelStyle (QgsAttributeEditorElement.LabelStyle) –
- 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) –
- 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)¶