• Skip to content
  • Skip to link menu
KDE 4.3 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:
QGraphicsWidget

List of all members.

Public Slots

void setCurrentIndex (int index)

Signals

void currentChanged (int index)

Public Member Functions

Q_INVOKABLE int addTab (const QString &label, QGraphicsLayoutItem *content=0)
Q_INVOKABLE int addTab (const QIcon &icon, const QString &label, QGraphicsLayoutItem *content=0)
int count () const
int currentIndex () const
Q_INVOKABLE int insertTab (int index, const QString &label, QGraphicsLayoutItem *content=0)
Q_INVOKABLE int insertTab (int index, const QIcon &icon, const QString &label, QGraphicsLayoutItem *content=0)
bool isTabBarShown () const
KTabBar * nativeWidget () const
Q_INVOKABLE void removeTab (int index)
void setStyleSheet (const QString &stylesheet)
void setTabBarShown (bool show)
Q_INVOKABLE void setTabIcon (int index, const QIcon &icon)
Q_INVOKABLE void setTabText (int index, const QString &label)
QString styleSheet () const
Q_INVOKABLE QGraphicsLayoutItem * tabAt (int index)
 TabBar (QGraphicsWidget *parent=0)
Q_INVOKABLE QIcon tabIcon (int index) const
Q_INVOKABLE QString tabText (int index) const
Q_INVOKABLE QGraphicsLayoutItem * takeTab (int index)
 ~TabBar ()

Protected Member Functions

void changeEvent (QEvent *event)
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 213 of file tabbar.cpp.

Plasma::TabBar::~TabBar (  ) 

Definition at line 247 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 304 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 299 of file tabbar.cpp.

void Plasma::TabBar::changeEvent ( QEvent *  event  )  [protected]

Definition at line 565 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 294 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 253 of file tabbar.cpp.

bool Plasma::TabBar::isTabBarShown (  )  const
Returns:
true if the tabbar is shown
Since:
4.3

Definition at line 539 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, contents are deleted.

  • index the index of the tab to remove

Definition at line 411 of file tabbar.cpp.

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

Definition at line 314 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 325 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 544 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 524 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 514 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 500 of file tabbar.cpp.

QString Plasma::TabBar::styleSheet (  )  const
Returns:
the stylesheet currently used with this widget
QGraphicsLayoutItem * Plasma::TabBar::tabAt ( int  index  ) 

Returns the contents of a page.

  • index the index of the tab to retrieve
    Since:
    4.4

Definition at line 481 of file tabbar.cpp.

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

QGraphicsLayoutItem * Plasma::TabBar::takeTab ( int  index  ) 

Removes a tab, the page is reparented to 0 and is returned.

  • index the index of the tab to remove
    Since:
    4.4

Definition at line 438 of file tabbar.cpp.

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

Definition at line 559 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.

bool Plasma::TabBar::tabBarShown [read, write]

Definition at line 54 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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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