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

Plasma

  • Plasma
  • TabBar
Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
Plasma::TabBar Class Reference

#include <Plasma/Widgets/TabBar>

Inheritance diagram for Plasma::TabBar:
Inheritance graph
[legend]

Public Slots

void setCurrentIndex (int index)
 

Signals

void currentChanged (int index)
 

Public Member Functions

 TabBar (QGraphicsWidget *parent=0)
 
 ~TabBar ()
 
Q_INVOKABLE int addTab (const QIcon &icon, const QString &label, QGraphicsLayoutItem *content=0)
 
Q_INVOKABLE int addTab (const QString &label, QGraphicsLayoutItem *content=0)
 
int count () const
 
int currentIndex () const
 
QGraphicsWidget * firstPositionWidget () const
 
Q_INVOKABLE int insertTab (int index, const QIcon &icon, const QString &label, QGraphicsLayoutItem *content=0)
 
Q_INVOKABLE int insertTab (int index, const QString &label, QGraphicsLayoutItem *content=0)
 
bool isTabBarShown () const
 
Q_INVOKABLE bool isTabHighlighted (int index) const
 
QGraphicsWidget * lastPositionWidget () const
 
KTabBar * nativeWidget () const
 
Q_INVOKABLE void removeTab (int index)
 
void setFirstPositionWidget (QGraphicsWidget *widget)
 
void setLastPositionWidget (QGraphicsWidget *widget)
 
void setStyleSheet (const QString &stylesheet)
 
void setTabBarShown (bool show)
 
Q_INVOKABLE void setTabHighlighted (int index, bool highlight)
 
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)
 
Q_INVOKABLE QIcon tabIcon (int index) const
 
Q_INVOKABLE QString tabText (int index) const
 
Q_INVOKABLE QGraphicsLayoutItem * takeTab (int index)
 

Protected Member Functions

void changeEvent (QEvent *event)
 
void resizeEvent (QGraphicsSceneResizeEvent *event)
 
void wheelEvent (QGraphicsSceneWheelEvent *event)
 

Properties

int count
 
int currentIndex
 
QGraphicsWidget firstPositionWidget
 
QGraphicsWidget lastPositionWidget
 
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.

Parameters
parentthe parent of this widget

Definition at line 221 of file tabbar.cpp.

Plasma::TabBar::~TabBar ( )

Definition at line 269 of file tabbar.cpp.

Member Function Documentation

int Plasma::TabBar::addTab ( const QIcon &  icon,
const QString &  label,
QGraphicsLayoutItem *  content = 0 
)

Adds a new tab in the last position.

Parameters
iconthe icon for this tab
labelthe text label of the tab
contentthe page content that will be shown by this tab
Returns
the index of the inserted tab

Definition at line 322 of file tabbar.cpp.

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)

Parameters
labelthe text label of the tab
contentthe page content that will be shown by this tab
Returns
the index of the inserted tab

Definition at line 327 of file tabbar.cpp.

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

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

Parameters
indexthe newly activated tab
int Plasma::TabBar::currentIndex ( ) const
Returns
the index of the tab currently active
QGraphicsWidget* Plasma::TabBar::firstPositionWidget ( ) const
Returns
the widget in the first position
Since
4.6
int Plasma::TabBar::insertTab ( int  index,
const QIcon &  icon,
const QString &  label,
QGraphicsLayoutItem *  content = 0 
)

Adds a new tab in the desired position.

Parameters
indexthe position where to insert the new tab, if index <=0 will be the first position, if index >= count() will be the last
iconthe icon for this tab
labelthe text label of the tab
contentthe page content that will be shown by this tab
Returns
the index of the inserted tab

Definition at line 275 of file tabbar.cpp.

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);.

Parameters
indexthe position where to insert the new tab, if index <=0 will be the first position, if index >= count() will be the last
labelthe text label of the tab
contentthe page content that will be shown by this tab
Returns
the index of the inserted tab

Definition at line 317 of file tabbar.cpp.

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

