# eric6.E5Gui.E5TabWidget

Module implementing a TabWidget class substituting QTabWidget.

### Global Attributes

None

### Classes

E5DnDTabBar | Class implementing a tab bar class substituting QTabBar.
E5TabWidget | Class implementing a tab widget class substituting QTabWidget.
E5WheelTabBar | Class implementing a tab bar class substituting QTabBar to support wheel events.

### Functions

None

## E5DnDTabBar

Class implementing a tab bar class substituting QTabBar.

### Signals

tabMoveRequested(int, int)
  emitted to signal a tab move request giving the old and new index position

### Derived from

E5WheelTabBar

### Class Attributes

None

### Class Methods

None

### Methods

E5DnDTabBar | Constructor
dragEnterEvent | Protected method to handle drag enter events.
dropEvent | Protected method to handle drop events.
mouseMoveEvent | Protected method to handle mouse move events.
mousePressEvent | Protected method to handle mouse press events.

### Static Methods

None

#### E5DnDTabBar (Constructor)

E5DnDTabBar(parent=None)

Constructor

parent
  reference to the parent widget (QWidget)

#### E5DnDTabBar.dragEnterEvent

dragEnterEvent(event)

Protected method to handle drag enter events.

event
  reference to the drag enter event (QDragEnterEvent)

#### E5DnDTabBar.dropEvent

dropEvent(event)

Protected method to handle drop events.

event
  reference to the drop event (QDropEvent)

#### E5DnDTabBar.mouseMoveEvent

mouseMoveEvent(event)

Protected method to handle mouse move events.

event
  reference to the mouse move event (QMouseEvent)

#### E5DnDTabBar.mousePressEvent

mousePressEvent(event)

Protected method to handle mouse press events.

event
  reference to the mouse press event (QMouseEvent)

Up

## E5TabWidget

Class implementing a tab widget class substituting QTabWidget.

It provides slots to show the previous and next tab and give them the input focus and it allows to have a context menu for the tabs.

### Signals

customTabContextMenuRequested(const QPoint & point, int index)
  emitted when a context menu for a tab is requested

### Derived from

QTabWidget

### Class Attributes

None

### Class Methods

None

### Methods

E5TabWidget | Constructor
__currentChanged | Private slot to handle the currentChanged signal.
__freeSide | Private method to determine the free side of a tab.
__handleTabCustomContextMenuRequested | Private slot to handle the context menu request for the tabbar.
animationLabel | Public slot to set an animated icon.
moveTab | Public method to move a tab to a new index.
nextTab | Public slot used to show the next tab.
prevTab | Public slot used to show the previous tab.
resetAnimation | Public slot to reset an animated icon.
selectTab | Public method to get the index of a tab given a position.
setCustomTabBar | Public method to set a custom tab bar.
setTabContextMenuPolicy | Public method to set the context menu policy of the tab.
switchTab | Public slot used to switch between the current and the previous current tab.

### Static Methods

None

#### E5TabWidget (Constructor)

E5TabWidget(parent=None, dnd=False)

Constructor

parent
  reference to the parent widget (QWidget)
dnd=
  flag indicating the support for Drag & Drop (boolean)

#### E5TabWidget.__currentChanged

__currentChanged(index)

Private slot to handle the currentChanged signal.

index
  index of the current tab

#### E5TabWidget.__freeSide

__freeSide()

Private method to determine the free side of a tab.

Returns:
  free side (QTabBar.ButtonPosition)

#### E5TabWidget.__handleTabCustomContextMenuRequested

__handleTabCustomContextMenuRequested(point)

Private slot to handle the context menu request for the tabbar.

point
  point the context menu was requested (QPoint)

#### E5TabWidget.animationLabel

animationLabel(index, animationFile, speed=100)

Public slot to set an animated icon.

index
  tab index (integer)
animationFile
  name of the file containing the animation (string)
speed
  animation speed of the icon in percent of the original icon's speed (integer)

Returns:
  reference to the created label (QLabel)

#### E5TabWidget.moveTab

moveTab(curIndex, newIndex)

Public method to move a tab to a new index.

curIndex
  index of tab to be moved (integer)
newIndex
  index the tab should be moved to (integer)

#### E5TabWidget.nextTab

nextTab()

Public slot used to show the next tab.

#### E5TabWidget.prevTab

prevTab()

Public slot used to show the previous tab.

#### E5TabWidget.resetAnimation

resetAnimation(index)

Public slot to reset an animated icon.

index
  tab index (integer)

#### E5TabWidget.selectTab

selectTab(pos)

Public method to get the index of a tab given a position.

pos
  position determining the tab index (QPoint)

Returns:
  index of the tab (integer)

#### E5TabWidget.setCustomTabBar

setCustomTabBar(dnd, tabBar)

Public method to set a custom tab bar.

dnd
  flag indicating the support for Drag & Drop (boolean)
tabBar
  reference to the tab bar to set (QTabBar)

#### E5TabWidget.setTabContextMenuPolicy

setTabContextMenuPolicy(policy)

Public method to set the context menu policy of the tab.

policy
  context menu policy to set (Qt.ContextMenuPolicy)

#### E5TabWidget.switchTab

switchTab()

Public slot used to switch between the current and the previous current tab.

Up

## E5WheelTabBar

Class implementing a tab bar class substituting QTabBar to support wheel events.

### Derived from

QTabBar

### Class Attributes

None

### Class Methods

None

### Methods

E5WheelTabBar | Constructor
wheelEvent | Protected slot to support wheel events.

### Static Methods

None

#### E5WheelTabBar (Constructor)

E5WheelTabBar(parent=None)

Constructor

parent
  reference to the parent widget (QWidget)

#### E5WheelTabBar.wheelEvent

wheelEvent(event)

Protected slot to support wheel events.

event
  reference to the wheel event (QWheelEvent)

Up