KDE 4.7 PyKDE API Reference

- KDE's Python API

# KTabBar Class Reference

`from PyKDE4.kdeui import *`

Inherits: QTabBar → QWidget → QObject

## Detailed Description

A QTabBar with extended features.

"KDE Tab Bar"

## Signals

| closeRequest (int a0)
| contextMenu (int index, QPoint globalPos)
| emptyAreaContextMenu (QPoint globalPos)
| initiateDrag (int a0)
| mouseDoubleClick (int a0)
| mouseMiddleClick (int index)
| moveTab (int a0, int a1)
| newTabRequest ()
| receivedDropEvent (int a0, QDropEvent a1)
| tabDoubleClicked (int index)
| wheelDelta (int a0)

## Methods

| __init__ (self, QWidget parent=0)
| activateDragSwitchTab (self)
| closeButtonClicked (self)
| dragEnterEvent (self, QDragEnterEvent event)
| dragMoveEvent (self, QDragMoveEvent event)
| dropEvent (self, QDropEvent event)
| enableCloseButton (self)
bool | hoverCloseButton (self)
bool | hoverCloseButtonDelayed (self)
bool | isCloseButtonEnabled (self)
bool | isTabReorderingEnabled (self)
| leaveEvent (self, QEvent event)
| mouseDoubleClickEvent (self, QMouseEvent event)
| mouseMoveEvent (self, QMouseEvent event)
| mousePressEvent (self, QMouseEvent event)
| mouseReleaseEvent (self, QMouseEvent event)
| paintEvent (self, QPaintEvent event)
int | selectTab (self, QPoint position)
| setCloseButtonEnabled (self, bool a0)
| setHoverCloseButton (self, bool a0)
| setHoverCloseButtonDelayed (self, bool a0)
| setTabCloseActivatePrevious (self, bool a0)
| setTabReorderingEnabled (self, bool enable)
bool | tabCloseActivatePrevious (self)
| tabLayoutChange (self)
QSize | tabSizeHint (self, int index)
| wheelEvent (self, QWheelEvent event)

## Signal Documentation

closeRequest | ( | int | a0
| ) |  |  |

Deprecated:
  Use QTabBar.tabCloseRequested(int) instead.

Signal syntax:
  `QObject.connect(source, SIGNAL("closeRequest(int)"), target_slot)`

contextMenu | ( | int | index,
|  | QPoint | globalPos
| ) |  |  |

A right mouse button click was performed over the tab with the

Parameters:

  | index. | The signal is emitted on the press of the mouse button.

Signal syntax:
  `QObject.connect(source, SIGNAL("contextMenu(int, const QPoint&)"), target_slot)`

emptyAreaContextMenu | ( | QPoint | globalPos
| ) |  |  |

A right mouse button click was performed over the empty area on the tab bar. The signal is emitted on the press of the mouse button.

Signal syntax:
  `QObject.connect(source, SIGNAL("emptyAreaContextMenu(const QPoint&)"), target_slot)`

initiateDrag | ( | int | a0
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("initiateDrag(int)"), target_slot)`

mouseDoubleClick | ( | int | a0
| ) |  |  |

Deprecated:
  use tabDoubleClicked(int) and newTabRequest() instead.

Signal syntax:
  `QObject.connect(source, SIGNAL("mouseDoubleClick(int)"), target_slot)`

mouseMiddleClick | ( | int | index
| ) |  |  |

A double middle mouse button click was performed over the tab with the

Parameters:

  | index. | The signal is emitted on the release of the mouse button.

Signal syntax:
  `QObject.connect(source, SIGNAL("mouseMiddleClick(int)"), target_slot)`

moveTab | ( | int | a0,
|  | int | a1
| ) |  |  |

Used internally by KTabBar's/KTabWidget's middle-click tab moving mechanism. Tells the KTabWidget which owns the KTabBar to move a tab.

Signal syntax:
  `QObject.connect(source, SIGNAL("moveTab(int, int)"), target_slot)`

newTabRequest | ( |  | ) |

A double left mouse button click was performed over the empty area on the tab bar. The signal is emitted on the second press of the mouse button, before the release.

Signal syntax:
  `QObject.connect(source, SIGNAL("newTabRequest()"), target_slot)`

receivedDropEvent | ( | int | a0,
|  | QDropEvent | a1
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("receivedDropEvent(int, QDropEvent*)"), target_slot)`

tabDoubleClicked | ( | int | index
| ) |  |  |

A double left mouse button click was performed over the tab with the

Parameters:

  | index. | The signal is emitted on the second press of the mouse button, before the release.

Signal syntax:
  `QObject.connect(source, SIGNAL("tabDoubleClicked(int)"), target_slot)`

wheelDelta | ( | int | a0
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("wheelDelta(int)"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent=0
| ) |  |  |

Creates a new tab bar.

Parameters:

  | parent | The parent widget.

activateDragSwitchTab | ( |  | self ) |

closeButtonClicked | ( |  | self ) |

Deprecated:

dragEnterEvent | ( | self, |
|  | QDragEnterEvent | event
| ) |  |  |

dragMoveEvent | ( | self, |
|  | QDragMoveEvent | event
| ) |  |  |

dropEvent | ( | self, |
|  | QDropEvent | event
| ) |  |  |

enableCloseButton | ( |  | self ) |

Deprecated:

bool hoverCloseButton | ( |  | self ) |

Deprecated:
  Use QTabBar.tabsClosable() instead.

bool hoverCloseButtonDelayed | ( |  | self ) |

Deprecated:
  Use QTabBar.tabsClosable() instead.

bool isCloseButtonEnabled | ( |  | self ) |

Returns true if the close button is shown on tabs.

Since:
  4.1

Deprecated:
  Use QTabBar.tabsClosable() instead.

bool isTabReorderingEnabled | ( |  | self ) |

Returns whether tab reordering is enabled.

Deprecated:
  Use QTabBar.isMovable() instead.

leaveEvent | ( | self, |
|  | QEvent | event
| ) |  |  |

mouseDoubleClickEvent | ( | self, |
|  | QMouseEvent | event
| ) |  |  |

mouseMoveEvent | ( | self, |
|  | QMouseEvent | event
| ) |  |  |

mousePressEvent | ( | self, |
|  | QMouseEvent | event
| ) |  |  |

mouseReleaseEvent | ( | self, |
|  | QMouseEvent | event
| ) |  |  |

paintEvent | ( | self, |
|  | QPaintEvent | event
| ) |  |  |

int selectTab | ( | self, |
|  | QPoint | position
| ) |  |  |

Selects the tab which has a tab header at given

Parameters:

  | position. |
  | position | the coordinates of the tab

setCloseButtonEnabled | ( | self, |
|  | bool | a0
| ) |  |  |

If enabled, a close button is available for each tab. The signal KTabBar.closeRequest() is emitted, if the close button has been clicked.

Since:
  4.1

Deprecated:
  Use QTabBar.setTabsClosable() instead.

setHoverCloseButton | ( | self, |
|  | bool | a0
| ) |  |  |

If enabled, a close button is shown above the tab icon. The signal KTabBar.closeRequest() is emitted, if the close button has been clicked. Note that the tab must have an icon to use this feature.

Deprecated:
  Use QTabBar.setTabsClosable() instead.

setHoverCloseButtonDelayed | ( | self, |
|  | bool | a0
| ) |  |  |

If enabled, the close button cannot get clicked until a minor delay has been passed. This prevents that user accidentally closes a tab.

Deprecated:
  Use QTabBar.setTabsClosable() instead.

setTabCloseActivatePrevious | ( | self, |
|  | bool | a0
| ) |  |  |

Sets the 'activate previous tab on close' feature enabled or disabled. If enabled, as soon as you close a tab, the previously selected tab is activated again.

Deprecated:
  Use QTabBar.setSelectionBehaviorOnRemove() instead.

setTabReorderingEnabled | ( | self, |
|  | bool | enable
| ) |  |  |

Sets the tab reordering enabled or disabled. If enabled, the user can reorder the tabs by drag and drop the tab headers with the middle mouse button.

Deprecated:
  Use QTabBar.setMovable() instead.

Note, however, that QTabBar.setMovable(true) disables dragging tabs out of the KTabBar (e.g., dragging the tab URL from Konqueror to another application)!

bool tabCloseActivatePrevious | ( |  | self ) |

Returns whether the 'activate previous tab on close' feature is enabled.

Deprecated:
  Use QTabBar.selectionBehaviorOnRemove() instead.

tabLayoutChange | ( |  | self ) |

QSize tabSizeHint | ( | self, |
|  | int | index
| ) |  |  |

wheelEvent | ( | self, |
|  | QWheelEvent | event
| ) |  |  |