45 #include <QtGui/qwidget.h> 46 #include <QtGui/qicon.h> 54 #ifndef QT_NO_TABWIDGET 70 bool usesScrollButtons;
80 int addTab(
QWidget *widget, const
QIcon& icon, const QString &label);
82 int insertTab(
int index,
QWidget *widget, const QString &);
83 int insertTab(
int index,
QWidget *widget, const
QIcon& icon, const QString &label);
85 void removeTab(
int index);
87 bool isTabEnabled(
int index) const;
88 void setTabEnabled(
int index,
bool);
90 QString tabText(
int index) const;
91 void setTabText(
int index, const QString &);
93 QIcon tabIcon(
int index) const;
94 void setTabIcon(
int index, const
QIcon & icon);
97 void setTabToolTip(
int index,
const QString & tip);
98 QString tabToolTip(
int index)
const;
101 #ifndef QT_NO_WHATSTHIS 102 void setTabWhatsThis(
int index,
const QString &
text);
103 QString tabWhatsThis(
int index)
const;
106 int currentIndex()
const;
107 QWidget *currentWidget()
const;
109 int indexOf(
QWidget *widget)
const;
113 #if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) 120 bool tabsClosable()
const;
121 void setTabsClosable(
bool closeable);
123 bool isMovable()
const;
124 void setMovable(
bool movable);
126 enum TabShape { Rounded, Triangular };
127 TabShape tabShape()
const;
128 void setTabShape(TabShape s);
140 QSize iconSize()
const;
141 void setIconSize(
const QSize &size);
143 bool usesScrollButtons()
const;
144 void setUsesScrollButtons(
bool useButtons);
146 bool documentMode()
const;
147 void setDocumentMode(
bool set);
152 void setCurrentIndex(
int index);
153 void setCurrentWidget(
QWidget *widget);
156 void currentChanged(
int index);
157 void tabCloseRequested(
int index);
160 virtual void tabInserted(
int index);
161 virtual void tabRemoved(
int index);
177 inline QT3_SUPPORT
void insertTab(
QWidget * w,
const QString &s,
int index = -1) { insertTab(index, w, s); }
178 inline QT3_SUPPORT
void insertTab(
QWidget *child,
const QIcon& icon,
179 const QString &label,
int index = -1) { insertTab(index, child, icon, label); }
181 inline QT3_SUPPORT
void changeTab(
QWidget *w,
const QString &s) {setTabText(indexOf(w), s); }
182 inline QT3_SUPPORT
void changeTab(
QWidget *w,
const QIcon& icon,
183 const QString &label) {
int idx = indexOf(w); setTabText(idx, label); setTabIcon(idx, icon); }
185 inline QT3_SUPPORT
bool isTabEnabled(
QWidget *w)
const {
return isTabEnabled(indexOf(w)); }
186 inline QT3_SUPPORT
void setTabEnabled(
QWidget *w,
bool b) { setTabEnabled(indexOf(w), b); }
188 inline QT3_SUPPORT QString tabLabel(
QWidget *w)
const {
return tabText(indexOf(w)); }
189 inline QT3_SUPPORT
void setTabLabel(
QWidget *w,
const QString &
l) { setTabText(indexOf(w), l); }
191 inline QT3_SUPPORT
QIcon tabIconSet(
QWidget * w)
const {
return tabIcon(indexOf(w)); }
192 inline QT3_SUPPORT
void setTabIconSet(
QWidget * w,
const QIcon & icon) { setTabIcon(indexOf(w), icon); }
194 inline QT3_SUPPORT
void removeTabToolTip(
QWidget * w) {
195 #ifndef QT_NO_TOOLTIP 196 setTabToolTip(indexOf(w), QString());
201 inline QT3_SUPPORT
void setTabToolTip(
QWidget * w,
const QString & tip) {
202 #ifndef QT_NO_TOOLTIP 203 setTabToolTip(indexOf(w), tip);
210 inline QT3_SUPPORT QString tabToolTip(
QWidget * w)
const {
211 #ifndef QT_NO_TOOLTIP 212 return tabToolTip(indexOf(w));
219 inline QT3_SUPPORT
QWidget * currentPage()
const {
return currentWidget(); }
220 inline QT3_SUPPORT
QWidget *page(
int index)
const {
return widget(index); }
221 inline QT3_SUPPORT QString label(
int index)
const {
return tabText(index); }
222 inline QT3_SUPPORT
int currentPageIndex()
const {
return currentIndex(); }
224 inline QT3_SUPPORT
int margin()
const {
return 0; }
225 inline QT3_SUPPORT
void setMargin(
int) {}
228 inline QT_MOC_COMPAT void setCurrentPage(
int index) { setCurrentIndex(index); }
235 #endif // QT3_SUPPORT 243 void setUpLayout(
bool =
false);
244 friend class Q3TabDialog;
247 #endif // QT_NO_TABWIDGET 253 #endif // QTABWIDGET_H
The QKeyEvent class describes a key event.
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
static void clear(QVariant::Private *d)
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
The QTabBar class provides a tab bar, e.g.
The QString class provides a Unicode character string.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QResizeEvent class contains event parameters for resize events.
The QShowEvent class provides an event that is sent when a widget is shown.
The QSize class defines the size of a two-dimensional object using integer point precision.
#define Q_DECLARE_PRIVATE(Class)
The QPaintEvent class contains event parameters for paint events.
The QEvent class is the base class of all event classes.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
The QIcon class provides scalable icons in different modes and states.