Plasma
Plasma::TabBar Class Reference
A tab bar widget, to be used for tabbed interfaces. More...
#include <Plasma/Widgets/TabBar>

Public Slots | |
void | setCurrentIndex (int index) |
Signals | |
void | currentChanged (int index) |
Public Member Functions | |
int | addTab (const QString &label, QGraphicsLayoutItem *content=0) |
int | addTab (const QIcon &icon, const QString &label, QGraphicsLayoutItem *content=0) |
int | count () const |
int | currentIndex () const |
int | insertTab (int index, const QString &label, QGraphicsLayoutItem *content=0) |
int | insertTab (int index, const QIcon &icon, const QString &label, QGraphicsLayoutItem *content=0) |
bool | isTabBarShown () const |
KTabBar * | nativeWidget () const |
void | removeTab (int index) |
void | setStyleSheet (const QString &stylesheet) |
void | setTabBarShown (bool show) |
void | setTabIcon (int index, const QIcon &icon) |
void | setTabText (int index, const QString &label) |
QString | styleSheet () const |
TabBar (QGraphicsWidget *parent=0) | |
QIcon | tabIcon (int index) const |
QString | tabText (int index) const |
~TabBar () | |
Protected Member Functions | |
void | resizeEvent (QGraphicsSceneResizeEvent *event) |
void | wheelEvent (QGraphicsSceneWheelEvent *event) |
Properties | |
int | count |
int | currentIndex |
KTabBar | nativeWidget |
QString | styleSheet |
bool | tabBarShown |
Detailed Description
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.
Definition at line 46 of file tabbar.h.
Constructor & Destructor Documentation
Plasma::TabBar::TabBar | ( | QGraphicsWidget * | parent = 0 |
) | [explicit] |
Constructs a new TabBar.
- parent the parent of this widget
Definition at line 188 of file tabbar.cpp.
Plasma::TabBar::~TabBar | ( | ) |
Definition at line 218 of file tabbar.cpp.
Member Function Documentation
int Plasma::TabBar::addTab | ( | const 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).
- label the text label of the tab
- content the page content that will be shown by this tab
- Returns:
- the index of the inserted tab
Definition at line 273 of file tabbar.cpp.
int Plasma::TabBar::addTab | ( | const QIcon & | icon, | |
const QString & | label, | |||
QGraphicsLayoutItem * | content = 0 | |||
) |
Adds a new tab in the last position.
- icon the icon for this tab
- label the text label of the tab
- content the page content that will be shown by this tab
- Returns:
- the index of the inserted tab
Definition at line 268 of file tabbar.cpp.
int Plasma::TabBar::count | ( | ) | const |
- Returns:
- the number of tabs in this tabbar
void Plasma::TabBar::currentChanged | ( | int | index | ) | [signal] |
Emitted when the active tab changes.
- index the newly activated tab
int Plasma::TabBar::currentIndex | ( | ) | const |
- Returns:
- the index of the tab currently active
int Plasma::TabBar::insertTab | ( | int | index, | |
const 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);.
- index the position where to insert the new tab, if index <=0 will be the first position, if index >= count() will be the last
- label the text label of the tab
- content the page content that will be shown by this tab
- Returns:
- the index of the inserted tab
Definition at line 263 of file tabbar.cpp.
int Plasma::TabBar::insertTab | ( | int | index, | |
const QIcon & | icon, | |||
const QString & | label, | |||
QGraphicsLayoutItem * | content = 0 | |||
) |
Adds a new tab in the desired position.
- index the position where to insert the new tab, if index <=0 will be the first position, if index >= count() will be the last
- icon the icon for this tab
- label the text label of the tab
- content the page content that will be shown by this tab
- Returns:
- the index of the inserted tab
Definition at line 224 of file tabbar.cpp.
bool Plasma::TabBar::isTabBarShown | ( | ) | const |
KTabBar* Plasma::TabBar::nativeWidget | ( | ) | const |
- Returns:
- the native widget wrapped by this TabBar
void Plasma::TabBar::removeTab | ( | int | index | ) |
void Plasma::TabBar::resizeEvent | ( | QGraphicsSceneResizeEvent * | event | ) | [protected] |
Definition at line 283 of file tabbar.cpp.
void Plasma::TabBar::setCurrentIndex | ( | int | index | ) | [slot] |
Activate a given tab.
- index the index of the tab to activate
Definition at line 294 of file tabbar.cpp.
void Plasma::TabBar::setStyleSheet | ( | const QString & | stylesheet | ) |
Sets the stylesheet used to control the visual display of this TabBar.
- stylesheet a CSS string
Definition at line 448 of file tabbar.cpp.
void Plasma::TabBar::setTabBarShown | ( | 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
- show true if we want to show the tabbar
- Since:
- 4.3
Definition at line 428 of file tabbar.cpp.
void Plasma::TabBar::setTabIcon | ( | int | index, | |
const QIcon & | icon | |||
) |
Sets an icon for a given tab.
- index the index of the tab to modify
- icon the new icon for the given tab
Definition at line 418 of file tabbar.cpp.
void Plasma::TabBar::setTabText | ( | int | index, | |
const QString & | label | |||
) |
Sets the text label of the given tab.
- index the index of the tab to modify
- label the new text label of the given tab
Definition at line 404 of file tabbar.cpp.
QString Plasma::TabBar::styleSheet | ( | ) | const |
- Returns:
- the stylesheet currently used with this widget
QIcon Plasma::TabBar::tabIcon | ( | int | index | ) | const |
- Returns:
- the current icon for a given tab
- index the index of the tab we want to know its icon
Definition at line 423 of file tabbar.cpp.
QString Plasma::TabBar::tabText | ( | int | index | ) | const |
- Returns:
- the text label of the given tab
- index the index of the tab we want to know its label
Definition at line 413 of file tabbar.cpp.
void Plasma::TabBar::wheelEvent | ( | QGraphicsSceneWheelEvent * | event | ) | [protected] |
Definition at line 463 of file tabbar.cpp.
Property Documentation
The documentation for this class was generated from the following files: