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
00055 public:
00061 explicit TabBar(QGraphicsWidget *parent = 0);
00062 ~TabBar();
00063
00075 int insertTab(int index, const QIcon &icon, const QString &label,
00076 QGraphicsLayoutItem *content = 0);
00077
00090 int insertTab(int index, const QString &label, QGraphicsLayoutItem *content = 0);
00091
00100 int addTab(const QIcon &icon, const QString &label, QGraphicsLayoutItem *content = 0);
00101
00111 int addTab(const QString &label, QGraphicsLayoutItem *content = 0);
00112
00118 void removeTab(int index);
00119
00123 int currentIndex() const;
00124
00128 int count() const;
00129
00136 void setTabText(int index, const QString &label);
00137
00143 QString tabText(int index) const;
00144
00151 void setTabIcon(int index, const QIcon &icon);
00152
00158 QIcon tabIcon(int index) const;
00159
00165 void setStyleSheet(const QString &stylesheet);
00166
00170 QString styleSheet() const;
00171
00175 KTabBar *nativeWidget() const;
00176
00177 public Q_SLOTS:
00183 void setCurrentIndex(int index);
00184
00185 Q_SIGNALS:
00191 void currentChanged(int index);
00192
00193 protected:
00194 void wheelEvent(QGraphicsSceneWheelEvent *event);
00195 void resizeEvent(QGraphicsSceneResizeEvent * event);
00196
00197 private:
00198 TabBarPrivate * const d;
00199
00200 Q_PRIVATE_SLOT(d, void slidingCompleted(QGraphicsItem *item))
00201 Q_PRIVATE_SLOT(d, void shapeChanged(const QTabBar::Shape shape))
00202 };
00203
00204 }
00205
00206 #endif // multiple inclusion guard