Definition at line 578 of file tabbar.cpp.

bool Plasma::TabBar::isTabHighlighted ( int  index) const
Returns
if the tab at index is highlighted
Since
4.7

Definition at line 598 of file tabbar.cpp.

QGraphicsWidget* Plasma::TabBar::lastPositionWidget ( ) const
Returns
the widget in the last position
Since
4.6
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.

Parameters
indexthe index of the tab to remove

Definition at line 434 of file tabbar.cpp.

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

Definition at line 337 of file tabbar.cpp.

void Plasma::TabBar::setCurrentIndex ( int  index)
slot

Activate a given tab.

Parameters
indexthe index of the tab to activate

Definition at line 350 of file tabbar.cpp.

void Plasma::TabBar::setFirstPositionWidget ( QGraphicsWidget *  widget)

Set a widget to be displayed on one side of the TabBar, depending on the LayoutDirection and the Shape.

Parameters
widgetthe widget to be displayed. Passing 0 will show nothing. Any previous widget will be deleted.
Since
4.6

Definition at line 620 of file tabbar.cpp.

void Plasma::TabBar::setLastPositionWidget ( QGraphicsWidget *  widget)

Set a widget to be displayed on one side of the TabBar, depending on the LayoutDirection and the Shape.

Parameters
widgetthe widget to be displayed. Passing 0 will show nothing. Any previous widget will be deleted.
Since
4.6

Definition at line 650 of file tabbar.cpp.

void Plasma::TabBar::setStyleSheet ( const QString &  stylesheet)

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

Parameters
stylesheeta CSS string

Definition at line 583 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

Parameters
showtrue if we want to show the tabbar
Since
4.3

Definition at line 559 of file tabbar.cpp.

void Plasma::TabBar::setTabHighlighted ( int  index,
bool  highlight 
)

Highlight the specified tab.

Parameters
indexof the tab to highlight
highlighttrue if it should be highlighted, wrong if not
Since
4.7

Definition at line 593 of file tabbar.cpp.

void Plasma::TabBar::setTabIcon ( int  index,
const QIcon &  icon 
)

Sets an icon for a given tab.

Parameters
indexthe index of the tab to modify
iconthe new icon for the given tab

Definition at line 549 of file tabbar.cpp.

void Plasma::TabBar::setTabText ( int  index,
const QString &  label 
)

Sets the text label of the given tab.

Parameters
indexthe index of the tab to modify
labelthe new text label of the given tab

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

Parameters
indexthe index of the tab to retrieve
Since
4.4

Definition at line 516 of file tabbar.cpp.

QIcon Plasma::TabBar::tabIcon ( int  index) const
Returns
the current icon for a given tab
Parameters
indexthe index of the tab we want to know its icon

Definition at line 554 of file tabbar.cpp.

QString Plasma::TabBar::tabText ( int  index) const
Returns
the text label of the given tab
Parameters
indexthe index of the tab we want to know its label

Definition at line 544 of file tabbar.cpp.

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

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

Parameters
indexthe index of the tab to remove
Since
4.4

Definition at line 467 of file tabbar.cpp.

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

Definition at line 608 of file tabbar.cpp.

Property Documentation

int Plasma::TabBar::count
read

Definition at line 52 of file tabbar.h.

int Plasma::TabBar::currentIndex
readwrite

Definition at line 51 of file tabbar.h.

QGraphicsWidget * Plasma::TabBar::firstPositionWidget
readwrite

Definition at line 55 of file tabbar.h.

QGraphicsWidget * Plasma::TabBar::lastPositionWidget
readwrite

Definition at line 56 of file tabbar.h.

KTabBar * Plasma::TabBar::nativeWidget
read

Definition at line 50 of file tabbar.h.

QString Plasma::TabBar::styleSheet
readwrite

Definition at line 53 of file tabbar.h.

bool Plasma::TabBar::tabBarShown
readwrite

Definition at line 54 of file tabbar.h.


The documentation for this class was generated from the following files:
  • tabbar.h
  • tabbar.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal