~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qtabwidget.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/gui/widgets/qtabwidget.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: QTabWidget Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">QTabWidget Class Reference</h1>
 
21
<p>The QTabWidget class provides a stack of tabbed widgets. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;QTabWidget&gt;</pre><p>Part of the <a href="qtgui.html">QtGui</a> module.</p>
 
23
<p>Inherits <a href="qwidget.html">QWidget</a>.</p>
 
24
<ul>
 
25
<li><a href="qtabwidget-members.html">List of all members, including inherited members</a></li>
 
26
<li><a href="qtabwidget-qt3.html">Qt 3 support members</a></li>
 
27
</ul>
 
28
<a name="public-types"></a>
 
29
<h3>Public Types</h3>
 
30
<ul>
 
31
<li><div class="fn"/>enum <b><a href="qtabwidget.html#TabPosition-enum">TabPosition</a></b> { North, South, West, East }</li>
 
32
<li><div class="fn"/>enum <b><a href="qtabwidget.html#TabShape-enum">TabShape</a></b> { Rounded, Triangular }</li>
 
33
</ul>
 
34
<a name="properties"></a>
 
35
<h3>Properties</h3>
 
36
<ul>
 
37
<li><div class="fn"/><b><a href="qtabwidget.html#count-prop">count</a></b> : const int</li>
 
38
<li><div class="fn"/><b><a href="qtabwidget.html#currentIndex-prop">currentIndex</a></b> : int</li>
 
39
<li><div class="fn"/><b><a href="qtabwidget.html#tabPosition-prop">tabPosition</a></b> : TabPosition</li>
 
40
<li><div class="fn"/><b><a href="qtabwidget.html#tabShape-prop">tabShape</a></b> : TabShape</li>
 
41
</ul>
 
42
<ul>
 
43
<li><div class="fn"/>52 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
 
44
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
 
45
</ul>
 
46
<a name="public-functions"></a>
 
47
<h3>Public Functions</h3>
 
48
<ul>
 
49
<li><div class="fn"/><b><a href="qtabwidget.html#QTabWidget">QTabWidget</a></b> ( QWidget * <i>parent</i> = 0 )</li>
 
50
<li><div class="fn"/><b><a href="qtabwidget.html#dtor.QTabWidget">~QTabWidget</a></b> ()</li>
 
51
<li><div class="fn"/>int <b><a href="qtabwidget.html#addTab">addTab</a></b> ( QWidget * <i>child</i>, const QString &amp; <i>label</i> )</li>
 
52
<li><div class="fn"/>int <b><a href="qtabwidget.html#addTab-2">addTab</a></b> ( QWidget * <i>child</i>, const QIcon &amp; <i>icon</i>, const QString &amp; <i>label</i> )</li>
 
53
<li><div class="fn"/>QWidget * <b><a href="qtabwidget.html#cornerWidget">cornerWidget</a></b> ( Qt::Corner <i>corner</i> = Qt::TopRightCorner ) const</li>
 
54
<li><div class="fn"/>int <b><a href="qtabwidget.html#count-prop">count</a></b> () const</li>
 
55
<li><div class="fn"/>int <b><a href="qtabwidget.html#currentIndex-prop">currentIndex</a></b> () const</li>
 
56
<li><div class="fn"/>QWidget * <b><a href="qtabwidget.html#currentWidget">currentWidget</a></b> () const</li>
 
57
<li><div class="fn"/>int <b><a href="qtabwidget.html#indexOf">indexOf</a></b> ( QWidget * <i>w</i> ) const</li>
 
58
<li><div class="fn"/>int <b><a href="qtabwidget.html#insertTab">insertTab</a></b> ( int <i>index</i>, QWidget * <i>w</i>, const QString &amp; <i>label</i> )</li>
 
59
<li><div class="fn"/>int <b><a href="qtabwidget.html#insertTab-4">insertTab</a></b> ( int <i>index</i>, QWidget * <i>w</i>, const QIcon &amp; <i>icon</i>, const QString &amp; <i>label</i> )</li>
 
60
<li><div class="fn"/>bool <b><a href="qtabwidget.html#isTabEnabled">isTabEnabled</a></b> ( int <i>index</i> ) const</li>
 
