• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Plasma

Plasma::TabBar

Plasma::TabBar Class Reference

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

#include <Plasma/Widgets/TabBar>

Inheritance diagram for Plasma::TabBar:

Inheritance graph
[legend]

List of all members.


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)
KTabBar * nativeWidget () const
void removeTab (int index)
void setStyleSheet (const QString &stylesheet)
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

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 177 of file tabbar.cpp.

Plasma::TabBar::~TabBar (  ) 

Definition at line 207 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 261 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 256 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 251 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 213 of file tabbar.cpp.

KTabBar* Plasma::TabBar::nativeWidget (  )  const

Returns:
the native widget wrapped by this TabBar

void Plasma::TabBar::removeTab ( int  index  ) 

Removes a tab.

  • index the index of the tab to remove

Definition at line 357 of file tabbar.cpp.

void Plasma::TabBar::resizeEvent ( QGraphicsSceneResizeEvent *  event  )  [protected]

Reimplemented from QGraphicsWidget.

Definition at line 271 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 283 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 403 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 393 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 379 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 398 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 388 of file tabbar.cpp.

void Plasma::TabBar::wheelEvent ( QGraphicsSceneWheelEvent *  event  )  [protected]

Definition at line 418 of file tabbar.cpp.


Property Documentation

int Plasma::TabBar::count [read]

Definition at line 52 of file tabbar.h.

int Plasma::TabBar::currentIndex [read, write]

Definition at line 51 of file tabbar.h.

KTabBar * Plasma::TabBar::nativeWidget [read]

Definition at line 50 of file tabbar.h.

QString Plasma::TabBar::styleSheet [read, write]

Definition at line 53 of file tabbar.h.


The documentation for this class was generated from the following files:
  • tabbar.h
  • tabbar.cpp

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal