File: qtabwidget.html

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (166 lines) | stat: -rw-r--r-- 34,360 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QTabWidget Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QTabWidget Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QTabWidget class provides a stack of tabbed widgets. <a href="#details">More...</a></p>
<p>Inherits <a href="qwidget.html">QWidget</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qtabwidget.html#TabPosition-enum">TabPosition</a></b> { North, South, West, East }</li><li><div class="fn" />enum <b><a href="qtabwidget.html#TabShape-enum">TabShape</a></b> { Rounded, Triangular }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtabwidget.html#QTabWidget">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />int <b><a href="qtabwidget.html#addTab">addTab</a></b> (<i>self</i>, QWidget, QString)</li><li><div class="fn" />int <b><a href="qtabwidget.html#addTab-2">addTab</a></b> (<i>self</i>, QWidget, QIcon, QString)</li><li><div class="fn" /><b><a href="qtabwidget.html#changeEvent">changeEvent</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" /><b><a href="qtabwidget.html#clear">clear</a></b> (<i>self</i>)</li><li><div class="fn" />QWidget <b><a href="qtabwidget.html#cornerWidget">cornerWidget</a></b> (<i>self</i>, Qt.Corner&#160;<i>corner</i>&#160;=&#160;Qt.TopRightCorner)</li><li><div class="fn" />int <b><a href="qtabwidget.html#count">count</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtabwidget.html#currentIndex">currentIndex</a></b> (<i>self</i>)</li><li><div class="fn" />QWidget <b><a href="qtabwidget.html#currentWidget">currentWidget</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtabwidget.html#documentMode">documentMode</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.TextElideMode <b><a href="qtabwidget.html#elideMode">elideMode</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtabwidget.html#event">event</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" />QSize <b><a href="qtabwidget.html#iconSize">iconSize</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtabwidget.html#indexOf">indexOf</a></b> (<i>self</i>, QWidget)</li><li><div class="fn" /><b><a href="qtabwidget.html#initStyleOption">initStyleOption</a></b> (<i>self</i>, QStyleOptionTabWidgetFrame)</li><li><div class="fn" />int <b><a href="qtabwidget.html#insertTab">insertTab</a></b> (<i>self</i>, int, QWidget, QString)</li><li><div class="fn" />int <b><a href="qtabwidget.html#insertTab-2">insertTab</a></b> (<i>self</i>, int, QWidget, QIcon, QString)</li><li><div class="fn" />bool <b><a href="qtabwidget.html#isMovable">isMovable</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtabwidget.html#isTabEnabled">isTabEnabled</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtabwidget.html#keyPressEvent">keyPressEvent</a></b> (<i>self</i>, QKeyEvent)</li><li><div class="fn" />QSize <b><a href="qtabwidget.html#minimumSizeHint">minimumSizeHint</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtabwidget.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent)</li><li><div class="fn" /><b><a href="qtabwidget.html#removeTab">removeTab</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtabwidget.html#resizeEvent">resizeEvent</a></b> (<i>self</i>, QResizeEvent)</li><li><div class="fn" /><b><a href="qtabwidget.html#setCornerWidget">setCornerWidget</a></b> (<i>self</i>, QWidget, Qt.Corner&#160;<i>corner</i>&#160;=&#160;Qt.TopRightCorner)</li><li><div class="fn" /><b><a href="qtabwidget.html#setCurrentIndex">setCurrentIndex</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtabwidget.html#setCurrentWidget">setCurrentWidget</a></b> (<i>self</i>, QWidget)</li><li><div class="fn" /><b><a href="qtabwidget.html#setDocumentMode">setDocumentMode</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtabwidget.html#setElideMode">setElideMode</a></b> (<i>self</i>, Qt.TextElideMode)</li><li><div class="fn" /><b><a href="qtabwidget.html#setIconSize">setIconSize</a></b> (<i>self</i>, QSize)</li><li><div class="fn" /><b><a href="qtabwidget.html#setMovable">setMovable</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtabwidget.html#setTabBar">setTabBar</a></b> (<i>self</i>, QTabBar)</li><li><div class="fn" /><b><a href="qtabwidget.html#setTabEnabled">setTabEnabled</a></b> (<i>self</i>, int, bool)</li><li><div class="fn" /><b><a href="qtabwidget.html#setTabIcon">setTabIcon</a></b> (<i>self</i>, int, QIcon)</li><li><div class="fn" /><b><a href="qtabwidget.html#setTabPosition">setTabPosition</a></b> (<i>self</i>, TabPosition)</li><li><div class="fn" /><b><a href="qtabwidget.html#setTabsClosable">setTabsClosable</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtabwidget.html#setTabShape">setTabShape</a></b> (<i>self</i>, TabShape)</li><li><div class="fn" /><b><a href="qtabwidget.html#setTabText">setTabText</a></b> (<i>self</i>, int, QString)</li><li><div class="fn" /><b><a href="qtabwidget.html#setTabToolTip">setTabToolTip</a></b> (<i>self</i>, int, QString)</li><li><div class="fn" /><b><a href="qtabwidget.html#setTabWhatsThis">setTabWhatsThis</a></b> (<i>self</i>, int, QString)</li><li><div class="fn" /><b><a href="qtabwidget.html#setUsesScrollButtons">setUsesScrollButtons</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtabwidget.html#showEvent">showEvent</a></b> (<i>self</i>, QShowEvent)</li><li><div class="fn" />QSize <b><a href="qtabwidget.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />QTabBar <b><a href="qtabwidget.html#tabBar">tabBar</a></b> (<i>self</i>)</li><li><div class="fn" />QIcon <b><a href="qtabwidget.html#tabIcon">tabIcon</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtabwidget.html#tabInserted">tabInserted</a></b> (<i>self</i>, int)</li><li><div class="fn" />TabPosition <b><a href="qtabwidget.html#tabPosition">tabPosition</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtabwidget.html#tabRemoved">tabRemoved</a></b> (<i>self</i>, int)</li><li><div class="fn" />bool <b><a href="qtabwidget.html#tabsClosable">tabsClosable</a></b> (<i>self</i>)</li><li><div class="fn" />TabShape <b><a href="qtabwidget.html#tabShape">tabShape</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qtabwidget.html#tabText">tabText</a></b> (<i>self</i>, int)</li><li><div class="fn" />QString <b><a href="qtabwidget.html#tabToolTip">tabToolTip</a></b> (<i>self</i>, int)</li><li><div class="fn" />QString <b><a href="qtabwidget.html#tabWhatsThis">tabWhatsThis</a></b> (<i>self</i>, int)</li><li><div class="fn" />bool <b><a href="qtabwidget.html#usesScrollButtons">usesScrollButtons</a></b> (<i>self</i>)</li><li><div class="fn" />QWidget <b><a href="qtabwidget.html#widget">widget</a></b> (<i>self</i>, int)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qtabwidget.html#currentChanged">currentChanged</a></b> (int)</li><li><div class="fn" />void <b><a href="qtabwidget.html#tabCloseRequested">tabCloseRequested</a></b> (int)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTabWidget class provides a stack of tabbed widgets.</p>
<p>A tab widget provides a tab bar (see <a href="qtabbar.html">QTabBar</a>) and a "page area" 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>
<p>The normal way to use QTabWidget is to do the following:</p>
<ol type="1">
<li>Create a QTabWidget.</li>
<li>Create a <a href="qwidget.html">QWidget</a> for each of the pages in the tab dialog, but do not specify parent widgets for them.</li>
<li>Insert child widgets into the page widget, using layouts to position them as normal.</li>
<li>Call <a href="qtabwidget.html#addTab">addTab</a>() or <a href="qtabwidget.html#insertTab">insertTab</a>() to put the page widgets into the tab widget, giving each tab a suitable label with an optional keyboard shortcut.</li>
</ol>
<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>
<p>The signal <a href="qtabwidget.html#currentChanged">currentChanged</a>() is emitted when the user selects a page.</p>
<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>
<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 and its associated page can be removed with <a href="qtabwidget.html#removeTab">removeTab</a>().</p>
<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>
<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>
<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>
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic" width="100%">
<tr class="odd" valign="top"><td><img alt="Screenshot of a Windows XP style tab widget" src="images/windowsxp-tabwidget.png" /></td><td><img alt="Screenshot of a Macintosh style tab widget" src="images/macintosh-tabwidget.png" /></td><td><img alt="Screenshot of a Plastique style tab widget" src="images/plastique-tabwidget.png" /></td></tr>
<tr class="even" valign="top"><td>A Windows XP style tab widget.</td><td>A Macintosh style tab widget.</td><td>A Plastique style tab widget.</td></tr>
</table></p>
<p>See also <a href="qtabbar.html">QTabBar</a>, <a href="qstackedwidget.html">QStackedWidget</a>, <a href="qtoolbox.html">QToolBox</a>, and <a href="dialogs-tabdialog.html">Tab Dialog Example</a>.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="TabPosition-enum" />QTabWidget.TabPosition</h3><p>This enum type defines where <a href="qtabwidget.html">QTabWidget</a> draws the tab row:</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<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>
<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>
<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>
<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>
</table></p>
<a name="//apple_ref/cpp/tag/QTabWidget/TabShape" />
<a name="//apple_ref/cpp/econst/QTabWidget/Rounded" />
<a name="//apple_ref/cpp/econst/QTabWidget/Triangular" />
<h3 class="fn"><a name="TabShape-enum" />QTabWidget.TabShape</h3><p>This enum type defines the shape of the tabs:</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QTabWidget.Rounded</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The tabs are drawn with a rounded look. This is the default shape.</td></tr>
<tr><td valign="top"><tt>QTabWidget.Triangular</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The tabs are drawn with a triangular look.</td></tr>
</table></p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTabWidget" />QTabWidget.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a tabbed widget with parent <i>parent</i>.</p>
<a name="//apple_ref/cpp/instm/QTabWidget/~QTabWidget" />
<h3 class="fn"><a name="addTab" />int QTabWidget.addTab (<i>self</i>, <a href="qwidget.html">QWidget</a>, QString)</h3><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>Adds a tab with the given <i>page</i> and <i>label</i> to the tab widget, and returns the index of the tab in the tab bar.</p>
<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 "Bro&amp;wse" then Alt+W becomes a shortcut which will move the focus to this tab.</p>
<p><b>Note:</b> If you call addTab() after <a href="qwidget.html#show">show</a>(), the layout system will try to adjust to the changes in its widgets hierarchy and may cause flicker. To prevent this, you can set the <a href="qwidget.html#updatesEnabled-prop">QWidget.updatesEnabled</a> property to false prior to changes; remember to set the property to true when the changes are done, making the widget receive paint events again.</p>
<p>See also <a href="qtabwidget.html#insertTab">insertTab</a>().</p>
<h3 class="fn"><a name="addTab-2" />int QTabWidget.addTab (<i>self</i>, <a href="qwidget.html">QWidget</a>, <a href="qicon.html">QIcon</a>, QString)</h3><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>This is an overloaded function.</p>
<p>Adds a tab with the given <i>page</i>, <i>icon</i>, and <i>label</i> to the tab widget, and returns the index of the tab in the tab bar.</p>
<p>This function is the same as <a href="qtabwidget.html#addTab">addTab</a>(), but with an additional <i>icon</i>.</p>
<a name="//apple_ref/cpp/instm/QTabWidget/changeEvent" />
<h3 class="fn"><a name="changeEvent" />QTabWidget.changeEvent (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget.changeEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/clear" />
<h3 class="fn"><a name="clear" />QTabWidget.clear (<i>self</i>)</h3><p>Removes all the pages, but does not delete them. Calling this function is equivalent to calling <a href="qtabwidget.html#removeTab">removeTab</a>() until the tab widget is empty.</p>
<a name="//apple_ref/cpp/instm/QTabWidget/cornerWidget" />
<h3 class="fn"><a name="cornerWidget" /><a href="qwidget.html">QWidget</a> QTabWidget.cornerWidget (<i>self</i>, <a href="qt.html#Corner-enum">Qt.Corner</a>&#160;<i>corner</i>&#160;=&#160;Qt.TopRightCorner)</h3><p>Returns the widget shown in the <i>corner</i> of the tab widget or 0.</p>
<p>See also <a href="qtabwidget.html#setCornerWidget">setCornerWidget</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/currentChanged" />
<h3 class="fn"><a name="count" />int QTabWidget.count (<i>self</i>)</h3><h3 class="fn"><a name="currentIndex" />int QTabWidget.currentIndex (<i>self</i>)</h3><h3 class="fn"><a name="currentWidget" /><a href="qwidget.html">QWidget</a> QTabWidget.currentWidget (<i>self</i>)</h3><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>
<p>See also <a href="qtabwidget.html#currentIndex-prop">currentIndex</a>() and <a href="qtabwidget.html#setCurrentWidget">setCurrentWidget</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/event" />
<h3 class="fn"><a name="documentMode" />bool QTabWidget.documentMode (<i>self</i>)</h3><h3 class="fn"><a name="elideMode" /><a href="qt.html#TextElideMode-enum">Qt.TextElideMode</a> QTabWidget.elideMode (<i>self</i>)</h3><h3 class="fn"><a name="event" />bool QTabWidget.event (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/indexOf" />
<h3 class="fn"><a name="iconSize" /><a href="qsize.html">QSize</a> QTabWidget.iconSize (<i>self</i>)</h3><h3 class="fn"><a name="indexOf" />int QTabWidget.indexOf (<i>self</i>, <a href="qwidget.html">QWidget</a>)</h3><p>Returns the index position of the page occupied by the widget <i>w</i>, or -1 if the widget cannot be found.</p>
<a name="//apple_ref/cpp/instm/QTabWidget/initStyleOption" />
<h3 class="fn"><a name="initStyleOption" />QTabWidget.initStyleOption (<i>self</i>, <a href="qstyleoptiontabwidgetframe.html">QStyleOptionTabWidgetFrame</a>)</h3><p>Initialize <i>option</i> with the values from this <a href="qtabwidget.html">QTabWidget</a>. This method is useful for subclasses when they need a <a href="qstyleoptiontabwidgetframe.html">QStyleOptionTabWidgetFrame</a>, but don't want to fill in all the information themselves.</p>
<p>See also <a href="qstyleoption.html#initFrom">QStyleOption.initFrom</a>() and <a href="qtabbar.html#initStyleOption">QTabBar.initStyleOption</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/insertTab" />
<h3 class="fn"><a name="insertTab" />int QTabWidget.insertTab (<i>self</i>, int, <a href="qwidget.html">QWidget</a>, QString)</h3><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>Inserts a tab with the given <i>label</i> and <i>page</i> into the tab widget at the specified <i>index</i>, and returns the index of the inserted tab in the tab bar.</p>
<p>The label is displayed in the tab and may vary in appearance depending on the configuration of the tab widget.</p>
<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 "Bro&amp;wse" then Alt+W becomes a shortcut which will move the focus to this tab.</p>
<p>If <i>index</i> is out of range, the tab is simply appended. Otherwise it is inserted at the specified position.</p>
<p>If the <a href="qtabwidget.html">QTabWidget</a> was empty before this function is called, the new page becomes the current page. Inserting a new tab at an index less than or equal to the current index will increment the current index, but keep the current page.</p>
<p><b>Note:</b> If you call insertTab() after <a href="qwidget.html#show">show</a>(), the layout system will try to adjust to the changes in its widgets hierarchy and may cause flicker. To prevent this, you can set the <a href="qwidget.html#updatesEnabled-prop">QWidget.updatesEnabled</a> property to false prior to changes; remember to set the property to true when the changes are done, making the widget receive paint events again.</p>
<p>See also <a href="qtabwidget.html#addTab">addTab</a>().</p>
<h3 class="fn"><a name="insertTab-2" />int QTabWidget.insertTab (<i>self</i>, int, <a href="qwidget.html">QWidget</a>, <a href="qicon.html">QIcon</a>, QString)</h3><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><h3 class="fn"><a name="isMovable" />bool QTabWidget.isMovable (<i>self</i>)</h3><h3 class="fn"><a name="isTabEnabled" />bool QTabWidget.isTabEnabled (<i>self</i>, int)</h3><p>Returns true if the page at position <i>index</i> is enabled; otherwise returns false.</p>
<p>See also <a href="qtabwidget.html#setTabEnabled">setTabEnabled</a>() and <a href="qwidget.html#enabled-prop">QWidget.isEnabled</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/keyPressEvent" />
<h3 class="fn"><a name="keyPressEvent" />QTabWidget.keyPressEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget.keyPressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/minimumSizeHint" />
<h3 class="fn"><a name="minimumSizeHint" /><a href="qsize.html">QSize</a> QTabWidget.minimumSizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#minimumSizeHint-prop">QWidget.minimumSizeHint</a>().</p>
<p>Returns a suitable minimum size for the tab widget.</p>
<a name="//apple_ref/cpp/instm/QTabWidget/paintEvent" />
<h3 class="fn"><a name="paintEvent" />QTabWidget.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget.paintEvent</a>().</p>
<p>Paints the tab widget's tab bar in response to the paint <i>event</i>.</p>
<a name="//apple_ref/cpp/instm/QTabWidget/removeTab" />
<h3 class="fn"><a name="removeTab" />QTabWidget.removeTab (<i>self</i>, int)</h3><p>Removes the tab at position <i>index</i> from this stack of widgets. The page widget itself is not deleted.</p>
<p>See also <a href="qtabwidget.html#addTab">addTab</a>() and <a href="qtabwidget.html#insertTab">insertTab</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/resizeEvent" />
<h3 class="fn"><a name="resizeEvent" />QTabWidget.resizeEvent (<i>self</i>, <a href="qresizeevent.html">QResizeEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget.resizeEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/setCornerWidget" />
<h3 class="fn"><a name="setCornerWidget" />QTabWidget.setCornerWidget (<i>self</i>, <a href="qwidget.html">QWidget</a>, <a href="qt.html#Corner-enum">Qt.Corner</a>&#160;<i>corner</i>&#160;=&#160;Qt.TopRightCorner)</h3><p>The <i>QWidget</i> argument has it's ownership transferred to Qt.</p><p>Sets the given <i>widget</i> to be shown in the specified <i>corner</i> of the tab widget. The geometry of the widget is determined based on the widget's <a href="qtabwidget.html#sizeHint">sizeHint</a>() and the <a href="qwidget.html#style">style</a>().</p>
<p>Only the horizontal element of the <i>corner</i> will be used.</p>
<p>Passing 0 shows no widget in the corner.</p>
<p>Any previously set corner widget is hidden.</p>
<p>All widgets set here will be deleted by the tab widget when it is destroyed unless you separately reparent the widget after setting some other corner widget (or 0).</p>
<p>Note: Corner widgets are designed for <a href="qtabwidget.html#TabPosition-enum">North</a> and <a href="qtabwidget.html#TabPosition-enum">South</a> tab positions; other orientations are known to not work properly.</p>
<p>See also <a href="qtabwidget.html#cornerWidget">cornerWidget</a>() and <a href="qtabwidget.html#tabPosition-prop">setTabPosition</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/setCurrentWidget" />
<h3 class="fn"><a name="setCurrentIndex" />QTabWidget.setCurrentIndex (<i>self</i>, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentIndex(int)</tt>.</p><h3 class="fn"><a name="setCurrentWidget" />QTabWidget.setCurrentWidget (<i>self</i>, <a href="qwidget.html">QWidget</a>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentWidget(QWidget *)</tt>.</p><p>Makes <i>widget</i> the current widget. The <i>widget</i> used must be a page in this tab widget.</p>
<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>
<a name="//apple_ref/cpp/instm/QTabWidget/setTabBar" />
<h3 class="fn"><a name="setDocumentMode" />QTabWidget.setDocumentMode (<i>self</i>, bool)</h3><h3 class="fn"><a name="setElideMode" />QTabWidget.setElideMode (<i>self</i>, <a href="qt.html#TextElideMode-enum">Qt.TextElideMode</a>)</h3><h3 class="fn"><a name="setIconSize" />QTabWidget.setIconSize (<i>self</i>, <a href="qsize.html">QSize</a>)</h3><h3 class="fn"><a name="setMovable" />QTabWidget.setMovable (<i>self</i>, bool)</h3><h3 class="fn"><a name="setTabBar" />QTabWidget.setTabBar (<i>self</i>, <a href="qtabbar.html">QTabBar</a>)</h3><p>The <i>QTabBar</i> argument has it's ownership transferred to Qt.</p><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>
<p>See also <a href="qtabwidget.html#tabBar">tabBar</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/setTabEnabled" />
<h3 class="fn"><a name="setTabEnabled" />QTabWidget.setTabEnabled (<i>self</i>, int, bool)</h3><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>
<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>
<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>
<p>See also <a href="qtabwidget.html#isTabEnabled">isTabEnabled</a>() and <a href="qwidget.html#enabled-prop">QWidget.setEnabled</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/setTabIcon" />
<h3 class="fn"><a name="setTabIcon" />QTabWidget.setTabIcon (<i>self</i>, int, <a href="qicon.html">QIcon</a>)</h3><p>This is an overloaded function.</p>
<p>Sets the <i>icon</i> for the tab at position <i>index</i>.</p>
<p>See also <a href="qtabwidget.html#tabIcon">tabIcon</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/setTabText" />
<h3 class="fn"><a name="setTabPosition" />QTabWidget.setTabPosition (<i>self</i>, <a href="qtabwidget.html#TabPosition-enum">TabPosition</a>)</h3><h3 class="fn"><a name="setTabsClosable" />QTabWidget.setTabsClosable (<i>self</i>, bool)</h3><h3 class="fn"><a name="setTabShape" />QTabWidget.setTabShape (<i>self</i>, <a href="qtabwidget.html#TabShape-enum">TabShape</a>)</h3><h3 class="fn"><a name="setTabText" />QTabWidget.setTabText (<i>self</i>, int, QString)</h3><p>Defines a new <i>label</i> for the page at position <i>index</i>'s tab.</p>
<p>If the provided text contains an ampersand character ('&amp;'), a shortcut is automatically created for it. The character that follows the '&amp;' will be used as the shortcut key. Any previous shortcut will be overwritten, or cleared if no shortcut is defined by the text. See the <a href="qshortcut.html#mnemonic">QShortcut</a> documentation for details (to display an actual ampersand, use '&amp;&amp;').</p>
<p>See also <a href="qtabwidget.html#tabText">tabText</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/setTabToolTip" />
<h3 class="fn"><a name="setTabToolTip" />QTabWidget.setTabToolTip (<i>self</i>, int, QString)</h3><p>Sets the tab tool tip for the page at position <i>index</i> to <i>tip</i>.</p>
<p>See also <a href="qtabwidget.html#tabToolTip">tabToolTip</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/setTabWhatsThis" />
<h3 class="fn"><a name="setTabWhatsThis" />QTabWidget.setTabWhatsThis (<i>self</i>, int, QString)</h3><p>Sets the What's This help text for the page at position <i>index</i> to <i>text</i>.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qtabwidget.html#tabWhatsThis">tabWhatsThis</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/showEvent" />
<h3 class="fn"><a name="setUsesScrollButtons" />QTabWidget.setUsesScrollButtons (<i>self</i>, bool)</h3><h3 class="fn"><a name="showEvent" />QTabWidget.showEvent (<i>self</i>, <a href="qshowevent.html">QShowEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#showEvent">QWidget.showEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/sizeHint" />
<h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QTabWidget.sizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget.sizeHint</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/tabBar" />
<h3 class="fn"><a name="tabBar" /><a href="qtabbar.html">QTabBar</a> QTabWidget.tabBar (<i>self</i>)</h3><p>Returns the current <a href="qtabbar.html">QTabBar</a>.</p>
<p>See also <a href="qtabwidget.html#setTabBar">setTabBar</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/tabCloseRequested" />
<h3 class="fn"><a name="tabIcon" /><a href="qicon.html">QIcon</a> QTabWidget.tabIcon (<i>self</i>, int)</h3><p>Returns the icon for the tab on the page at position <i>index</i>.</p>
<p>See also <a href="qtabwidget.html#setTabIcon">setTabIcon</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/tabInserted" />
<h3 class="fn"><a name="tabInserted" />QTabWidget.tabInserted (<i>self</i>, int)</h3><p>This virtual handler is called after a new tab was added or inserted at position <i>index</i>.</p>
<p>See also <a href="qtabwidget.html#tabRemoved">tabRemoved</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/tabRemoved" />
<h3 class="fn"><a name="tabPosition" /><a href="qtabwidget.html#TabPosition-enum">TabPosition</a> QTabWidget.tabPosition (<i>self</i>)</h3><h3 class="fn"><a name="tabRemoved" />QTabWidget.tabRemoved (<i>self</i>, int)</h3><p>This virtual handler is called after a tab was removed from position <i>index</i>.</p>
<p>See also <a href="qtabwidget.html#tabInserted">tabInserted</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/tabText" />
<h3 class="fn"><a name="tabsClosable" />bool QTabWidget.tabsClosable (<i>self</i>)</h3><h3 class="fn"><a name="tabShape" /><a href="qtabwidget.html#TabShape-enum">TabShape</a> QTabWidget.tabShape (<i>self</i>)</h3><h3 class="fn"><a name="tabText" />QString QTabWidget.tabText (<i>self</i>, int)</h3><p>Returns the label text for the tab on the page at position <i>index</i>.</p>
<p>See also <a href="qtabwidget.html#setTabText">setTabText</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/tabToolTip" />
<h3 class="fn"><a name="tabToolTip" />QString QTabWidget.tabToolTip (<i>self</i>, int)</h3><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>
<p>See also <a href="qtabwidget.html#setTabToolTip">setTabToolTip</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/tabWhatsThis" />
<h3 class="fn"><a name="tabWhatsThis" />QString QTabWidget.tabWhatsThis (<i>self</i>, int)</h3><p>Returns the What's This help text for the page at position <i>index</i>, or an empty string if no help text has been set.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qtabwidget.html#setTabWhatsThis">setTabWhatsThis</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/widget" />
<h3 class="fn"><a name="usesScrollButtons" />bool QTabWidget.usesScrollButtons (<i>self</i>)</h3><h3 class="fn"><a name="widget" /><a href="qwidget.html">QWidget</a> QTabWidget.widget (<i>self</i>, int)</h3><p>Returns the tab page at index position <i>index</i> or 0 if the <i>index</i> is out of range.</p>
<p /><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="currentChanged" />void currentChanged (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the current page index changes. The parameter is the new current page <i>index</i> position, or -1 if there isn't a new one (for example, if there are no widgets in the <a href="qtabwidget.html">QTabWidget</a>)</p>
<p>See also <a href="qtabwidget.html#currentWidget">currentWidget</a>() and <a href="qtabwidget.html#currentIndex-prop">currentIndex</a>.</p>
<a name="//apple_ref/cpp/instm/QTabWidget/currentWidget" />
<h3 class="fn"><a name="tabCloseRequested" />void tabCloseRequested (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the close button on a tab is clicked. The <i>index</i> is the index that should be removed.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qtabwidget.html#tabsClosable-prop">setTabsClosable</a>().</p>
<a name="//apple_ref/cpp/instm/QTabWidget/tabIcon" />
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.2</td></tr></table></div></address></body></html>