Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 4146

qtbase5-doc-5.12.6-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qtabwidget.cpp -->
  <title>QTabWidget Class | Qt Widgets 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QTabWidget</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QTabWidget Class</h1>
<!-- $$$QTabWidget-brief -->
<p>The <a href="qtabwidget.html">QTabWidget</a> class provides a stack of tabbed widgets. <a href="#details">More...</a></p>
<!-- @@@QTabWidget -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QTabWidget&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qwidget.html">QWidget</a></td></tr></table></div><ul>
<li><a href="qtabwidget-members.html">List of all members, including inherited members</a></li>
<li><a href="qtabwidget-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#TabPosition-enum">TabPosition</a></b> { North, South, West, East }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#TabShape-enum">TabShape</a></b> { Rounded, Triangular }</td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<div class="table"><table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qtabwidget.html#count-prop">count</a></b> : const int</li>
<li class="fn"><b><a href="qtabwidget.html#currentIndex-prop">currentIndex</a></b> : int</li>
<li class="fn"><b><a href="qtabwidget.html#documentMode-prop">documentMode</a></b> : bool</li>
<li class="fn"><b><a href="qtabwidget.html#elideMode-prop">elideMode</a></b> : Qt::TextElideMode</li>
<li class="fn"><b><a href="qtabwidget.html#iconSize-prop">iconSize</a></b> : QSize</li>
<li class="fn"><b><a href="qtabwidget.html#movable-prop">movable</a></b> : bool</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qtabwidget.html#tabBarAutoHide-prop">tabBarAutoHide</a></b> : bool</li>
<li class="fn"><b><a href="qtabwidget.html#tabPosition-prop">tabPosition</a></b> : TabPosition</li>
<li class="fn"><b><a href="qtabwidget.html#tabShape-prop">tabShape</a></b> : TabShape</li>
<li class="fn"><b><a href="qtabwidget.html#tabsClosable-prop">tabsClosable</a></b> : bool</li>
<li class="fn"><b><a href="qtabwidget.html#usesScrollButtons-prop">usesScrollButtons</a></b> : bool</li>
</ul>
</td></tr>
</table></div>
<ul>
<li class="fn">59 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#QTabWidget">QTabWidget</a></b>(QWidget *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#dtor.QTabWidget">~QTabWidget</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#addTab">addTab</a></b>(QWidget *<i>page</i>, const QString &amp;<i>label</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#addTab-1">addTab</a></b>(QWidget *<i>page</i>, const QIcon &amp;<i>icon</i>, const QString &amp;<i>label</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#clear">clear</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget *</td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#cornerWidget">cornerWidget</a></b>(Qt::Corner <i>corner</i> = Qt::TopRightCorner) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#count-prop">count</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#currentIndex-prop">currentIndex</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget *</td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#currentWidget">currentWidget</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#documentMode-prop">documentMode</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::TextElideMode </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#elideMode-prop">elideMode</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSize </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#iconSize-prop">iconSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#indexOf">indexOf</a></b>(QWidget *<i>w</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#insertTab">insertTab</a></b>(int <i>index</i>, QWidget *<i>page</i>, const QString &amp;<i>label</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#insertTab-1">insertTab</a></b>(int <i>index</i>, QWidget *<i>page</i>, const QIcon &amp;<i>icon</i>, const QString &amp;<i>label</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#movable-prop">isMovable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#isTabEnabled">isTabEnabled</a></b>(int <i>index</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#removeTab">removeTab</a></b>(int <i>index</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#setCornerWidget">setCornerWidget</a></b>(QWidget *<i>widget</i>, Qt::Corner <i>corner</i> = Qt::TopRightCorner)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#documentMode-prop">setDocumentMode</a></b>(bool <i>set</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#elideMode-prop">setElideMode</a></b>(<i>Qt::TextElideMode</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#iconSize-prop">setIconSize</a></b>(const QSize &amp;<i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#movable-prop">setMovable</a></b>(bool <i>movable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabBarAutoHide-prop">setTabBarAutoHide</a></b>(bool <i>enabled</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#setTabEnabled">setTabEnabled</a></b>(int <i>index</i>, bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#setTabIcon">setTabIcon</a></b>(int <i>index</i>, const QIcon &amp;<i>icon</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabPosition-prop">setTabPosition</a></b>(<i>QTabWidget::TabPosition</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabShape-prop">setTabShape</a></b>(QTabWidget::TabShape <i>s</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#setTabText">setTabText</a></b>(int <i>index</i>, const QString &amp;<i>label</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#setTabToolTip">setTabToolTip</a></b>(int <i>index</i>, const QString &amp;<i>tip</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#setTabWhatsThis">setTabWhatsThis</a></b>(int <i>index</i>, const QString &amp;<i>text</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabsClosable-prop">setTabsClosable</a></b>(bool <i>closeable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#usesScrollButtons-prop">setUsesScrollButtons</a></b>(bool <i>useButtons</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTabBar *</td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabBar">tabBar</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabBarAutoHide-prop">tabBarAutoHide</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QIcon </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabIcon">tabIcon</a></b>(int <i>index</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTabWidget::TabPosition </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabPosition-prop">tabPosition</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTabWidget::TabShape </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabShape-prop">tabShape</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabText">tabText</a></b>(int <i>index</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabToolTip">tabToolTip</a></b>(int <i>index</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabWhatsThis">tabWhatsThis</a></b>(int <i>index</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabsClosable-prop">tabsClosable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#usesScrollButtons-prop">usesScrollButtons</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget *</td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#widget">widget</a></b>(int <i>index</i>) const</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#hasHeightForWidth">hasHeightForWidth</a></b>() const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#heightForWidth">heightForWidth</a></b>(int <i>width</i>) const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#minimumSizeHint">minimumSizeHint</a></b>() const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#sizeHint">sizeHint</a></b>() const override</td></tr>
</table></div>
<ul>
<li class="fn">214 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
<li class="fn">14 public functions inherited from <a href="../qtgui/qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#currentIndex-prop">setCurrentIndex</a></b>(int <i>index</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#setCurrentWidget">setCurrentWidget</a></b>(QWidget *<i>widget</i>)</td></tr>
</table></div>
<ul>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#currentChanged">currentChanged</a></b>(int <i>index</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabBarClicked">tabBarClicked</a></b>(int <i>index</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabBarDoubleClicked">tabBarDoubleClicked</a></b>(int <i>index</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabCloseRequested">tabCloseRequested</a></b>(int <i>index</i>)</td></tr>
</table></div>
<ul>
<li class="fn">3 signals inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<ul>
<li class="fn">5 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2 id="protected-functions">Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#initStyleOption">initStyleOption</a></b>(QStyleOptionTabWidgetFrame *<i>option</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#setTabBar">setTabBar</a></b>(QTabBar *<i>tb</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabInserted">tabInserted</a></b>(int <i>index</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#tabRemoved">tabRemoved</a></b>(int <i>index</i>)</td></tr>
</table></div>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#changeEvent">changeEvent</a></b>(QEvent *<i>ev</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#event">event</a></b>(QEvent *<i>ev</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#keyPressEvent">keyPressEvent</a></b>(QKeyEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#paintEvent">paintEvent</a></b>(QPaintEvent *<i>event</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#resizeEvent">resizeEvent</a></b>(QResizeEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtabwidget.html#showEvent">showEvent</a></b>(<i>QShowEvent *</i>) override</td></tr>
</table></div>
<ul>
<li class="fn">35 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="../qtgui/qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QTabWidget-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qtabwidget.html">QTabWidget</a> class provides a stack of tabbed widgets.</p>
<p class="centerAlign"><img src="images/windows-tabwidget.png" alt="" /></p><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>
<p>The normal way to use <a href="qtabwidget.html">QTabWidget</a> is to do the following:</p>
<ol class="1" type="1"><li>Create a <a href="qtabwidget.html">QTabWidget</a>.</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 <a href="qtabwidget.html">QTabWidget</a> 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>
</div>
<p><b>See also </b><a href="qtabbar.html">QTabBar</a>, <a href="qstackedwidget.html">QStackedWidget</a>, <a href="qtoolbox.html">QToolBox</a>, and <a href="qtwidgets-dialogs-tabdialog-example.html">Tab Dialog Example</a>.</p>
<!-- @@@QTabWidget -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$TabPosition$$$North$$$South$$$West$$$East -->
<h3 class="fn" id="TabPosition-enum"><a name="TabPosition-enum"></a>enum QTabWidget::<span class="name">TabPosition</span></h3>
<p>This enum type defines where <a href="qtabwidget.html">QTabWidget</a> draws the tab row:</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QTabWidget::North</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The tabs are drawn above the pages.</td></tr>
<tr><td class="topAlign"><code>QTabWidget::South</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The tabs are drawn below the pages.</td></tr>
<tr><td class="topAlign"><code>QTabWidget::West</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The tabs are drawn to the left of the pages.</td></tr>
<tr><td class="topAlign"><code>QTabWidget::East</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">The tabs are drawn to the right of the pages.</td></tr>
</table></div>
<!-- @@@TabPosition -->
<!-- $$$TabShape$$$Rounded$$$Triangular -->
<h3 class="fn" id="TabShape-enum"><a name="TabShape-enum"></a>enum QTabWidget::<span class="name">TabShape</span></h3>
<p>This enum type defines the shape of the tabs:</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QTabWidget::Rounded</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The tabs are drawn with a rounded look. This is the default shape.</td></tr>
<tr><td class="topAlign"><code>QTabWidget::Triangular</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The tabs are drawn with a triangular look.</td></tr>
</table></div>
<!-- @@@TabShape -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$count-prop$$$count -->
<h3 class="fn" id="count-prop"><a name="count-prop"></a><span class="name">count</span> : const <span class="type">int</span></h3>
<p>This property holds the number of tabs in the tab bar</p>
<p>By default, this property contains a value of 0.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>count</b></span>() const</td></tr>
</table></div>
<!-- @@@count -->
<!-- $$$currentIndex-prop$$$currentIndex$$$setCurrentIndexint$$$currentChangedint -->
<h3 class="fn" id="currentIndex-prop"><a name="currentIndex-prop"></a><span class="name">currentIndex</span> : <span class="type">int</span></h3>
<p>This property holds the index position of the current tab page</p>
<p>The current index is -1 if there is no current widget.</p>
<p>By default, this property contains a value of -1 because there are initially no tabs in the widget.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>currentIndex</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCurrentIndex</b></span>(int <i>index</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qtabwidget.html#currentChanged">currentChanged</a></b></span>(int <i>index</i>)</td></tr>
</table></div>
<!-- @@@currentIndex -->
<!-- $$$documentMode-prop$$$documentMode$$$setDocumentModebool -->
<h3 class="fn" id="documentMode-prop"><a name="documentMode-prop"></a><span class="name">documentMode</span> : <span class="type">bool</span></h3>
<p>This property holds whether or not the tab widget is rendered in a mode suitable for document pages. This is the same as document mode on macOS.</p>
<p>When this property is set the tab widget frame is not rendered. This mode is useful for showing document-type pages where the page covers most of the tab widget area.</p>
<p>This property was introduced in  Qt 4.5.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>documentMode</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDocumentMode</b></span>(bool <i>set</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qtabwidget.html#elideMode-prop">elideMode</a>, <a href="qtabbar.html#documentMode-prop">QTabBar::documentMode</a>, <a href="qtabbar.html#usesScrollButtons-prop">QTabBar::usesScrollButtons</a>, and <a href="qstyle.html#StyleHint-enum">QStyle::SH_TabBar_PreferNoArrows</a>.</p>
<!-- @@@documentMode -->
<!-- $$$elideMode-prop$$$elideMode$$$setElideModeQt::TextElideMode -->
<h3 class="fn" id="elideMode-prop"><a name="elideMode-prop"></a><span class="name">elideMode</span> : <span class="type"><a href="../qtcore/qt.html#TextElideMode-enum">Qt::TextElideMode</a></span></h3>
<p>how to elide text in the tab bar</p>
<p>This property controls how items are elided when there is not enough space to show them for a given tab bar size.</p>
<p>By default the value is style dependant.</p>
<p>This property was introduced in  Qt 4.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::TextElideMode </td><td class="memItemRight bottomAlign"><span class="name"><b>elideMode</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setElideMode</b></span>(<i>Qt::TextElideMode</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qtabbar.html#elideMode-prop">QTabBar::elideMode</a>, <a href="qtabwidget.html#usesScrollButtons-prop">usesScrollButtons</a>, and <a href="qstyle.html#StyleHint-enum">QStyle::SH_TabBar_ElideMode</a>.</p>
<!-- @@@elideMode -->
<!-- $$$iconSize-prop$$$iconSize$$$setIconSizeconstQSize& -->
<h3 class="fn" id="iconSize-prop"><a name="iconSize-prop"></a><span class="name">iconSize</span> : <span class="type"><a href="../qtcore/qsize.html">QSize</a></span></h3>
<p>This property holds the size for icons in the tab bar</p>
<p>The default value is style-dependent. This is the maximum size that the icons will have. Icons are not scaled up if they are of smaller size.</p>
<p>This property was introduced in  Qt 4.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QSize </td><td class="memItemRight bottomAlign"><span class="name"><b>iconSize</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setIconSize</b></span>(const QSize &amp;<i>size</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qtabbar.html#iconSize-prop">QTabBar::iconSize</a>.</p>
<!-- @@@iconSize -->
<!-- $$$movable-prop$$$isMovable$$$setMovablebool -->
<h3 class="fn" id="movable-prop"><a name="movable-prop"></a><span class="name">movable</span> : <span class="type">bool</span></h3>
<p>This property holds whether the user can move the tabs within the tabbar area.</p>
<p>By default, this property is <code>false</code>;</p>
<p>This property was introduced in  Qt 4.5.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isMovable</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMovable</b></span>(bool <i>movable</i>)</td></tr>
</table></div>
<!-- @@@movable -->
<!-- $$$tabBarAutoHide-prop$$$tabBarAutoHide$$$setTabBarAutoHidebool -->
<h3 class="fn" id="tabBarAutoHide-prop"><a name="tabBarAutoHide-prop"></a><span class="name">tabBarAutoHide</span> : <span class="type">bool</span></h3>
<p>If true, the tab bar is automatically hidden when it contains less than 2 tabs.</p>
<p>By default, this property is false.</p>
<p>This property was introduced in  Qt 5.4.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>tabBarAutoHide</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTabBarAutoHide</b></span>(bool <i>enabled</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qwidget.html#visible-prop">QWidget::visible</a>.</p>
<!-- @@@tabBarAutoHide -->
<!-- $$$tabPosition-prop$$$tabPosition$$$setTabPositionQTabWidget::TabPosition -->
<h3 class="fn" id="tabPosition-prop"><a name="tabPosition-prop"></a><span class="name">tabPosition</span> : <span class="type"><a href="qtabwidget.html#TabPosition-enum">TabPosition</a></span></h3>
<p>This property holds the position of the tabs in this tab widget</p>
<p>Possible values for this property are described by the <a href="qtabwidget.html#TabPosition-enum">TabPosition</a> enum.</p>
<p>By default, this property is set to <a href="qtabwidget.html#TabPosition-enum">North</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QTabWidget::TabPosition </td><td class="memItemRight bottomAlign"><span class="name"><b>tabPosition</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTabPosition</b></span>(<i>QTabWidget::TabPosition</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qtabwidget.html#TabPosition-enum">TabPosition</a>.</p>
<!-- @@@tabPosition -->
<!-- $$$tabShape-prop$$$tabShape$$$setTabShapeQTabWidget::TabShape -->
<h3 class="fn" id="tabShape-prop"><a name="tabShape-prop"></a><span class="name">tabShape</span> : <span class="type"><a href="qtabwidget.html#TabShape-enum">TabShape</a></span></h3>
<p>This property holds the shape of the tabs in this tab widget</p>
<p>Possible values for this property are <a href="qtabwidget.html#TabShape-enum">QTabWidget::Rounded</a> (default) or <a href="qtabwidget.html#TabShape-enum">QTabWidget::Triangular</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QTabWidget::TabShape </td><td class="memItemRight bottomAlign"><span class="name"><b>tabShape</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTabShape</b></span>(QTabWidget::TabShape <i>s</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qtabwidget.html#TabShape-enum">TabShape</a>.</p>
<!-- @@@tabShape -->
<!-- $$$tabsClosable-prop$$$tabsClosable$$$setTabsClosablebool -->
<h3 class="fn" id="tabsClosable-prop"><a name="tabsClosable-prop"></a><span class="name">tabsClosable</span> : <span class="type">bool</span></h3>
<p>This property holds whether close buttons are automatically added to each tab.</p>
<p>This property was introduced in  Qt 4.5.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>tabsClosable</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTabsClosable</b></span>(bool <i>closeable</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qtabbar.html#tabsClosable-prop">QTabBar::tabsClosable</a>().</p>
<!-- @@@tabsClosable -->
<!-- $$$usesScrollButtons-prop$$$usesScrollButtons$$$setUsesScrollButtonsbool -->
<h3 class="fn" id="usesScrollButtons-prop"><a name="usesScrollButtons-prop"></a><span class="name">usesScrollButtons</span> : <span class="type">bool</span></h3>
<p>This property holds whether or not a tab bar should use buttons to scroll tabs when it has many tabs.</p>
<p>When there are too many tabs in a tab bar for its size, the tab bar can either choose to expand its size or to add buttons that allow you to scroll through the tabs.</p>
<p>By default the value is style dependant.</p>
<p>This property was introduced in  Qt 4.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>usesScrollButtons</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setUsesScrollButtons</b></span>(bool <i>useButtons</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qtabwidget.html#elideMode-prop">elideMode</a>, <a href="qtabbar.html#usesScrollButtons-prop">QTabBar::usesScrollButtons</a>, and <a href="qstyle.html#StyleHint-enum">QStyle::SH_TabBar_PreferNoArrows</a>.</p>
<!-- @@@usesScrollButtons -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QTabWidget[overload1]$$$QTabWidgetQWidget* -->
<h3 class="fn" id="QTabWidget"><a name="QTabWidget"></a>QTabWidget::<span class="name">QTabWidget</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a tabbed widget with parent <i>parent</i>.</p>
<!-- @@@QTabWidget -->
<!-- $$$~QTabWidget[overload1]$$$~QTabWidget -->
<h3 class="fn" id="dtor.QTabWidget"><a name="dtor.QTabWidget"></a><code>[virtual] </code>QTabWidget::<span class="name">~QTabWidget</span>()</h3>
<p>Destroys the tabbed widget.</p>
<!-- @@@~QTabWidget -->
<!-- $$$addTab[overload1]$$$addTabQWidget*constQString& -->
<h3 class="fn" id="addTab"><a name="addTab"></a><span class="type">int</span> QTabWidget::<span class="name">addTab</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>page</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>label</i>)</h3>
<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. Ownership of <i>page</i> is passed on to the <a href="qtabwidget.html">QTabWidget</a>.</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&#x2e; if the label is &quot;Bro&amp;wse&quot; 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><b>See also </b><a href="qtabwidget.html#insertTab">insertTab</a>().</p>
<!-- @@@addTab -->
<!-- $$$addTab$$$addTabQWidget*constQIcon&constQString& -->
<h3 class="fn" id="addTab-1"><a name="addTab-1"></a><span class="type">int</span> QTabWidget::<span class="name">addTab</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>page</i>, const <span class="type"><a href="../qtgui/qicon.html">QIcon</a></span> &amp;<i>icon</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>label</i>)</h3>
<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. Ownership of <i>page</i> is passed on to the <a href="qtabwidget.html">QTabWidget</a>.</p>
<p>This function is the same as <a href="qtabwidget.html#addTab">addTab</a>(), but with an additional <i>icon</i>.</p>
<!-- @@@addTab -->
<!-- $$$changeEvent[overload1]$$$changeEventQEvent* -->
<h3 class="fn" id="changeEvent"><a name="changeEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTabWidget::<span class="name">changeEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>ev</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget::changeEvent</a>().</p>
<!-- @@@changeEvent -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn" id="clear"><a name="clear"></a><span class="type">void</span> QTabWidget::<span class="name">clear</span>()</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>
<!-- @@@clear -->
<!-- $$$cornerWidget[overload1]$$$cornerWidgetQt::Corner -->
<h3 class="fn" id="cornerWidget"><a name="cornerWidget"></a><span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *QTabWidget::<span class="name">cornerWidget</span>(<span class="type"><a href="../qtcore/qt.html#Corner-enum">Qt::Corner</a></span> <i>corner</i> = Qt::TopRightCorner) const</h3>
<p>Returns the widget shown in the <i>corner</i> of the tab widget or 0.</p>
<p><b>See also </b><a href="qtabwidget.html#setCornerWidget">setCornerWidget</a>().</p>
<!-- @@@cornerWidget -->
<!-- $$$currentChanged -->
<h3 class="fn" id="currentChanged"><a name="currentChanged"></a><code>[signal] </code><span class="type">void</span> QTabWidget::<span class="name">currentChanged</span>(<span class="type">int</span> <i>index</i>)</h3>
<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><b>Note:</b> Notifier signal for property <a href="qtabwidget.html#currentIndex-prop">currentIndex</a>. </p><p><b>See also </b><a href="qtabwidget.html#currentWidget">currentWidget</a>() and <a href="qtabwidget.html#currentIndex-prop">currentIndex</a>.</p>
<!-- @@@currentChanged -->
<!-- $$$currentWidget[overload1]$$$currentWidget -->
<h3 class="fn" id="currentWidget"><a name="currentWidget"></a><span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *QTabWidget::<span class="name">currentWidget</span>() const</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><b>See also </b><a href="qtabwidget.html#currentIndex-prop">currentIndex</a>() and <a href="qtabwidget.html#setCurrentWidget">setCurrentWidget</a>().</p>
<!-- @@@currentWidget -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn" id="event"><a name="event"></a><code>[override virtual protected] </code><span class="type">bool</span> QTabWidget::<span class="name">event</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>ev</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#event">QWidget::event</a>().</p>
<!-- @@@event -->
<!-- $$$hasHeightForWidth[overload1]$$$hasHeightForWidth -->
<h3 class="fn" id="hasHeightForWidth"><a name="hasHeightForWidth"></a><code>[override virtual] </code><span class="type">bool</span> QTabWidget::<span class="name">hasHeightForWidth</span>() const</h3>
<p>Reimplemented from <a href="qwidget.html#hasHeightForWidth">QWidget::hasHeightForWidth</a>().</p>
<!-- @@@hasHeightForWidth -->
<!-- $$$heightForWidth[overload1]$$$heightForWidthint -->
<h3 class="fn" id="heightForWidth"><a name="heightForWidth"></a><code>[override virtual] </code><span class="type">int</span> QTabWidget::<span class="name">heightForWidth</span>(<span class="type">int</span> <i>width</i>) const</h3>
<p>Reimplemented from <a href="qwidget.html#heightForWidth">QWidget::heightForWidth</a>().</p>
<!-- @@@heightForWidth -->
<!-- $$$indexOf[overload1]$$$indexOfQWidget* -->
<h3 class="fn" id="indexOf"><a name="indexOf"></a><span class="type">int</span> QTabWidget::<span class="name">indexOf</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>w</i>) const</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>
<!-- @@@indexOf -->
<!-- $$$initStyleOption[overload1]$$$initStyleOptionQStyleOptionTabWidgetFrame* -->
<h3 class="fn" id="initStyleOption"><a name="initStyleOption"></a><code>[protected] </code><span class="type">void</span> QTabWidget::<span class="name">initStyleOption</span>(<span class="type"><a href="qstyleoptiontabwidgetframe.html">QStyleOptionTabWidgetFrame</a></span> *<i>option</i>) const</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><b>See also </b><a href="qstyleoption.html#initFrom">QStyleOption::initFrom</a>() and <a href="qtabbar.html#initStyleOption">QTabBar::initStyleOption</a>().</p>
<!-- @@@initStyleOption -->
<!-- $$$insertTab[overload1]$$$insertTabintQWidget*constQString& -->
<h3 class="fn" id="insertTab"><a name="insertTab"></a><span class="type">int</span> QTabWidget::<span class="name">insertTab</span>(<span class="type">int</span> <i>index</i>, <span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>page</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>label</i>)</h3>
<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. Ownership of <i>page</i> is passed on to the <a href="qtabwidget.html">QTabWidget</a>.</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&#x2e; if the label is &quot;Bro&amp;wse&quot; 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><b>See also </b><a href="qtabwidget.html#addTab">addTab</a>().</p>
<!-- @@@insertTab -->
<!-- $$$insertTab$$$insertTabintQWidget*constQIcon&constQString& -->
<h3 class="fn" id="insertTab-1"><a name="insertTab-1"></a><span class="type">int</span> QTabWidget::<span class="name">insertTab</span>(<span class="type">int</span> <i>index</i>, <span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>page</i>, const <span class="type"><a href="../qtgui/qicon.html">QIcon</a></span> &amp;<i>icon</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>label</i>)</h3>
<p>This is an overloaded function.</p>
<p>Inserts a tab with the given <i>label</i>, <i>page</i>, and <i>icon</i> into the tab widget at the specified <i>index</i>, and returns the index of the inserted tab in the tab bar. Ownership of <i>page</i> is passed on to the <a href="qtabwidget.html">QTabWidget</a>.</p>
<p>This function is the same as <a href="qtabwidget.html#insertTab">insertTab</a>(), but with an additional <i>icon</i>.</p>
<!-- @@@insertTab -->
<!-- $$$isTabEnabled[overload1]$$$isTabEnabledint -->
<h3 class="fn" id="isTabEnabled"><a name="isTabEnabled"></a><span class="type">bool</span> QTabWidget::<span class="name">isTabEnabled</span>(<span class="type">int</span> <i>index</i>) const</h3>
<p>Returns <code>true</code> if the page at position <i>index</i> is enabled; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qtabwidget.html#setTabEnabled">setTabEnabled</a>() and <a href="qwidget.html#enabled-prop">QWidget::isEnabled</a>().</p>
<!-- @@@isTabEnabled -->
<!-- $$$keyPressEvent[overload1]$$$keyPressEventQKeyEvent* -->
<h3 class="fn" id="keyPressEvent"><a name="keyPressEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTabWidget::<span class="name">keyPressEvent</span>(<span class="type"><a href="../qtgui/qkeyevent.html">QKeyEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget::keyPressEvent</a>().</p>
<!-- @@@keyPressEvent -->
<!-- $$$minimumSizeHint[overload1]$$$minimumSizeHint -->
<h3 class="fn" id="minimumSizeHint"><a name="minimumSizeHint"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QTabWidget::<span class="name">minimumSizeHint</span>() const</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>
<!-- @@@minimumSizeHint -->
<!-- $$$paintEvent[overload1]$$$paintEventQPaintEvent* -->
<h3 class="fn" id="paintEvent"><a name="paintEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTabWidget::<span class="name">paintEvent</span>(<span class="type"><a href="../qtgui/qpaintevent.html">QPaintEvent</a></span> *<i>event</i>)</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>
<!-- @@@paintEvent -->
<!-- $$$removeTab[overload1]$$$removeTabint -->
<h3 class="fn" id="removeTab"><a name="removeTab"></a><span class="type">void</span> QTabWidget::<span class="name">removeTab</span>(<span class="type">int</span> <i>index</i>)</h3>
<p>Removes the tab at position <i>index</i> from this stack of widgets. The page widget itself is not deleted.</p>
<p><b>See also </b><a href="qtabwidget.html#addTab">addTab</a>() and <a href="qtabwidget.html#insertTab">insertTab</a>().</p>
<!-- @@@removeTab -->
<!-- $$$resizeEvent[overload1]$$$resizeEventQResizeEvent* -->
<h3 class="fn" id="resizeEvent"><a name="resizeEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTabWidget::<span class="name">resizeEvent</span>(<span class="type"><a href="../qtgui/qresizeevent.html">QResizeEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget::resizeEvent</a>().</p>
<!-- @@@resizeEvent -->
<!-- $$$setCornerWidget[overload1]$$$setCornerWidgetQWidget*Qt::Corner -->
<h3 class="fn" id="setCornerWidget"><a name="setCornerWidget"></a><span class="type">void</span> QTabWidget::<span class="name">setCornerWidget</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>widget</i>, <span class="type"><a href="../qtcore/qt.html#Corner-enum">Qt::Corner</a></span> <i>corner</i> = Qt::TopRightCorner)</h3>
<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><b>See also </b><a href="qtabwidget.html#cornerWidget">cornerWidget</a>() and <a href="qtabwidget.html#tabPosition-prop">setTabPosition</a>().</p>
<!-- @@@setCornerWidget -->
<!-- $$$setCurrentWidget[overload1]$$$setCurrentWidgetQWidget* -->
<h3 class="fn" id="setCurrentWidget"><a name="setCurrentWidget"></a><code>[slot] </code><span class="type">void</span> QTabWidget::<span class="name">setCurrentWidget</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>widget</i>)</h3>
<p>Makes <i>widget</i> the current widget. The <i>widget</i> used must be a page in this tab widget.</p>
<p><b>See also </b><a href="qtabwidget.html#addTab">addTab</a>(), <a href="qtabwidget.html#currentIndex-prop">setCurrentIndex</a>(), and <a href="qtabwidget.html#currentWidget">currentWidget</a>().</p>
<!-- @@@setCurrentWidget -->
<!-- $$$setTabBar[overload1]$$$setTabBarQTabBar* -->
<h3 class="fn" id="setTabBar"><a name="setTabBar"></a><code>[protected] </code><span class="type">void</span> QTabWidget::<span class="name">setTabBar</span>(<span class="type"><a href="qtabbar.html">QTabBar</a></span> *<i>tb</i>)</h3>
<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><b>See also </b><a href="qtabwidget.html#tabBar">tabBar</a>().</p>
<!-- @@@setTabBar -->
<!-- $$$setTabEnabled[overload1]$$$setTabEnabledintbool -->
<h3 class="fn" id="setTabEnabled"><a name="setTabEnabled"></a><span class="type">void</span> QTabWidget::<span class="name">setTabEnabled</span>(<span class="type">int</span> <i>index</i>, <span class="type">bool</span> <i>enable</i>)</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><b>See also </b><a href="qtabwidget.html#isTabEnabled">isTabEnabled</a>() and <a href="qwidget.html#enabled-prop">QWidget::setEnabled</a>().</p>
<!-- @@@setTabEnabled -->
<!-- $$$setTabIcon[overload1]$$$setTabIconintconstQIcon& -->
<h3 class="fn" id="setTabIcon"><a name="setTabIcon"></a><span class="type">void</span> QTabWidget::<span class="name">setTabIcon</span>(<span class="type">int</span> <i>index</i>, const <span class="type"><a href="../qtgui/qicon.html">QIcon</a></span> &amp;<i>icon</i>)</h3>
<p>Sets the <i>icon</i> for the tab at position <i>index</i>.</p>
<p><b>See also </b><a href="qtabwidget.html#tabIcon">tabIcon</a>().</p>
<!-- @@@setTabIcon -->
<!-- $$$setTabText[overload1]$$$setTabTextintconstQString& -->
<h3 class="fn" id="setTabText"><a name="setTabText"></a><span class="type">void</span> QTabWidget::<span class="name">setTabText</span>(<span class="type">int</span> <i>index</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>label</i>)</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><b>See also </b><a href="qtabwidget.html#tabText">tabText</a>().</p>
<!-- @@@setTabText -->
<!-- $$$setTabToolTip[overload1]$$$setTabToolTipintconstQString& -->
<h3 class="fn" id="setTabToolTip"><a name="setTabToolTip"></a><span class="type">void</span> QTabWidget::<span class="name">setTabToolTip</span>(<span class="type">int</span> <i>index</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>tip</i>)</h3>
<p>Sets the tab tool tip for the page at position <i>index</i> to <i>tip</i>.</p>
<p><b>See also </b><a href="qtabwidget.html#tabToolTip">tabToolTip</a>().</p>
<!-- @@@setTabToolTip -->
<!-- $$$setTabWhatsThis[overload1]$$$setTabWhatsThisintconstQString& -->
<h3 class="fn" id="setTabWhatsThis"><a name="setTabWhatsThis"></a><span class="type">void</span> QTabWidget::<span class="name">setTabWhatsThis</span>(<span class="type">int</span> <i>index</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>)</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><b>See also </b><a href="qtabwidget.html#tabWhatsThis">tabWhatsThis</a>().</p>
<!-- @@@setTabWhatsThis -->
<!-- $$$showEvent[overload1]$$$showEventQShowEvent* -->
<h3 class="fn" id="showEvent"><a name="showEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTabWidget::<span class="name">showEvent</span>(<i>QShowEvent *</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#showEvent">QWidget::showEvent</a>().</p>
<!-- @@@showEvent -->
<!-- $$$sizeHint[overload1]$$$sizeHint -->
<h3 class="fn" id="sizeHint"><a name="sizeHint"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QTabWidget::<span class="name">sizeHint</span>() const</h3>
<p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>().</p>
<!-- @@@sizeHint -->
<!-- $$$tabBar[overload1]$$$tabBar -->
<h3 class="fn" id="tabBar"><a name="tabBar"></a><span class="type"><a href="qtabbar.html">QTabBar</a></span> *QTabWidget::<span class="name">tabBar</span>() const</h3>
<p>Returns the current <a href="qtabbar.html">QTabBar</a>.</p>
<p><b>See also </b><a href="qtabwidget.html#setTabBar">setTabBar</a>().</p>
<!-- @@@tabBar -->
<!-- $$$tabBarClicked[overload1]$$$tabBarClickedint -->
<h3 class="fn" id="tabBarClicked"><a name="tabBarClicked"></a><code>[signal] </code><span class="type">void</span> QTabWidget::<span class="name">tabBarClicked</span>(<span class="type">int</span> <i>index</i>)</h3>
<p>This signal is emitted when user clicks on a tab at an <i>index</i>.</p>
<p><i>index</i> refers to the tab clicked, or -1 if no tab is under the cursor.</p>
<p>This function was introduced in  Qt 5.2.</p>
<!-- @@@tabBarClicked -->
<!-- $$$tabBarDoubleClicked[overload1]$$$tabBarDoubleClickedint -->
<h3 class="fn" id="tabBarDoubleClicked"><a name="tabBarDoubleClicked"></a><code>[signal] </code><span class="type">void</span> QTabWidget::<span class="name">tabBarDoubleClicked</span>(<span class="type">int</span> <i>index</i>)</h3>
<p>This signal is emitted when the user double clicks on a tab at an <i>index</i>.</p>
<p><i>index</i> is the index of a clicked tab, or -1 if no tab is under the cursor.</p>
<p>This function was introduced in  Qt 5.2.</p>
<!-- @@@tabBarDoubleClicked -->
<!-- $$$tabCloseRequested[overload1]$$$tabCloseRequestedint -->
<h3 class="fn" id="tabCloseRequested"><a name="tabCloseRequested"></a><code>[signal] </code><span class="type">void</span> QTabWidget::<span class="name">tabCloseRequested</span>(<span class="type">int</span> <i>index</i>)</h3>
<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><b>See also </b><a href="qtabwidget.html#tabsClosable-prop">setTabsClosable</a>().</p>
<!-- @@@tabCloseRequested -->
<!-- $$$tabIcon[overload1]$$$tabIconint -->
<h3 class="fn" id="tabIcon"><a name="tabIcon"></a><span class="type"><a href="../qtgui/qicon.html">QIcon</a></span> QTabWidget::<span class="name">tabIcon</span>(<span class="type">int</span> <i>index</i>) const</h3>
<p>Returns the icon for the tab on the page at position <i>index</i>.</p>
<p><b>See also </b><a href="qtabwidget.html#setTabIcon">setTabIcon</a>().</p>
<!-- @@@tabIcon -->
<!-- $$$tabInserted[overload1]$$$tabInsertedint -->
<h3 class="fn" id="tabInserted"><a name="tabInserted"></a><code>[virtual protected] </code><span class="type">void</span> QTabWidget::<span class="name">tabInserted</span>(<span class="type">int</span> <i>index</i>)</h3>
<p>This virtual handler is called after a new tab was added or inserted at position <i>index</i>.</p>
<p><b>See also </b><a href="qtabwidget.html#tabRemoved">tabRemoved</a>().</p>
<!-- @@@tabInserted -->
<!-- $$$tabRemoved[overload1]$$$tabRemovedint -->
<h3 class="fn" id="tabRemoved"><a name="tabRemoved"></a><code>[virtual protected] </code><span class="type">void</span> QTabWidget::<span class="name">tabRemoved</span>(<span class="type">int</span> <i>index</i>)</h3>
<p>This virtual handler is called after a tab was removed from position <i>index</i>.</p>
<p><b>See also </b><a href="qtabwidget.html#tabInserted">tabInserted</a>().</p>
<!-- @@@tabRemoved -->
<!-- $$$tabText[overload1]$$$tabTextint -->
<h3 class="fn" id="tabText"><a name="tabText"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QTabWidget::<span class="name">tabText</span>(<span class="type">int</span> <i>index</i>) const</h3>
<p>Returns the label text for the tab on the page at position <i>index</i>.</p>
<p><b>See also </b><a href="qtabwidget.html#setTabText">setTabText</a>().</p>
<!-- @@@tabText -->
<!-- $$$tabToolTip[overload1]$$$tabToolTipint -->
<h3 class="fn" id="tabToolTip"><a name="tabToolTip"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QTabWidget::<span class="name">tabToolTip</span>(<span class="type">int</span> <i>index</i>) const</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><b>See also </b><a href="qtabwidget.html#setTabToolTip">setTabToolTip</a>().</p>
<!-- @@@tabToolTip -->
<!-- $$$tabWhatsThis[overload1]$$$tabWhatsThisint -->
<h3 class="fn" id="tabWhatsThis"><a name="tabWhatsThis"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QTabWidget::<span class="name">tabWhatsThis</span>(<span class="type">int</span> <i>index</i>) const</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><b>See also </b><a href="qtabwidget.html#setTabWhatsThis">setTabWhatsThis</a>().</p>
<!-- @@@tabWhatsThis -->
<!-- $$$widget[overload1]$$$widgetint -->
<h3 class="fn" id="widget"><a name="widget"></a><span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *QTabWidget::<span class="name">widget</span>(<span class="type">int</span> <i>index</i>) const</h3>
<p>Returns the tab page at index position <i>index</i> or 0 if the <i>index</i> is out of range.</p>
<!-- @@@widget -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>