61
<li><div class="fn"/>void <b><a href="qtabwidget.html#removeTab">removeTab</a></b> ( int <i>index</i> )</li>
 
62
<li><div class="fn"/>void <b><a href="qtabwidget.html#setCornerWidget">setCornerWidget</a></b> ( QWidget * <i>w</i>, Qt::Corner <i>corner</i> = Qt::TopRightCorner )</li>
 
63
<li><div class="fn"/>void <b><a href="qtabwidget.html#setTabEnabled">setTabEnabled</a></b> ( int <i>index</i>, bool <i>enable</i> )</li>
 
64
<li><div class="fn"/>void <b><a href="qtabwidget.html#setTabIcon">setTabIcon</a></b> ( int <i>index</i>, const QIcon &amp; <i>icon</i> )</li>
 
65
<li><div class="fn"/>void <b><a href="qtabwidget.html#tabPosition-prop">setTabPosition</a></b> ( TabPosition )</li>
 
66
<li><div class="fn"/>void <b><a href="qtabwidget.html#tabShape-prop">setTabShape</a></b> ( TabShape <i>s</i> )</li>
 
67
<li><div class="fn"/>void <b><a href="qtabwidget.html#setTabText">setTabText</a></b> ( int <i>index</i>, const QString &amp; <i>label</i> )</li>
 
68
<li><div class="fn"/>void <b><a href="qtabwidget.html#setTabToolTip">setTabToolTip</a></b> ( int <i>index</i>, const QString &amp; <i>tip</i> )</li>
 
69
<li><div class="fn"/>QIcon <b><a href="qtabwidget.html#tabIcon">tabIcon</a></b> ( int <i>index</i> ) const</li>
 
70
<li><div class="fn"/>TabPosition <b><a href="qtabwidget.html#tabPosition-prop">tabPosition</a></b> () const</li>
 
71
<li><div class="fn"/>TabShape <b><a href="qtabwidget.html#tabShape-prop">tabShape</a></b> () const</li>
 
72
<li><div class="fn"/>QString <b><a href="qtabwidget.html#tabText">tabText</a></b> ( int <i>index</i> ) const</li>
 
73
<li><div class="fn"/>QString <b><a href="qtabwidget.html#tabToolTip">tabToolTip</a></b> ( int <i>index</i> ) const</li>
 
74
<li><div class="fn"/>QWidget * <b><a href="qtabwidget.html#widget">widget</a></b> ( int <i>index</i> ) const</li>
 
75
</ul>
 
76
<ul>
 
77
<li><div class="fn"/>183 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
 
78
<li><div class="fn"/>28 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
 
79
<li><div class="fn"/>10 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
 
80
</ul>
 
81
<a name="public-slots"></a>
 
82
<h3>Public Slots</h3>
 
83
<ul>
 
84
<li><div class="fn"/>void <b><a href="qtabwidget.html#currentIndex-prop">setCurrentIndex</a></b> ( int <i>index</i> )</li>
 
85
<li><div class="fn"/>void <b><a href="qtabwidget.html#setCurrentWidget">setCurrentWidget</a></b> ( QWidget * <i>widget</i> )</li>
 
86
</ul>
 
87
<ul>
 
88
<li><div class="fn"/>17 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
 
89
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
 
90
</ul>
 
91
<a name="signals"></a>
 
92
<h3>Signals</h3>
 
93
<ul>
 
94
<li><div class="fn"/>void <b><a href="qtabwidget.html#currentChanged">currentChanged</a></b> ( int <i>index</i> )</li>
 
95
</ul>
 
96
<ul>
 
97
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
 
98
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
 
99
</ul>
 
100
<a name="protected-functions"></a>
 
101
<h3>Protected Functions</h3>
 
102
<ul>
 
103
<li><div class="fn"/>virtual void <b><a href="qtabwidget.html#paintEvent">paintEvent</a></b> ( QPaintEvent * <i>event</i> )</li>
 
104
<li><div class="fn"/>void <b><a href="qtabwidget.html#setTabBar">setTabBar</a></b> ( QTabBar * <i>tb</i> )</li>
 
105
<li><div class="fn"/>QTabBar * <b><a href="qtabwidget.html#tabBar">tabBar</a></b> () const</li>
 
