[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qtabwidget.cpp:54 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QTabWidget Class</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QTabWidget Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QTabWidget class provides a stack of tabbed widgets.
|
---|
| 35 | <a href="#details">More...</a>
|
---|
| 36 | <p><tt>#include <<a href="qtabwidget-h.html">qtabwidget.h</a>></tt>
|
---|
| 37 | <p>Inherits <a href="qwidget.html">QWidget</a>.
|
---|
| 38 | <p><a href="qtabwidget-members.html">List of all member functions.</a>
|
---|
| 39 | <h2>Public Members</h2>
|
---|
| 40 | <ul>
|
---|
| 41 | <li class=fn><a href="#QTabWidget"><b>QTabWidget</b></a> ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 )</li>
|
---|
| 42 | <li class=fn>virtual void <a href="#addTab"><b>addTab</b></a> ( QWidget * child, const QString & label )</li>
|
---|
| 43 | <li class=fn>virtual void <a href="#addTab-2"><b>addTab</b></a> ( QWidget * child, const QIconSet & iconset, const QString & label )</li>
|
---|
| 44 | <li class=fn>virtual void <a href="#addTab-3"><b>addTab</b></a> ( QWidget * child, QTab * tab )</li>
|
---|
| 45 | <li class=fn>virtual void <a href="#insertTab"><b>insertTab</b></a> ( QWidget * child, const QString & label, int index = -1 )</li>
|
---|
| 46 | <li class=fn>virtual void <a href="#insertTab-2"><b>insertTab</b></a> ( QWidget * child, const QIconSet & iconset, const QString & label, int index = -1 )</li>
|
---|
| 47 | <li class=fn>virtual void <a href="#insertTab-3"><b>insertTab</b></a> ( QWidget * child, QTab * tab, int index = -1 )</li>
|
---|
| 48 | <li class=fn>void <a href="#changeTab"><b>changeTab</b></a> ( QWidget * w, const QString & label )</li>
|
---|
| 49 | <li class=fn>void <a href="#changeTab-2"><b>changeTab</b></a> ( QWidget * w, const QIconSet & iconset, const QString & label )</li>
|
---|
| 50 | <li class=fn>bool <a href="#isTabEnabled"><b>isTabEnabled</b></a> ( QWidget * w ) const</li>
|
---|
| 51 | <li class=fn>void <a href="#setTabEnabled"><b>setTabEnabled</b></a> ( QWidget * w, bool enable )</li>
|
---|
| 52 | <li class=fn>void <a href="#setCornerWidget"><b>setCornerWidget</b></a> ( QWidget * w, Qt::Corner corner = Qt::TopRight )</li>
|
---|
| 53 | <li class=fn>QWidget * <a href="#cornerWidget"><b>cornerWidget</b></a> ( Qt::Corner corner = Qt::TopRight ) const</li>
|
---|
| 54 | <li class=fn>QString <a href="#tabLabel"><b>tabLabel</b></a> ( QWidget * w ) const</li>
|
---|
| 55 | <li class=fn>void <a href="#setTabLabel"><b>setTabLabel</b></a> ( QWidget * w, const QString & l )</li>
|
---|
| 56 | <li class=fn>QIconSet <a href="#tabIconSet"><b>tabIconSet</b></a> ( QWidget * w ) const</li>
|
---|
| 57 | <li class=fn>void <a href="#setTabIconSet"><b>setTabIconSet</b></a> ( QWidget * w, const QIconSet & iconset )</li>
|
---|
| 58 | <li class=fn>void <a href="#removeTabToolTip"><b>removeTabToolTip</b></a> ( QWidget * w )</li>
|
---|
| 59 | <li class=fn>void <a href="#setTabToolTip"><b>setTabToolTip</b></a> ( QWidget * w, const QString & tip )</li>
|
---|
| 60 | <li class=fn>QString <a href="#tabToolTip"><b>tabToolTip</b></a> ( QWidget * w ) const</li>
|
---|
| 61 | <li class=fn>QWidget * <a href="#currentPage"><b>currentPage</b></a> () const</li>
|
---|
| 62 | <li class=fn>QWidget * <a href="#page"><b>page</b></a> ( int index ) const</li>
|
---|
| 63 | <li class=fn>QString <a href="#label"><b>label</b></a> ( int index ) const</li>
|
---|
| 64 | <li class=fn>int <a href="#currentPageIndex"><b>currentPageIndex</b></a> () const</li>
|
---|
| 65 | <li class=fn>int <a href="#indexOf"><b>indexOf</b></a> ( QWidget * w ) const</li>
|
---|
| 66 | <li class=fn>enum <a href="#TabPosition-enum"><b>TabPosition</b></a> { Top, Bottom }</li>
|
---|
| 67 | <li class=fn>TabPosition <a href="#tabPosition"><b>tabPosition</b></a> () const</li>
|
---|
| 68 | <li class=fn>void <a href="#setTabPosition"><b>setTabPosition</b></a> ( TabPosition )</li>
|
---|
| 69 | <li class=fn>enum <a href="#TabShape-enum"><b>TabShape</b></a> { Rounded, Triangular }</li>
|
---|
| 70 | <li class=fn>TabShape <a href="#tabShape"><b>tabShape</b></a> () const</li>
|
---|
| 71 | <li class=fn>void <a href="#setTabShape"><b>setTabShape</b></a> ( TabShape s )</li>
|
---|
| 72 | <li class=fn>int <a href="#margin"><b>margin</b></a> () const</li>
|
---|
| 73 | <li class=fn>void <a href="#setMargin"><b>setMargin</b></a> ( int )</li>
|
---|
| 74 | <li class=fn>int <a href="#count"><b>count</b></a> () const</li>
|
---|
| 75 | </ul>
|
---|
| 76 | <h2>Public Slots</h2>
|
---|
| 77 | <ul>
|
---|
| 78 | <li class=fn>void <a href="#setCurrentPage"><b>setCurrentPage</b></a> ( int )</li>
|
---|
| 79 | <li class=fn>virtual void <a href="#showPage"><b>showPage</b></a> ( QWidget * w )</li>
|
---|
| 80 | <li class=fn>virtual void <a href="#removePage"><b>removePage</b></a> ( QWidget * w )</li>
|
---|
| 81 | </ul>
|
---|
| 82 | <h2>Signals</h2>
|
---|
| 83 | <ul>
|
---|
| 84 | <li class=fn>void <a href="#currentChanged"><b>currentChanged</b></a> ( QWidget * )</li>
|
---|
| 85 | </ul>
|
---|
| 86 | <h2>Properties</h2>
|
---|
| 87 | <ul>
|
---|
| 88 | <li class=fn>bool <a href="#autoMask-prop"><b>autoMask</b></a> - whether the tab widget is automatically masked <em>(read only)</em></li>
|
---|
| 89 | <li class=fn>int <a href="#count-prop"><b>count</b></a> - the number of tabs in the tab bar <em>(read only)</em></li>
|
---|
| 90 | <li class=fn>int <a href="#currentPage-prop"><b>currentPage</b></a> - the index position of the current tab page</li>
|
---|
| 91 | <li class=fn>int <a href="#margin-prop"><b>margin</b></a> - the margin in this tab widget</li>
|
---|
| 92 | <li class=fn>TabPosition <a href="#tabPosition-prop"><b>tabPosition</b></a> - the position of the tabs in this tab widget</li>
|
---|
| 93 | <li class=fn>TabShape <a href="#tabShape-prop"><b>tabShape</b></a> - the shape of the tabs in this tab widget</li>
|
---|
| 94 | </ul>
|
---|
| 95 | <h2>Protected Members</h2>
|
---|
| 96 | <ul>
|
---|
| 97 | <li class=fn>void <a href="#setTabBar"><b>setTabBar</b></a> ( QTabBar * tb )</li>
|
---|
| 98 | <li class=fn>QTabBar * <a href="#tabBar"><b>tabBar</b></a> () const</li>
|
---|
| 99 | </ul>
|
---|
| 100 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 101 |
|
---|
| 102 |
|
---|
| 103 | The QTabWidget class provides a stack of tabbed widgets.
|
---|
| 104 | <p>
|
---|
| 105 |
|
---|
| 106 |
|
---|
| 107 | <p> A tab widget provides a tab bar of tabs and a `page area' below
|
---|
| 108 | (or above, see <a href="#TabPosition-enum">TabPosition</a>) the tabs. Each tab is associated
|
---|
| 109 | with a different widget (called a `page'). Only the current tab's
|
---|
| 110 | page is shown in the page area; all the other tabs' pages are
|
---|
| 111 | hidden. The user can show a different page by clicking on its tab
|
---|
| 112 | or by pressing its Alt+<em>letter</em> accelerator if it has one.
|
---|
| 113 | <p> The normal way to use QTabWidget is to do the following in the
|
---|
| 114 | constructor:
|
---|
| 115 | <ol type=1>
|
---|
| 116 | <li> Create a QTabWidget.
|
---|
| 117 | <li> Create a <a href="qwidget.html">QWidget</a> for each of the pages in the tab dialog,
|
---|
| 118 | insert children into it, set up geometry management for it and use
|
---|
| 119 | <a href="#addTab">addTab</a>() (or <a href="#insertTab">insertTab</a>()) to set up a tab and keyboard accelerator
|
---|
| 120 | for it.
|
---|
| 121 | <li> Connect to the signals and slots.
|
---|
| 122 | </ol>
|
---|
| 123 | <p> The position of the tabs is set with <a href="#setTabPosition">setTabPosition</a>(), their shape
|
---|
| 124 | with <a href="#setTabShape">setTabShape</a>(), and their margin with <a href="#setMargin">setMargin</a>().
|
---|
| 125 | <p> If you don't call addTab() and the QTabWidget is already visible,
|
---|
| 126 | then the page you have created will not be visible. Don't
|
---|
| 127 | confuse the object name you supply to the QWidget constructor and
|
---|
| 128 | the tab label you supply to addTab(). addTab() takes a name which
|
---|
| 129 | indicates an accelerator and is meaningful and descriptive to the
|
---|
| 130 | user, whereas the widget name is used primarily for debugging.
|
---|
| 131 | <p> The signal <a href="#currentChanged">currentChanged</a>() is emitted when the user selects a
|
---|
| 132 | page.
|
---|
| 133 | <p> The current page is available as an index position with
|
---|
| 134 | <a href="#currentPageIndex">currentPageIndex</a>() or as a wiget pointer with <a href="#currentPage">currentPage</a>(). You
|
---|
| 135 | can retrieve a pointer to a page with a given index using <a href="#page">page</a>(),
|
---|
| 136 | and can find the index position of a page with <a href="#indexOf">indexOf</a>(). Use
|
---|
| 137 | <a href="#setCurrentPage">setCurrentPage</a>() to show a particular page by index, or <a href="#showPage">showPage</a>()
|
---|
| 138 | to show a page by widget pointer.
|
---|
| 139 | <p> You can change a tab's label and iconset using <a href="#changeTab">changeTab</a>() or
|
---|
| 140 | <a href="#setTabLabel">setTabLabel</a>() and <a href="#setTabIconSet">setTabIconSet</a>(). A tab page can be removed with
|
---|
| 141 | <a href="#removePage">removePage</a>().
|
---|
| 142 | <p> Each tab is either enabled or disabled at any given time (see
|
---|
| 143 | <a href="#setTabEnabled">setTabEnabled</a>()). If a tab is enabled, the tab text is drawn
|
---|
| 144 | normally and the user can select that tab. If it is disabled, the
|
---|
| 145 | tab is drawn in a different way and the user cannot select that
|
---|
| 146 | tab. Note that even if a tab is disabled, the page can still be
|
---|
| 147 | visible, for example if all of the tabs happen to be disabled.
|
---|
| 148 | <p> Although tab widgets can be a very good way to split up a complex
|
---|
| 149 | dialog, it's also very easy to get into a mess. See <a href="qtabdialog.html">QTabDialog</a> for
|
---|
| 150 | some design hints. An alternative is to use a <a href="qwidgetstack.html">QWidgetStack</a> for
|
---|
| 151 | which you provide some means of navigating between pages, for
|
---|
| 152 | example, a <a href="qtoolbar.html">QToolBar</a> or a <a href="qlistbox.html">QListBox</a>.
|
---|
| 153 | <p> Most of the functionality in QTabWidget is provided by a <a href="qtabbar.html">QTabBar</a>
|
---|
| 154 | (at the top, providing the tabs) and a QWidgetStack (most of the
|
---|
| 155 | area, organizing the individual pages).
|
---|
| 156 | <p> <img src=qtabwidget-m.png> <img src=qtabwidget-w.png>
|
---|
| 157 | <p> <p>See also <a href="qtabdialog.html">QTabDialog</a>, <a href="qtoolbox.html">QToolBox</a>, <a href="advanced.html">Advanced Widgets</a>, and <a href="organizers.html">Organizers</a>.
|
---|
| 158 |
|
---|
| 159 | <hr><h2>Member Type Documentation</h2>
|
---|
| 160 | <h3 class=fn><a name="TabPosition-enum"></a>QTabWidget::TabPosition</h3>
|
---|
| 161 |
|
---|
| 162 | <p> This enum type defines where QTabWidget draws the tab row:
|
---|
| 163 | <ul>
|
---|
| 164 | <li><tt>QTabWidget::Top</tt> - above the pages
|
---|
| 165 | <li><tt>QTabWidget::Bottom</tt> - below the pages
|
---|
| 166 | </ul>
|
---|
| 167 | <h3 class=fn><a name="TabShape-enum"></a>QTabWidget::TabShape</h3>
|
---|
| 168 |
|
---|
| 169 | <p> This enum type defines the shape of the tabs:
|
---|
| 170 | <ul>
|
---|
| 171 | <li><tt>QTabWidget::Rounded</tt> - rounded look (normal)
|
---|
| 172 | <li><tt>QTabWidget::Triangular</tt> - triangular look (very unusual, included for completeness)
|
---|
| 173 | </ul>
|
---|
| 174 | <hr><h2>Member Function Documentation</h2>
|
---|
| 175 | <h3 class=fn><a name="QTabWidget"></a>QTabWidget::QTabWidget ( <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0, WFlags f = 0 )
|
---|
| 176 | </h3>
|
---|
| 177 | Constructs a tabbed widget called <em>name</em> with parent <em>parent</em>,
|
---|
| 178 | and widget flags <em>f</em>.
|
---|
| 179 |
|
---|
| 180 | <h3 class=fn>void <a name="addTab"></a>QTabWidget::addTab ( <a href="qwidget.html">QWidget</a> * child, const <a href="qstring.html">QString</a> & label )<tt> [virtual]</tt>
|
---|
| 181 | </h3>
|
---|
| 182 | Adds another tab and page to the tab view.
|
---|
| 183 | <p> The new page is <em>child</em>; the tab's label is <em>label</em>. Note the
|
---|
| 184 | difference between the widget name (which you supply to widget
|
---|
| 185 | constructors and to <a href="#setTabEnabled">setTabEnabled</a>(), for example) and the tab
|
---|
| 186 | label. The name is internal to the program and invariant, whereas
|
---|
| 187 | the label is shown on-screen and may vary according to language
|
---|
| 188 | and other factors.
|
---|
| 189 | <p> If the tab's <em>label</em> contains an ampersand, the letter following
|
---|
| 190 | the ampersand is used as an accelerator for the tab, e.g. if the
|
---|
| 191 | label is "Bro&wse" then Alt+W becomes an accelerator which will
|
---|
| 192 | move the focus to this tab.
|
---|
| 193 | <p> If you call <a href="#addTab">addTab</a>() after <a href="qwidget.html#show">show</a>() the screen will flicker and the
|
---|
| 194 | user may be confused.
|
---|
| 195 | <p> Adding the same child twice will have undefined behavior.
|
---|
| 196 | <p> <p>See also <a href="#insertTab">insertTab</a>().
|
---|
| 197 |
|
---|
| 198 | <p>Examples: <a href="addressbook-example.html#x600">addressbook/centralwidget.cpp</a> and <a href="themes-example.html#x343">themes/themes.cpp</a>.
|
---|
| 199 | <h3 class=fn>void <a name="addTab-2"></a>QTabWidget::addTab ( <a href="qwidget.html">QWidget</a> * child, const <a href="qiconset.html">QIconSet</a> & iconset, const <a href="qstring.html">QString</a> & label )<tt> [virtual]</tt>
|
---|
| 200 | </h3>
|
---|
| 201 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 202 | <p> Adds another tab and page to the tab view.
|
---|
| 203 | <p> This function is the same as <a href="#addTab">addTab</a>(), but with an additional <em>iconset</em>.
|
---|
| 204 |
|
---|
| 205 | <h3 class=fn>void <a name="addTab-3"></a>QTabWidget::addTab ( <a href="qwidget.html">QWidget</a> * child, <a href="qtab.html">QTab</a> * tab )<tt> [virtual]</tt>
|
---|
| 206 | </h3>
|
---|
| 207 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 208 | <p> This is a low-level function for adding tabs. It is useful if you
|
---|
| 209 | are using <a href="#setTabBar">setTabBar</a>() to set a <a href="qtabbar.html">QTabBar</a> subclass with an overridden
|
---|
| 210 | <a href="qtabbar.html#paint">QTabBar::paint</a>() function for a subclass of <a href="qtab.html">QTab</a>. The <em>child</em> is
|
---|
| 211 | the new page and <em>tab</em> is the tab to put the <em>child</em> on.
|
---|
| 212 |
|
---|
| 213 | <h3 class=fn>void <a name="changeTab"></a>QTabWidget::changeTab ( <a href="qwidget.html">QWidget</a> * w, const <a href="qstring.html">QString</a> & label )
|
---|
| 214 | </h3>
|
---|
| 215 | Defines a new <em>label</em> for page <em>w</em>'s tab.
|
---|
| 216 |
|
---|
| 217 | <h3 class=fn>void <a name="changeTab-2"></a>QTabWidget::changeTab ( <a href="qwidget.html">QWidget</a> * w, const <a href="qiconset.html">QIconSet</a> & iconset, const <a href="qstring.html">QString</a> & label )
|
---|
| 218 | </h3>
|
---|
| 219 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 220 | <p> Defines a new <em>iconset</em> and a new <em>label</em> for page <em>w</em>'s tab.
|
---|
| 221 |
|
---|
| 222 | <h3 class=fn><a href="qwidget.html">QWidget</a> * <a name="cornerWidget"></a>QTabWidget::cornerWidget ( <a href="qt.html#Corner-enum">Qt::Corner</a> corner = Qt::TopRight ) const
|
---|
| 223 | </h3>
|
---|
| 224 | Returns the widget shown in the <em>corner</em> of the tab widget or 0.
|
---|
| 225 |
|
---|
| 226 | <h3 class=fn>int <a name="count"></a>QTabWidget::count () const
|
---|
| 227 | </h3><p>Returns the number of tabs in the tab bar.
|
---|
| 228 | See the <a href="qtabwidget.html#count-prop">"count"</a> property for details.
|
---|
| 229 | <h3 class=fn>void <a name="currentChanged"></a>QTabWidget::currentChanged ( <a href="qwidget.html">QWidget</a> * )<tt> [signal]</tt>
|
---|
| 230 | </h3>
|
---|
| 231 |
|
---|
| 232 | <p> This signal is emitted whenever the current page changes. The
|
---|
| 233 | parameter is the new current page.
|
---|
| 234 | <p> <p>See also <a href="#currentPage">currentPage</a>(), <a href="#showPage">showPage</a>(), and <a href="#tabLabel">tabLabel</a>().
|
---|
| 235 |
|
---|
| 236 | <h3 class=fn><a href="qwidget.html">QWidget</a> * <a name="currentPage"></a>QTabWidget::currentPage () const
|
---|
| 237 | </h3>
|
---|
| 238 | Returns a pointer to the page currently being displayed by the tab
|
---|
| 239 | dialog. The tab dialog does its best to make sure that this value
|
---|
| 240 | is never 0 (but if you try hard enough, it can be).
|
---|
| 241 |
|
---|
| 242 | <h3 class=fn>int <a name="currentPageIndex"></a>QTabWidget::currentPageIndex () const
|
---|
| 243 | </h3><p>Returns the index position of the current tab page.
|
---|
| 244 | See the <a href="qtabwidget.html#currentPage-prop">"currentPage"</a> property for details.
|
---|
| 245 | <h3 class=fn>int <a name="indexOf"></a>QTabWidget::indexOf ( <a href="qwidget.html">QWidget</a> * w ) const
|
---|
| 246 | </h3>
|
---|
| 247 | Returns the index position of page <em>w</em>, or -1 if the widget
|
---|
| 248 | cannot be found.
|
---|
| 249 |
|
---|
| 250 | <h3 class=fn>void <a name="insertTab"></a>QTabWidget::insertTab ( <a href="qwidget.html">QWidget</a> * child, const <a href="qstring.html">QString</a> & label, int index = -1 )<tt> [virtual]</tt>
|
---|
| 251 | </h3>
|
---|
| 252 | Inserts another tab and page to the tab view.
|
---|
| 253 | <p> The new page is <em>child</em>; the tab's label is <em>label</em>. Note the
|
---|
| 254 | difference between the widget name (which you supply to widget
|
---|
| 255 | constructors and to <a href="#setTabEnabled">setTabEnabled</a>(), for example) and the tab
|
---|
| 256 | label. The name is internal to the program and invariant, whereas
|
---|
| 257 | the label is shown on-screen and may vary according to language
|
---|
| 258 | and other factors.
|
---|
| 259 | <p> If the tab's <em>label</em> contains an ampersand, the letter following
|
---|
| 260 | the ampersand is used as an accelerator for the tab, e.g. if the
|
---|
| 261 | label is "Bro&wse" then Alt+W becomes an accelerator which will
|
---|
| 262 | move the focus to this tab.
|
---|
| 263 | <p> If <em>index</em> is not specified, the tab is simply appended.
|
---|
| 264 | Otherwise it is inserted at the specified position.
|
---|
| 265 | <p> If you call <a href="#insertTab">insertTab</a>() after <a href="qwidget.html#show">show</a>(), the screen will flicker and
|
---|
| 266 | the user may be confused.
|
---|
| 267 | <p> <p>See also <a href="#addTab">addTab</a>().
|
---|
| 268 |
|
---|
| 269 | <h3 class=fn>void <a name="insertTab-2"></a>QTabWidget::insertTab ( <a href="qwidget.html">QWidget</a> * child, const <a href="qiconset.html">QIconSet</a> & iconset, const <a href="qstring.html">QString</a> & label, int index = -1 )<tt> [virtual]</tt>
|
---|
| 270 | </h3>
|
---|
| 271 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 272 | <p> Inserts another tab and page to the tab view.
|
---|
| 273 | <p> This function is the same as <a href="#insertTab">insertTab</a>(), but with an additional
|
---|
| 274 | <em>iconset</em>.
|
---|
| 275 |
|
---|
| 276 | <h3 class=fn>void <a name="insertTab-3"></a>QTabWidget::insertTab ( <a href="qwidget.html">QWidget</a> * child, <a href="qtab.html">QTab</a> * tab, int index = -1 )<tt> [virtual]</tt>
|
---|
| 277 | </h3>
|
---|
| 278 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 279 | <p> This is a lower-level method for inserting tabs, similar to the
|
---|
| 280 | other <a href="#insertTab">insertTab</a>() method. It is useful if you are using
|
---|
| 281 | <a href="#setTabBar">setTabBar</a>() to set a <a href="qtabbar.html">QTabBar</a> subclass with an overridden
|
---|
| 282 | <a href="qtabbar.html#paint">QTabBar::paint</a>() function for a subclass of <a href="qtab.html">QTab</a>. The <em>child</em> is
|
---|
| 283 | the new page, <em>tab</em> is the tab to put the <em>child</em> on and <em>index</em> is the position in the tab bar that this page should occupy.
|
---|
| 284 |
|
---|
| 285 | <h3 class=fn>bool <a name="isTabEnabled"></a>QTabWidget::isTabEnabled ( <a href="qwidget.html">QWidget</a> * w ) const
|
---|
| 286 | </h3>
|
---|
| 287 | Returns TRUE if the page <em>w</em> is enabled; otherwise returns FALSE.
|
---|
| 288 | <p> <p>See also <a href="#setTabEnabled">setTabEnabled</a>() and <a href="qwidget.html#enabled-prop">QWidget::enabled</a>.
|
---|
| 289 |
|
---|
| 290 | <h3 class=fn><a href="qstring.html">QString</a> <a name="label"></a>QTabWidget::label ( int index ) const
|
---|
| 291 | </h3>
|
---|
| 292 | Returns the label of the tab at index position <em>index</em> or
|
---|
| 293 | <a href="qstring.html#QString-null">QString::null</a> if the <em>index</em> is out of range.
|
---|
| 294 |
|
---|
| 295 | <h3 class=fn>int <a name="margin"></a>QTabWidget::margin () const
|
---|
| 296 | </h3><p>Returns the margin in this tab widget.
|
---|
| 297 | See the <a href="qtabwidget.html#margin-prop">"margin"</a> property for details.
|
---|
| 298 | <h3 class=fn><a href="qwidget.html">QWidget</a> * <a name="page"></a>QTabWidget::page ( int index ) const
|
---|
| 299 | </h3>
|
---|
| 300 | Returns the tab page at index position <em>index</em> or 0 if the <em>index</em> is out of range.
|
---|
| 301 |
|
---|
| 302 | <h3 class=fn>void <a name="removePage"></a>QTabWidget::removePage ( <a href="qwidget.html">QWidget</a> * w )<tt> [virtual slot]</tt>
|
---|
| 303 | </h3>
|
---|
| 304 | Removes page <em>w</em> from this stack of widgets. Does not delete <em>w</em>.
|
---|
| 305 | <p> <p>See also <a href="#addTab">addTab</a>(), <a href="#showPage">showPage</a>(), and <a href="qwidgetstack.html#removeWidget">QWidgetStack::removeWidget</a>().
|
---|
| 306 |
|
---|
| 307 | <h3 class=fn>void <a name="removeTabToolTip"></a>QTabWidget::removeTabToolTip ( <a href="qwidget.html">QWidget</a> * w )
|
---|
| 308 | </h3>
|
---|
| 309 | Removes the tab tool tip for page <em>w</em>. If the page does not have
|
---|
| 310 | a tip, nothing happens.
|
---|
| 311 | <p> <p>See also <a href="#setTabToolTip">setTabToolTip</a>() and <a href="#tabToolTip">tabToolTip</a>().
|
---|
| 312 |
|
---|
| 313 | <h3 class=fn>void <a name="setCornerWidget"></a>QTabWidget::setCornerWidget ( <a href="qwidget.html">QWidget</a> * w, <a href="qt.html#Corner-enum">Qt::Corner</a> corner = Qt::TopRight )
|
---|
| 314 | </h3>
|
---|
| 315 | Sets widget <em>w</em> to be the shown in the specified <em>corner</em> of the
|
---|
| 316 | tab widget.
|
---|
| 317 | <p> Only the horizontal element of the <em>corner</em> will be used.
|
---|
| 318 | <p> <p>See also <a href="#cornerWidget">cornerWidget</a>() and <a href="#tabPosition-prop">tabPosition</a>.
|
---|
| 319 |
|
---|
| 320 | <h3 class=fn>void <a name="setCurrentPage"></a>QTabWidget::setCurrentPage ( int )<tt> [slot]</tt>
|
---|
| 321 | </h3><p>Sets the index position of the current tab page.
|
---|
| 322 | See the <a href="qtabwidget.html#currentPage-prop">"currentPage"</a> property for details.
|
---|
| 323 | <h3 class=fn>void <a name="setMargin"></a>QTabWidget::setMargin ( int )
|
---|
| 324 | </h3><p>Sets the margin in this tab widget.
|
---|
| 325 | See the <a href="qtabwidget.html#margin-prop">"margin"</a> property for details.
|
---|
| 326 | <h3 class=fn>void <a name="setTabBar"></a>QTabWidget::setTabBar ( <a href="qtabbar.html">QTabBar</a> * tb )<tt> [protected]</tt>
|
---|
| 327 | </h3>
|
---|
| 328 | Replaces the dialog's <a href="qtabbar.html">QTabBar</a> heading with the tab bar <em>tb</em>. Note
|
---|
| 329 | that this must be called <em>before</em> any tabs have been added, or
|
---|
| 330 | the behavior is undefined.
|
---|
| 331 | <p> <p>See also <a href="#tabBar">tabBar</a>().
|
---|
| 332 |
|
---|
| 333 | <h3 class=fn>void <a name="setTabEnabled"></a>QTabWidget::setTabEnabled ( <a href="qwidget.html">QWidget</a> * w, bool enable )
|
---|
| 334 | </h3>
|
---|
| 335 | If <em>enable</em> is TRUE, page <em>w</em> is enabled; otherwise page <em>w</em> is
|
---|
| 336 | disabled. The page's tab is redrawn appropriately.
|
---|
| 337 | <p> QTabWidget uses <a href="qwidget.html#setEnabled">QWidget::setEnabled</a>() internally, rather than
|
---|
| 338 | keeping a separate flag.
|
---|
| 339 | <p> Note that even a disabled tab/page may be visible. If the page is
|
---|
| 340 | visible already, QTabWidget will not hide it; if all the pages are
|
---|
| 341 | disabled, QTabWidget will show one of them.
|
---|
| 342 | <p> <p>See also <a href="#isTabEnabled">isTabEnabled</a>() and <a href="qwidget.html#enabled-prop">QWidget::enabled</a>.
|
---|
| 343 |
|
---|
| 344 | <h3 class=fn>void <a name="setTabIconSet"></a>QTabWidget::setTabIconSet ( <a href="qwidget.html">QWidget</a> * w, const <a href="qiconset.html">QIconSet</a> & iconset )
|
---|
| 345 | </h3>
|
---|
| 346 | Sets the iconset for page <em>w</em> to <em>iconset</em>.
|
---|
| 347 |
|
---|
| 348 | <h3 class=fn>void <a name="setTabLabel"></a>QTabWidget::setTabLabel ( <a href="qwidget.html">QWidget</a> * w, const <a href="qstring.html">QString</a> & l )
|
---|
| 349 | </h3>
|
---|
| 350 | Sets the tab label for page <em>w</em> to <em>l</em>
|
---|
| 351 |
|
---|
| 352 | <h3 class=fn>void <a name="setTabPosition"></a>QTabWidget::setTabPosition ( <a href="qtabwidget.html#TabPosition-enum">TabPosition</a> )
|
---|
| 353 | </h3><p>Sets the position of the tabs in this tab widget.
|
---|
| 354 | See the <a href="qtabwidget.html#tabPosition-prop">"tabPosition"</a> property for details.
|
---|
| 355 | <h3 class=fn>void <a name="setTabShape"></a>QTabWidget::setTabShape ( <a href="qtabwidget.html#TabShape-enum">TabShape</a> s )
|
---|
| 356 | </h3><p>Sets the shape of the tabs in this tab widget to <em>s</em>.
|
---|
| 357 | See the <a href="qtabwidget.html#tabShape-prop">"tabShape"</a> property for details.
|
---|
| 358 | <h3 class=fn>void <a name="setTabToolTip"></a>QTabWidget::setTabToolTip ( <a href="qwidget.html">QWidget</a> * w, const <a href="qstring.html">QString</a> & tip )
|
---|
| 359 | </h3>
|
---|
| 360 | Sets the tab tool tip for page <em>w</em> to <em>tip</em>.
|
---|
| 361 | <p> <p>See also <a href="#removeTabToolTip">removeTabToolTip</a>() and <a href="#tabToolTip">tabToolTip</a>().
|
---|
| 362 |
|
---|
| 363 | <h3 class=fn>void <a name="showPage"></a>QTabWidget::showPage ( <a href="qwidget.html">QWidget</a> * w )<tt> [virtual slot]</tt>
|
---|
| 364 | </h3>
|
---|
| 365 | Ensures that page <em>w</em> is shown. This is useful mainly for
|
---|
| 366 | accelerators.
|
---|
| 367 | <p> <b>Warning:</b> Used carelessly, this function can easily surprise or
|
---|
| 368 | confuse the user.
|
---|
| 369 | <p> <p>See also <a href="qtabbar.html#currentTab-prop">QTabBar::currentTab</a>.
|
---|
| 370 |
|
---|
| 371 | <h3 class=fn><a href="qtabbar.html">QTabBar</a> * <a name="tabBar"></a>QTabWidget::tabBar () const<tt> [protected]</tt>
|
---|
| 372 | </h3>
|
---|
| 373 | Returns the current <a href="qtabbar.html">QTabBar</a>.
|
---|
| 374 | <p> <p>See also <a href="#setTabBar">setTabBar</a>().
|
---|
| 375 |
|
---|
| 376 | <h3 class=fn><a href="qiconset.html">QIconSet</a> <a name="tabIconSet"></a>QTabWidget::tabIconSet ( <a href="qwidget.html">QWidget</a> * w ) const
|
---|
| 377 | </h3>
|
---|
| 378 | Returns the iconset of page <em>w</em> or a <a href="qiconset.html#QIconSet">null iconset</a> if <em>w</em> is not a tab page or does not have an
|
---|
| 379 | iconset.
|
---|
| 380 |
|
---|
| 381 | <h3 class=fn><a href="qstring.html">QString</a> <a name="tabLabel"></a>QTabWidget::tabLabel ( <a href="qwidget.html">QWidget</a> * w ) const
|
---|
| 382 | </h3>
|
---|
| 383 | Returns the label text for the tab on page <em>w</em>.
|
---|
| 384 |
|
---|
| 385 | <h3 class=fn><a href="qtabwidget.html#TabPosition-enum">TabPosition</a> <a name="tabPosition"></a>QTabWidget::tabPosition () const
|
---|
| 386 | </h3><p>Returns the position of the tabs in this tab widget.
|
---|
| 387 | See the <a href="qtabwidget.html#tabPosition-prop">"tabPosition"</a> property for details.
|
---|
| 388 | <h3 class=fn><a href="qtabwidget.html#TabShape-enum">TabShape</a> <a name="tabShape"></a>QTabWidget::tabShape () const
|
---|
| 389 | </h3><p>Returns the shape of the tabs in this tab widget.
|
---|
| 390 | See the <a href="qtabwidget.html#tabShape-prop">"tabShape"</a> property for details.
|
---|
| 391 | <h3 class=fn><a href="qstring.html">QString</a> <a name="tabToolTip"></a>QTabWidget::tabToolTip ( <a href="qwidget.html">QWidget</a> * w ) const
|
---|
| 392 | </h3>
|
---|
| 393 | Returns the tab tool tip for page <em>w</em> or <a href="qstring.html#QString-null">QString::null</a> if no tool
|
---|
| 394 | tip has been set.
|
---|
| 395 | <p> <p>See also <a href="#setTabToolTip">setTabToolTip</a>() and <a href="#removeTabToolTip">removeTabToolTip</a>().
|
---|
| 396 |
|
---|
| 397 | <hr><h2>Property Documentation</h2>
|
---|
| 398 | <h3 class=fn>bool <a name="autoMask-prop"></a>autoMask</h3>
|
---|
| 399 | <p>This property holds whether the tab widget is automatically masked.
|
---|
| 400 | <p><p><p>See also <a href="qwidget.html#autoMask-prop">QWidget::autoMask</a>.
|
---|
| 401 |
|
---|
| 402 | <h3 class=fn>int <a name="count-prop"></a>count</h3>
|
---|
| 403 | <p>This property holds the number of tabs in the tab bar.
|
---|
| 404 | <p>
|
---|
| 405 | <p>Get this property's value with <a href="#count">count</a>().
|
---|
| 406 | <h3 class=fn>int <a name="currentPage-prop"></a>currentPage</h3>
|
---|
| 407 | <p>This property holds the index position of the current tab page.
|
---|
| 408 | <p>Set this property's value with <a href="#setCurrentPage">setCurrentPage</a>() and get this property's value with <a href="#currentPageIndex">currentPageIndex</a>().
|
---|
| 409 | <p><p>See also <a href="qtabbar.html#currentTab-prop">QTabBar::currentTab</a>.
|
---|
| 410 |
|
---|
| 411 | <h3 class=fn>int <a name="margin-prop"></a>margin</h3>
|
---|
| 412 | <p>This property holds the margin in this tab widget.
|
---|
| 413 | <p>The margin is the distance between the innermost pixel of the
|
---|
| 414 | frame and the outermost pixel of the pages.
|
---|
| 415 |
|
---|
| 416 | <p>Set this property's value with <a href="#setMargin">setMargin</a>() and get this property's value with <a href="#margin">margin</a>().
|
---|
| 417 | <h3 class=fn><a href="qtabwidget.html#TabPosition-enum">TabPosition</a> <a name="tabPosition-prop"></a>tabPosition</h3>
|
---|
| 418 | <p>This property holds the position of the tabs in this tab widget.
|
---|
| 419 | <p>Possible values for this property are <a href="#TabPosition-enum">QTabWidget::Top</a> and <a href="#TabPosition-enum">QTabWidget::Bottom</a>.
|
---|
| 420 | <p> <p>See also <a href="#TabPosition-enum">TabPosition</a>.
|
---|
| 421 |
|
---|
| 422 | <p>Set this property's value with <a href="#setTabPosition">setTabPosition</a>() and get this property's value with <a href="#tabPosition">tabPosition</a>().
|
---|
| 423 | <h3 class=fn><a href="qtabwidget.html#TabShape-enum">TabShape</a> <a name="tabShape-prop"></a>tabShape</h3>
|
---|
| 424 | <p>This property holds the shape of the tabs in this tab widget.
|
---|
| 425 | <p>Possible values for this property are <a href="#TabShape-enum">QTabWidget::Rounded</a>
|
---|
| 426 | (default) or <a href="#TabShape-enum">QTabWidget::Triangular</a>.
|
---|
| 427 | <p> <p>See also <a href="#TabShape-enum">TabShape</a>.
|
---|
| 428 |
|
---|
| 429 | <p>Set this property's value with <a href="#setTabShape">setTabShape</a>() and get this property's value with <a href="#tabShape">tabShape</a>().
|
---|
| 430 | <!-- eof -->
|
---|
| 431 | <hr><p>
|
---|
| 432 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 433 | Copyright © 1995-2007
|
---|
| 434 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 435 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 436 | <td>Copyright © 2007
|
---|
| 437 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 438 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 439 | </table></div></address></body>
|
---|
| 440 | </html>
|
---|