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

Plasma

  • plasma
  • widgets
tabbar.h
Go to the documentation of this file.
1/*
2 * Copyright 2008 Marco Martin <notmart@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#ifndef PLASMA_TABBAR_H
21#define PLASMA_TABBAR_H
22
23#include <QtGui/QGraphicsWidget>
24
25#include <ktabbar.h>
26
27#include <plasma/plasma_export.h>
28
29class QString;
30class QIcon;
31
32namespace Plasma
33{
34
35class TabBarPrivate;
36
46class PLASMA_EXPORT TabBar : public QGraphicsWidget
47{
48 Q_OBJECT
49
50 Q_PROPERTY(KTabBar *nativeWidget READ nativeWidget)
51 Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged)
52 Q_PROPERTY(int count READ count)
53 Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
54 Q_PROPERTY(bool tabBarShown READ isTabBarShown WRITE setTabBarShown)
55 Q_PROPERTY(QGraphicsWidget *firstPositionWidget READ firstPositionWidget WRITE setFirstPositionWidget)
56 Q_PROPERTY(QGraphicsWidget *lastPositionWidget READ lastPositionWidget WRITE setLastPositionWidget)
57
58public:
64 explicit TabBar(QGraphicsWidget *parent = 0);
65 ~TabBar();
66
78 Q_INVOKABLE int insertTab(int index, const QIcon &icon, const QString &label,
79 QGraphicsLayoutItem *content = 0);
80
93 Q_INVOKABLE int insertTab(int index, const QString &label, QGraphicsLayoutItem *content = 0);
94
103 Q_INVOKABLE int addTab(const QIcon &icon, const QString &label, QGraphicsLayoutItem *content = 0);
104
114 Q_INVOKABLE int addTab(const QString &label, QGraphicsLayoutItem *content = 0);
115
121 Q_INVOKABLE void removeTab(int index);
122
129 Q_INVOKABLE QGraphicsLayoutItem *takeTab(int index);
130
137 Q_INVOKABLE QGraphicsLayoutItem *tabAt(int index);
138
142 int currentIndex() const;
143
147 int count() const;
148
155 Q_INVOKABLE void setTabText(int index, const QString &label);
156
162 Q_INVOKABLE QString tabText(int index) const;
163
170 Q_INVOKABLE void setTabIcon(int index, const QIcon &icon);
171
177 Q_INVOKABLE QIcon tabIcon(int index) const;
178
187 void setTabBarShown(bool show);
188
193 bool isTabBarShown() const;
194
200 void setStyleSheet(const QString &stylesheet);
201
205 QString styleSheet() const;
206
213 Q_INVOKABLE void setTabHighlighted(int index, bool highlight);
214
219 Q_INVOKABLE bool isTabHighlighted(int index) const;
220
224 KTabBar *nativeWidget() const;
225
233 void setFirstPositionWidget(QGraphicsWidget *widget);
234
239 QGraphicsWidget *firstPositionWidget() const;
240
248 void setLastPositionWidget(QGraphicsWidget *widget);
249
254 QGraphicsWidget *lastPositionWidget() const;
255
256public Q_SLOTS:
262 void setCurrentIndex(int index);
263
264Q_SIGNALS:
270 void currentChanged(int index);
271
272protected:
273 void wheelEvent(QGraphicsSceneWheelEvent *event);
274 void resizeEvent(QGraphicsSceneResizeEvent * event);
275 void changeEvent(QEvent *event);
276
277private:
278 TabBarPrivate * const d;
279
280 friend class TabBarPrivate;
281
282 Q_PRIVATE_SLOT(d, void slidingNewPageCompleted())
283 Q_PRIVATE_SLOT(d, void slidingOldPageCompleted())
284 Q_PRIVATE_SLOT(d, void shapeChanged(const QTabBar::Shape shape))
285 Q_PRIVATE_SLOT(d, void setPalette())
286};
287
288} // namespace Plasma
289
290#endif // multiple inclusion guard
Plasma::TabBar
A tab bar widget, to be used for tabbed interfaces.
Definition: tabbar.h:47
Plasma::TabBar::currentChanged
void currentChanged(int index)
Emitted when the active tab changes.
QGraphicsWidget
Plasma
Namespace for everything in libplasma.
Definition: abstractdialogmanager.cpp:25
plasma_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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