106
<li><div class="fn"/>virtual void <b><a href="qtabwidget.html#tabInserted">tabInserted</a></b> ( int <i>index</i> )</li>
 
107
<li><div class="fn"/>virtual void <b><a href="qtabwidget.html#tabRemoved">tabRemoved</a></b> ( int <i>index</i> )</li>
 
108
</ul>
 
109
<ul>
 
110
<li><div class="fn"/>39 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
 
111
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
 
112
</ul>
 
113
<h3>Additional Inherited Members</h3>
 
114
<ul>
 
115
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
 
116
<li><div class="fn"/>4 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
 
117
</ul>
 
118
<a name="details"></a>
 
119
<hr />
 
120
<h2>Detailed Description</h2>
 
121
<p>The QTabWidget class provides a stack of tabbed widgets.</p>
 
122
<p>A tab widget provides a tab bar (see <a href="qtabbar.html">QTabBar</a>) and a &quot;page area&quot; that is used to display pages related to each tab. By default, the tab bar is shown above the page area, but different configurations are available (see <a href="qtabwidget.html#TabPosition-enum">TabPosition</a>). Each tab is associated with a different widget (called a page). Only the current page is shown in the page area; all the other pages are hidden. The user can show a different page by clicking on its tab or by pressing its Alt+<i>letter</i> shortcut if it has one.</p>
 
123
<p>The normal way to use QTabWidget is to do the following in the constructor:</p>
 
124
<ol type="1">
 
125
<li>Create a QTabWidget.</li>
 
126
<li>Create a <a href="qwidget.html">QWidget</a> for each of the pages in the tab dialog, but do not specify a parent widget - the tab widget will reparent the page widget later.</li>
 
127
<li>Insert children into the page widget, set up geometry management for it and use <a href="qtabwidget.html#addTab">addTab</a>() (or <a href="qtabwidget.html#insertTab">insertTab</a>()) to set up a tab with an optional keyboard shortcut.</li>
 
128
<li>Connect to the signals and slots.</li>
 
129
</ol>
 
130
<p>The position of the tabs is defined by <a href="qtabwidget.html#tabPosition-prop">tabPosition</a>, their shape by <a href="qtabwidget.html#tabShape-prop">tabShape</a>.</p>
 
131
<p>The signal <a href="qtabwidget.html#currentChanged">currentChanged</a>() is emitted when the user selects a page.</p>
 
132
<p>The current page index is available as <a href="qtabwidget.html#currentIndex-prop">currentIndex</a>(), the current page widget with <a href="qtabwidget.html#currentWidget">currentWidget</a>(). You can retrieve a pointer to a page widget with a given index using <a href="qtabwidget.html#widget">widget</a>(), and can find the index position of a widget with <a href="qtabwidget.html#indexOf">indexOf</a>(). Use <a href="qtabwidget.html#setCurrentWidget">setCurrentWidget</a>() or <a href="qtabwidget.html#currentIndex-prop">setCurrentIndex</a>() to show a particular page.</p>
 
133
<p>You can change a tab's text and icon using <a href="qtabwidget.html#setTabText">setTabText</a>() or <a href="qtabwidget.html#setTabIcon">setTabIcon</a>(). A tab can be removed with <a href="qtabwidget.html#removeTab">removeTab</a>().</p>
 
134
<p>Each tab is either enabled or disabled at any given time (see <a href="qtabwidget.html#setTabEnabled">setTabEnabled</a>()). If a tab is enabled, the tab text is drawn normally and the user can select that tab. If it is disabled, the tab is drawn in a different way and the user cannot select that tab. Note that even if a tab is disabled, the page can still be visible, for example if all of the tabs happen to be disabled.</p>
 
135
<p>Tab widgets can be a very good way to split up a complex dialog. An alternative is to use a <a href="qstackedwidget.html">QStackedWidget</a> for which you provide some means of navigating between pages, for example, a <a href="qtoolbar.html">QToolBar</a> or a <a href="qlistwidget.html">QListWidget</a>.</p>
 
136
<p>Most of the functionality in QTabWidget is provided by a <a href="qtabbar.html">QTabBar</a> (at the top, providing the tabs) and a <a href="qstackedwidget.html">QStackedWidget</a> (most of the area, organizing the individual pages).</p>
 
