1
/****************************************************************************
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
5
** This file is part of the widgets module of the Qt Toolkit.
7
** This file may be distributed under the terms of the Q Public License
8
** as defined by Trolltech AS of Norway and appearing in the file
9
** LICENSE.QPL included in the packaging of this file.
11
** This file may be distributed and/or modified under the terms of the
12
** GNU General Public License version 2 as published by the Free Software
13
** Foundation and appearing in the file LICENSE.GPL included in the
14
** packaging of this file.
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
17
** information about Qt Commercial License Agreements.
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
21
** Contact info@trolltech.com if any conditions of this licensing are
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27
****************************************************************************/
32
#include "QtGui/qwidget.h"
37
class Q_GUI_EXPORT QTabBar: public QWidget
42
Q_PROPERTY(Shape shape READ shape WRITE setShape)
43
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex)
44
Q_PROPERTY(int count READ count)
45
Q_PROPERTY(bool drawBase READ drawBase WRITE setDrawBase)
48
explicit QTabBar(QWidget* parent=0);
51
enum Shape { RoundedNorth, RoundedSouth, RoundedWest, RoundedEast,
52
TriangularNorth, TriangularSouth, TriangularWest, TriangularEast
53
#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
54
, RoundedAbove = RoundedNorth, RoundedBelow = RoundedSouth,
55
TriangularAbove = TriangularNorth, TriangularBelow = TriangularSouth
60
void setShape(Shape shape);
62
int addTab(const QString &text);
63
int addTab(const QIcon &icon, const QString &text);
65
int insertTab(int index, const QString &text);
66
int insertTab(int index, const QIcon&icon, const QString &text);
68
void removeTab(int index);
70
bool isTabEnabled(int index) const;
71
void setTabEnabled(int index, bool);
73
QString tabText(int index) const;
74
void setTabText(int index, const QString &text);
76
QIcon tabIcon(int index) const;
77
void setTabIcon(int index, const QIcon &icon);
79
void setTabToolTip(int index, const QString &tip);
80
QString tabToolTip(int index) const;
82
void setTabData(int index, const QVariant &data);
83
QVariant tabData(int index) const;
85
QRect tabRect(int index) const;
87
int currentIndex() const;
90
QSize sizeHint() const;
91
QSize minimumSizeHint() const;
93
void setDrawBase(bool drawTheBase);
94
bool drawBase() const;
97
void setCurrentIndex(int index);
100
void currentChanged(int index);
103
virtual QSize tabSizeHint(int index) const;
104
virtual void tabInserted(int index);
105
virtual void tabRemoved(int index);
106
virtual void tabLayoutChange();
108
bool event(QEvent *);
109
void resizeEvent(QResizeEvent *);
110
void showEvent(QShowEvent *);
111
void paintEvent(QPaintEvent *);
112
void mousePressEvent (QMouseEvent *);
113
void mouseMoveEvent (QMouseEvent *);
114
void mouseReleaseEvent (QMouseEvent *);
115
void keyPressEvent(QKeyEvent *);
116
void changeEvent(QEvent *);
120
QT_MOC_COMPAT void setCurrentTab(int index) { setCurrentIndex(index); }
122
QT_MOC_COMPAT void selected(int);
126
Q_DISABLE_COPY(QTabBar)
127
Q_DECLARE_PRIVATE(QTabBar)
128
Q_PRIVATE_SLOT(d_func(), void scrollTabs())