Plasma
tabbar.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PLASMA_TABBAR_H
00021 #define PLASMA_TABBAR_H
00022
00023 #include <QtGui/QGraphicsWidget>
00024
00025 #include <ktabbar.h>
00026
00027 #include <plasma/plasma_export.h>
00028
00029 class QString;
00030 class QIcon;
00031
00032 namespace Plasma
00033 {
00034
00035 class TabBarPrivate;
00036
00046 class PLASMA_EXPORT TabBar : public QGraphicsWidget
00047 {
00048 Q_OBJECT
00049
00050 Q_PROPERTY(KTabBar *nativeWidget READ nativeWidget)
00051 Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex)
00052 Q_PROPERTY(int count READ count)
00053 Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
00054 Q_PROPERTY(bool tabBarShown READ isTabBarShown WRITE setTabBarShown)
00055
00056 public:
00062 explicit TabBar(QGraphicsWidget *parent = 0);
00063 ~TabBar();
00064
00076 int insertTab(int index, const QIcon &icon, const QString &label,
00077 QGraphicsLayoutItem *content = 0);
00078
00091 int insertTab(int index, const QString &label, QGraphicsLayoutItem *content = 0);
00092
00101 int addTab(const QIcon &icon, const QString &label, QGraphicsLayoutItem *content = 0);
00102
00112 int addTab(const QString &label, QGraphicsLayoutItem *content = 0);
00113
00119 void removeTab(int index);
00120
00124 int currentIndex() const;
00125
00129 int count() const;
00130
00137 void setTabText(int index, const QString &label);
00138
00144 QString tabText(int index) const;
00145
00152 void setTabIcon(int index, const QIcon &icon);
00153
00159 QIcon tabIcon(int index) const;
00160
00169 void setTabBarShown(bool show);
00170
00175 bool isTabBarShown() const;
00176
00182 void setStyleSheet(const QString &stylesheet);
00183
00187 QString styleSheet() const;
00188
00192 KTabBar *nativeWidget() const;
00193
00194 public Q_SLOTS:
00200 void setCurrentIndex(int index);
00201
00202 Q_SIGNALS:
00208 void currentChanged(int index);
00209
00210 protected:
00211 void wheelEvent(QGraphicsSceneWheelEvent *event);
00212 void resizeEvent(QGraphicsSceneResizeEvent * event);
00213
00214 private:
00215 TabBarPrivate * const d;
00216
00217 Q_PRIVATE_SLOT(d, void slidingCompleted(QGraphicsItem *item))
00218 Q_PRIVATE_SLOT(d, void shapeChanged(const QTabBar::Shape shape))
00219 };
00220
00221 }
00222
00223 #endif // multiple inclusion guard