Plasma.TabBar

KDE 4.2 PyKDE API Reference

- KDE's Python API

# TabBar Class Reference

`from PyKDE4.plasma import *`

Inherits: QGraphicsWidget → QObject
Namespace: Plasma

## Detailed Description

TabBar plasma/widgets/tabbar.h <Plasma/Widgets/TabBar>

A tab bar widget, to be used for tabbed interfaces.

Provides a Tab bar for use in a tabbed interface where each page is a QGraphicsLayoutItem. Only one of them is displayed at a given time. It is possible to add and remove tabs or modify their text label or their icon.

## Signals
| currentChanged (int index)
## Methods
| __init__ (self, QGraphicsWidget parent=0)
int | addTab (self, QIcon icon, QString label, QGraphicsLayoutItem content=0)
int | addTab (self, QString label, QGraphicsLayoutItem content=0)
int | count (self)
| currentChanged (self, int index)
int | currentIndex (self)
int | insertTab (self, int index, QIcon icon, QString label, QGraphicsLayoutItem content=0)
int | insertTab (self, int index, QString label, QGraphicsLayoutItem content=0)
KTabBar | nativeWidget (self)
| removeTab (self, int index)
| resizeEvent (self, QGraphicsSceneResizeEvent event)
| setCurrentIndex (self, int index)
| setStyleSheet (self, QString stylesheet)
| setTabIcon (self, int index, QIcon icon)
| setTabText (self, int index, QString label)
QString | styleSheet (self)
QIcon | tabIcon (self, int index)
QString | tabText (self, int index)
| wheelEvent (self, QGraphicsSceneWheelEvent event)

## Method Documentation

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

Constructs a new TabBar

@arg parent the parent of this widget

int addTab | ( | self, |
|  | QIcon | icon,
|  | QString | label,
|  | QGraphicsLayoutItem | content=0
| ) |  |  |

Adds a new tab in the last position

@arg icon the icon for this tab @arg label the text label of the tab @arg content the page content that will be shown by this tab

Returns:
  the index of the inserted tab

int addTab | ( | self, |
|  | QString | label,
|  | QGraphicsLayoutItem | content=0
| ) |  |  |

Adds a new tab in the last position This is an overloaded member provided for convenience equivalent to addTab(QIcon(), label, page)

@arg label the text label of the tab @arg content the page content that will be shown by this tab

Returns:
  the index of the inserted tab

int count | ( |  | self ) |

Returns:
  the number of tabs in this tabbar

currentChanged | ( | self, |
|  | int | index
| ) |  |  |

Emitted when the active tab changes

@arg index the newly activated tab

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

int currentIndex | ( |  | self ) |

Returns:
  the index of the tab currently active

int insertTab | ( | self, |
|  | int | index,
|  | QIcon | icon,
|  | QString | label,
|  | QGraphicsLayoutItem | content=0
| ) |  |  |

Adds a new tab in the desired position

@arg index the position where to insert the new tab, if index <=0 will be the first position, if index >= count() will be the last @arg icon the icon for this tab @arg label the text label of the tab @arg content the page content that will be shown by this tab

Returns:
  the index of the inserted tab

int insertTab | ( | self, |
|  | int | index,
|  | QString | label,
|  | QGraphicsLayoutItem | content=0
| ) |  |  |

Adds a new tab in the desired position This is an overloaded member provided for convenience equivalent to insertTab(index, QIcon(), label);

@arg index the position where to insert the new tab, if index <=0 will be the first position, if index >= count() will be the last @arg label the text label of the tab @arg content the page content that will be shown by this tab

Returns:
  the index of the inserted tab

KTabBar nativeWidget | ( |  | self ) |

Returns:
  the native widget wrapped by this TabBar

removeTab | ( | self, |
|  | int | index
| ) |  |  |

Removes a tab

@arg index the index of the tab to remove

resizeEvent | ( | self, |
|  | QGraphicsSceneResizeEvent | event
| ) |  |  |

setCurrentIndex | ( | self, |
|  | int | index
| ) |  |  |

Activate a given tab

@arg index the index of the tab to activate

setStyleSheet | ( | self, |
|  | QString | stylesheet
| ) |  |  |

Sets the stylesheet used to control the visual display of this TabBar

@arg stylesheet a CSS string

setTabIcon | ( | self, |
|  | int | index,
|  | QIcon | icon
| ) |  |  |

Sets an icon for a given tab

@arg index the index of the tab to modify @arg icon the new icon for the given tab

setTabText | ( | self, |
|  | int | index,
|  | QString | label
| ) |  |  |

Sets the text label of the given tab

@arg index the index of the tab to modify @arg label the new text label of the given tab

QString styleSheet | ( |  | self ) |

Returns:
  the stylesheet currently used with this widget

QIcon tabIcon | ( | self, |
|  | int | index
| ) |  |  |

Returns:
  the current icon for a given tab

@arg index the index of the tab we want to know its icon

QString tabText | ( | self, |
|  | int | index
| ) |  |  |

Returns:
  the text label of the given tab

@arg index the index of the tab we want to know its label

wheelEvent | ( | self, |
|  | QGraphicsSceneWheelEvent | event
| ) |  |  |