137
<p><img src="images/windows-tabwidget.png" alt="Screenshot in Windows style" /> <img src="images/macintosh-tabwidget.png" alt="Screenshot in macintosh style" /></p>
 
138
<p>See also <a href="qtabbar.html">QTabBar</a>, <a href="qstackedwidget.html">QStackedWidget</a>, and <a href="qtoolbox.html">QToolBox</a>.</p>
 
139
<hr />
 
140
<h2>Member Type Documentation</h2>
 
141
<h3 class="fn"><a name="TabPosition-enum"></a>enum QTabWidget::TabPosition</h3>
 
142
<p>This enum type defines where <a href="qtabwidget.html">QTabWidget</a> draws the tab row:</p>
 
143
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
144
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
145
<tr><td valign="top"><tt>QTabWidget::North</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The tabs are drawn above the pages.</td></tr>
 
146
<tr><td valign="top"><tt>QTabWidget::South</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The tabs are drawn below the pages.</td></tr>
 
147
<tr><td valign="top"><tt>QTabWidget::West</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">The tabs are drawn to the left of the pages.</td></tr>
 
148
<tr><td valign="top"><tt>QTabWidget::East</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">The tabs are drawn to the right of the pages.</td></tr>
 
149
</table>
 
150
<h3 class="fn"><a name="TabShape-enum"></a>enum QTabWidget::TabShape</h3>
 
151
<p>This enum type defines the shape of the tabs:</p>
 
152
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
153
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
154
<tr><td valign="top"><tt>QTabWidget::Rounded</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">rounded look (normal)</td></tr>
 
155
<tr><td valign="top"><tt>QTabWidget::Triangular</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">triangular look</td></tr>
 
156
</table>
 
157
<hr />
 
158
<h2>Property Documentation</h2>
 
159
<h3 class="fn"><a name="count-prop"></a>count : const int</h3>
 
160
<p>This property holds the number of tabs in the tab bar.</p>
 
161
<p>Access functions:</p>
 
162
<ul>
 
163
<li><div class="fn"/><b>int count () const</b></li>
 
164
</ul>
 
165
<h3 class="fn"><a name="currentIndex-prop"></a>currentIndex : int</h3>
 
166
<p>This property holds the index position of the current tab page.</p>
 
167
<p>Access functions:</p>
 
168
<ul>
 
169
<li><div class="fn"/><b>int currentIndex () const</b></li>
 
170
<li><div class="fn"/><b>void setCurrentIndex ( int <i>index</i> )</b></li>
 
171
</ul>
 
172
<h3 class="fn"><a name="tabPosition-prop"></a>tabPosition : <a href="qtabwidget.html#TabPosition-enum">TabPosition</a></h3>
 
173
<p>This property holds the position of the tabs in this tab widget.</p>
 
174
<p>Possible values for this property are <tt>QTabWidget::North</tt> and <tt>QTabWidget::South</tt>.</p>
 
175
<p>Access functions:</p>
 
176
<ul>
 
177
<li><div class="fn"/><b>TabPosition tabPosition () const</b></li>
 
178
<li><div class="fn"/><b>void setTabPosition ( TabPosition )</b></li>
 
179
</ul>
 
180
<p>See also <a href="qtabwidget.html#TabPosition-enum">TabPosition</a>.</p>
 
181
<h3 class="fn"><a name="tabShape-prop"></a>tabShape : <a href="qtabwidget.html#TabShape-enum">TabShape</a></h3>
 
182
<p>This property holds the shape of the tabs in this tab widget.</p>
 
183
<p>Possible values for this property are <tt>QTabWidget::Rounded</tt> (default) or <tt>QTabWidget::Triangular</tt>.</p>
 
184
<p>Access functions:</p>
 
185
<ul>
 
186
<li><div class="fn"/><b>TabShape tabShape () const</b></li>
 
187
<li><div class="fn"/><b>void setTabShape ( TabShape <i>s</i> )</b></li>
 
188
</ul>
 
189
<p>See also <a href="qtabwidget.html#TabShape-enum">TabShape</a>.</p>
 
190
<hr />
 
191
<h2>Member Function Documentation</h2>
 
192
<h3 class="fn"><a name="QTabWidget"></a>QTabWidget::QTabWidget ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
 
