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) |
changeEvent (self, QEvent event) | |
int | count (self) |
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) |
bool | isTabBarShown (self) |
KTabBar | nativeWidget (self) |
removeTab (self, int index) | |
resizeEvent (self, QGraphicsSceneResizeEvent event) | |
setCurrentIndex (self, int index) | |
setStyleSheet (self, QString stylesheet) | |
setTabBarShown (self, bool show) | |
setTabIcon (self, int index, QIcon icon) | |
setTabText (self, int index, QString label) | |
QString | styleSheet (self) |
QGraphicsLayoutItem | tabAt (self, int index) |
QIcon | tabIcon (self, int index) |
QString | tabText (self, int index) |
QGraphicsLayoutItem | takeTab (self, int index) |
wheelEvent (self, QGraphicsSceneWheelEvent event) |
Signal Documentation
currentChanged | ( | int | index | |
) |
Emitted when the active tab changes
@arg index the newly activated tab
- Signal syntax:
QObject.connect(source, SIGNAL("currentChanged(int)"), target_slot)
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 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 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
changeEvent | ( | self, | ||
QEvent | event | |||
) |
int count | ( | self ) |
- Returns:
- the number of tabs in this tabbar
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 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
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
bool isTabBarShown | ( | self ) |
- Returns:
- true if the tabbar is shown
- Since:
- 4.3
KTabBar nativeWidget | ( | self ) |
- Returns:
- the native widget wrapped by this TabBar
removeTab | ( | self, | ||
int | index | |||
) |
Removes a tab, contents are deleted
@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
setTabBarShown | ( | self, | ||
bool | show | |||
) |
shows or hides the tabbar, used if you just want to display the pages, when the tabbar doesn't have content pages at all this function has no effect
@arg show true if we want to show the tabbar
- Since:
- 4.3
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
QGraphicsLayoutItem tabAt | ( | self, | ||
int | index | |||
) |
Returns the contents of a page
@arg index the index of the tab to retrieve
- Since:
- 4.4
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
QGraphicsLayoutItem takeTab | ( | self, | ||
int | index | |||
) |
Removes a tab, the page is reparented to 0 and is returned
@arg index the index of the tab to remove
- Since:
- 4.4
wheelEvent | ( | self, | ||
QGraphicsSceneWheelEvent | event | |||
) |