# eric4.E4Gui.E4TabWidget

Module implementing a TabWidget class substituting QTabWidget.

### Global Attributes

None

### Classes

E4DnDTabBar | Class implementing a tab bar class substituting QTabBar.
E4TabWidget | Class implementing a tab widget class substituting QTabWidget.
E4WheelTabBar | Class implementing a tab bar class substituting QTabBar to support wheel events.

### Functions

None

## E4DnDTabBar

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

E4WheelTabBar

### Class Attributes

None

### Class Methods

None

### Methods

E4DnDTabBar | 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

#### E4DnDTabBar (Constructor)

E4DnDTabBar(parent = None)

Constructor

parent
  reference to the parent widget (QWidget)

#### E4DnDTabBar.dragEnterEvent

dragEnterEvent(event)

Protected method to handle drag enter events.

event
  reference to the drag enter event (QDragEnterEvent)

#### E4DnDTabBar.dropEvent

dropEvent(event)

Protected method to handle drop events.

event
  reference to the drop event (QDropEvent)

#### E4DnDTabBar.mouseMoveEvent

mouseMoveEvent(event)

Protected method to handle mouse move events.

event
  reference to the mouse move event (QMouseEvent)

#### E4DnDTabBar.mousePressEvent

mousePressEvent(event)

Protected method to handle mouse press events.

event
  reference to the mouse press event (QMouseEvent)

Up

## E4TabWidget

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

E4TabWidget | 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.
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

#### E4TabWidget (Constructor)

E4TabWidget(parent = None, dnd = False)

Constructor

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

#### E4TabWidget.__currentChanged

__currentChanged(index)

Private slot to handle the currentChanged signal.

index
  index of the current tab

#### E4TabWidget.__freeSide

__freeSide()

Private method to determine the free side of a tab.

Returns:
  free side (QTabBar.ButtonPosition)

#### E4TabWidget.__handleTabCustomContextMenuRequested

__handleTabCustomContextMenuRequested(point)

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

point
  point the context menu was requested (QPoint)

#### E4TabWidget.animationLabel

animationLabel(index, animationFile)

Public slot to set an animated icon.

index
  tab index (integer)
animationFile
  name of the file containing the animation (string)

Returns:
  reference to the created label (QLabel)

#### E4TabWidget.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)

#### E4TabWidget.nextTab

nextTab()

Public slot used to show the next tab.

#### E4TabWidget.prevTab

prevTab()

Public slot used to show the previous tab.

#### E4TabWidget.resetAnimation

resetAnimation(index)

Public slot to reset an animated icon.

index
  tab index (integer)

#### E4TabWidget.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)

#### E4TabWidget.setTabContextMenuPolicy

setTabContextMenuPolicy(policy)

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

policy
  context menu policy to set (Qt.ContextMenuPolicy)

#### E4TabWidget.switchTab

switchTab()

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

Up

## E4WheelTabBar

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

### Derived from

QTabBar

### Class Attributes

None

### Class Methods

None

### Methods

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

### Static Methods

None

#### E4WheelTabBar (Constructor)

E4WheelTabBar(parent = None)

Constructor

parent
  reference to the parent widget (QWidget)

#### E4WheelTabBar.wheelEvent

wheelEvent(event)

Protected slot to support wheel events.

reference
  to the wheel event (QWheelEvent)

Up