193
<p>Constructs a tabbed widget with parent <i>parent</i>.</p>
 
194
<h3 class="fn"><a name="dtor.QTabWidget"></a>QTabWidget::~QTabWidget ()</h3>
 
195
<p>Destroys the tabbed widget.</p>
 
196
<h3 class="fn"><a name="addTab"></a>int QTabWidget::addTab ( <a href="qwidget.html">QWidget</a> * <i>child</i>, const <a href="qstring.html">QString</a> &amp; <i>label</i> )</h3>
 
197
<p>Adds another tab and page to the tab view.</p>
 
198
<p>The new page is <i>child</i>; the tab's label is <i>label</i>. Note the difference between the widget name (which you supply to widget constructors and to <a href="qtabwidget.html#setTabEnabled">setTabEnabled</a>(), for example) and the tab label. The name is internal to the program and invariant, whereas the label is shown on-screen and may vary according to language and other factors.</p>
 
199
<p>If the tab's <i>label</i> contains an ampersand, the letter following the ampersand is used as a shortcut for the tab, e.g. if the label is &quot;Bro&amp;wse&quot; then Alt+W becomes a shortcut which will move the focus to this tab.</p>
 
200
<p>See also <a href="qtabwidget.html#insertTab">insertTab</a>().</p>
 
201
<h3 class="fn"><a name="addTab-2"></a>int QTabWidget::addTab ( <a href="qwidget.html">QWidget</a> * <i>child</i>, const <a href="qicon.html">QIcon</a> &amp; <i>icon</i>, const <a href="qstring.html">QString</a> &amp; <i>label</i> )</h3>
 
202
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
203
<p>Adds another tab and page to the tab view.</p>
 
204
<p>This function is the same as <a href="qtabwidget.html#addTab">addTab</a>(), but with an additional <i>icon</i>.</p>
 
205
<h3 class="fn"><a name="cornerWidget"></a><a href="qwidget.html">QWidget</a> * QTabWidget::cornerWidget ( <a href="qt.html#Corner-enum">Qt::Corner</a> <i>corner</i> = Qt::TopRightCorner ) const</h3>
 
206
<p>Returns the widget shown in the <i>corner</i> of the tab widget or 0.</p>
 
207
<h3 class="fn"><a name="currentChanged"></a>void QTabWidget::currentChanged ( int <i>index</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
208
<p>This signal is emitted whenever the current page index changes. The parameter is the new current page <i>index</i> position.</p>
 
209
<p>See also <a href="qtabwidget.html#currentWidget">currentWidget</a>() and <a href="qtabwidget.html#currentIndex-prop">currentIndex</a>.</p>
 
210
<h3 class="fn"><a name="currentWidget"></a><a href="qwidget.html">QWidget</a> * QTabWidget::currentWidget () const</h3>
 
211
<p>Returns a pointer to the page currently being displayed by the tab dialog. The tab dialog does its best to make sure that this value is never 0 (but if you try hard enough, it can be).</p>
 
212
<p>See also <a href="qtabwidget.html#currentIndex-prop">currentIndex</a>() and <a href="qtabwidget.html#setCurrentWidget">setCurrentWidget</a>().</p>
 
213
<h3 class="fn"><a name="indexOf"></a>int QTabWidget::indexOf ( <a href="qwidget.html">QWidget</a> * <i>w</i> ) const</h3>
 
214
<p>Returns the index position of the page occupied by the widget <i>w</i>, or -1 if the widget cannot be found.</p>
 
215
<h3 class="fn"><a name="insertTab"></a>int QTabWidget::insertTab ( int <i>index</i>, <a href="qwidget.html">QWidget</a> * <i>w</i>, const <a href="qstring.html">QString</a> &amp; <i>label</i> )</h3>
 
216
<p>Inserts another tab and page to the tab view.</p>
 
217
<p>The new page is <i>w</i>; the tab's label is <i>label</i>. Note the difference between the widget name (which you supply to widget constructors and to <a href="qtabwidget.html#setTabEnabled">setTabEnabled</a>(), for example) and the tab label. The name is internal to the program and invariant, whereas the label is shown on-screen and may vary according to language and other factors.</p>
 
218
<p>If the tab's <i>label</i> contains an ampersand, the letter following the ampersand is used as a shortcut for the tab, e.g. if the label is &quot;Bro&amp;wse&quot; then Alt+W becomes a shortcut which will move the focus to this tab.</p>
 
219
<p>If <i>index</i> is out of range, the tab is simply appended. Otherwise it is inserted at the specified position.</p>
 
220
<p>If you call insertTab() after <a href="qwidget.html#show">show</a>(), the screen will flicker and the user may be confused.</p>
 
221
<p>See also <a href="qtabwidget.html#addTab">addTab</a>().</p>
 
222
<h3 class="fn"><a name="insertTab-4"></a>int QTabWidget::insertTab ( int <i>index</i>, <a href="qwidget.html">QWidget</a> * <i>w</i>, const <a href="qicon.html">QIcon</a> &amp; <i>icon</i>, const <a href="qstring.html">QString</a> &amp; <i>label</i> )</h3>
 
223
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
224
<p>Inserts another tab and page to the tab view.</p>
 
225
<p>This function is the same as <a href="qtabwidget.html#insertTab">insertTab</a>(), but with an additional <i>icon</i>.</p>
 
226
<h3 class="fn"><a name="isTabEnabled"></a>bool QTabWidget::isTabEnabled ( int <i>index</i> ) const</h3>
 
227
<p>Returns true if the the page at position <i>index</i> is enabled; otherwise returns false.</p>
 
228
<p>See also <a href="qtabwidget.html#setTabEnabled">setTabEnabled</a>() and <a href="qwidget.html#enabled-prop">QWidget::isEnabled</a>().</p>
 
229
<h3 class="fn"><a name="paintEvent"></a>void QTabWidget::paintEvent ( <a href="qpaintevent.html">QPaintEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
230
<p>Paints the tab widget's tab bar in response to the paint <i>event</i>.</p>
 
231
<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget</a>.</p>
 
232
<h3 class="fn"><a name="removeTab"></a>void QTabWidget::removeTab ( int <i>index</i> )</h3>
 
233
<p>Removes the page at position <i>index</i> from this stack of widgets. Does not delete the page widget.</p>
 
234
<h3 class="fn"><a name="setCornerWidget"></a>void QTabWidget::setCornerWidget ( <a href="qwidget.html">QWidget</a> * <i>w</i>, <a href="qt.html#Corner-enum">Qt::Corner</a> <i>corner</i> = Qt::TopRightCorner )</h3>
 
235
<p>Sets widget <i>w</i> to be the shown in the specified <i>corner</i> of the tab widget.</p>
 
236
<p>Only the horizontal element of the <i>corner</i> will be used.</p>
 
237
<p>See also <a href="qtabwidget.html#cornerWidget">cornerWidget</a>() and <a href="qtabwidget.html#tabPosition-prop">setTabPosition</a>().</p>
 
238
<h3 class="fn"><a name="setCurrentWidget"></a>void QTabWidget::setCurrentWidget ( <a href="qwidget.html">QWidget</a> * <i>widget</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
 
239
<p>Makes<i>widget</i> the current widget. The <i>widget</i> must be a page in this tab widget.</p>
 
240
<p>See also <a href="qtabwidget.html#addTab">addTab</a>(), <a href="qtabwidget.html#currentIndex-prop">setCurrentIndex</a>(), and <a href="qtabwidget.html#currentWidget">currentWidget</a>().</p>
 
241
<h3 class="fn"><a name="setTabBar"></a>void QTabWidget::setTabBar ( <a href="qtabbar.html">QTabBar</a> * <i>tb</i> )&nbsp;&nbsp;<tt> [protected]</tt></h3>
 
242
<p>Replaces the dialog's <a href="qtabbar.html">QTabBar</a> heading with the tab bar <i>tb</i>. Note that this must be called <i>before</i> any tabs have been added, or the behavior is undefined.</p>
 
243
<p>See also <a href="qtabwidget.html#tabBar">tabBar</a>().</p>
 
244
<h3 class="fn"><a name="setTabEnabled"></a>void QTabWidget::setTabEnabled ( int <i>index</i>, bool <i>enable</i> )</h3>
 
245
<p>If <i>enable</i> is true, the page at position <i>index</i> is enabled; otherwise the page at position <i>index</i> is disabled. The page's tab is redrawn appropriately.</p>
 
246
<p><a href="qtabwidget.html">QTabWidget</a> uses <a href="qwidget.html#enabled-prop">QWidget::setEnabled</a>() internally, rather than keeping a separate flag.</p>
 
247
<p>Note that even a disabled tab/page may be visible. If the page is visible already, <a href="qtabwidget.html">QTabWidget</a> will not hide it; if all the pages are disabled, <a href="qtabwidget.html">QTabWidget</a> will show one of them.</p>
 
248
<p>See also <a href="qtabwidget.html#isTabEnabled">isTabEnabled</a>() and <a href="qwidget.html#enabled-prop">QWidget::setEnabled</a>().</p>
 
249
<h3 class="fn"><a name="setTabIcon"></a>void QTabWidget::setTabIcon ( int <i>index</i>, const <a href="qicon.html">QIcon</a> &amp; <i>icon</i> )</h3>
 
250
<p>Sets the <i>icon</i> for the tab at position <i>index</i>.</p>
 
251
<h3 class="fn"><a name="setTabText"></a>void QTabWidget::setTabText ( int <i>index</i>, const <a href="qstring.html">QString</a> &amp; <i>label</i> )</h3>
 
252
<p>Defines a new <i>label</i> for the page at position <i>index</i>'s tab.</p>
 
253
<h3 class="fn"><a name="setTabToolTip"></a>void QTabWidget::setTabToolTip ( int <i>index</i>, const <a href="qstring.html">QString</a> &amp; <i>tip</i> )</h3>
 
254
<p>Sets the tab tool tip for the page at position <i>index</i> to <i>tip</i>.</p>
 
255
<p>See also <a href="qtabwidget.html#tabToolTip">tabToolTip</a>().</p>
 
256
<h3 class="fn"><a name="tabBar"></a><a href="qtabbar.html">QTabBar</a> * QTabWidget::tabBar () const&nbsp;&nbsp;<tt> [protected]</tt></h3>
 
257
<p>Returns the current <a href="qtabbar.html">QTabBar</a>.</p>
 
258
<p>See also <a href="qtabwidget.html#setTabBar">setTabBar</a>().</p>
 
259
<h3 class="fn"><a name="tabIcon"></a><a href="qicon.html">QIcon</a> QTabWidget::tabIcon ( int <i>index</i> ) const</h3>
 
260
<p>Returns the label text for the tab on the page at position <i>index</i>.</p>
 
261
<h3 class="fn"><a name="tabInserted"></a>void QTabWidget::tabInserted ( int <i>index</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
262
<p>This virtual handler is called after a new tab was added or inserted at position <i>index</i>.</p>
 
263
<p>See also <a href="qtabwidget.html#tabRemoved">tabRemoved</a>().</p>
 
264
<h3 class="fn"><a name="tabRemoved"></a>void QTabWidget::tabRemoved ( int <i>index</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
265
<p>This virtual handler is called after a tab was removed from position <i>index</i>.</p>
 
266
<p>See also <a href="qtabwidget.html#tabInserted">tabInserted</a>().</p>
 
267
<h3 class="fn"><a name="tabText"></a><a href="qstring.html">QString</a> QTabWidget::tabText ( int <i>index</i> ) const</h3>
 
268
<p>Returns the label text for the tab on the page at position <i>index</i>.</p>
 
269
<h3 class="fn"><a name="tabToolTip"></a><a href="qstring.html">QString</a> QTabWidget::tabToolTip ( int <i>index</i> ) const</h3>
 
270
<p>Returns the tab tool tip for the page at position <i>index</i> or an empty string if no tool tip has been set.</p>
 
271
<p>See also <a href="qtabwidget.html#setTabToolTip">setTabToolTip</a>().</p>
 
272
<h3 class="fn"><a name="widget"></a><a href="qwidget.html">QWidget</a> * QTabWidget::widget ( int <i>index</i> ) const</h3>
 
273
<p>Returns the tab page at index position <i>index</i> or 0 if the <i>index</i> is out of range.</p>
 
274
<p /><address><hr /><div align="center">
 
275
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
276
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
277
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
278
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
279
</tr></table></div></address></body>
 
280
</html>