<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qtoolbox.cpp --> <title>Qt 4.8: QToolBox Class Reference</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> <li><a href="modules.html">Modules</a></li> <li><a href="qtgui.html">QtGui</a></li> <li>QToolBox</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <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="#public-slots">Public Slots</a></li> <li class="level1"><a href="#signals">Signals</a></li> <li class="level1"><a href="#protected-functions">Protected Functions</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">QToolBox Class Reference</h1> <!-- $$$QToolBox-brief --> <p>The QToolBox class provides a column of tabbed widget items. <a href="#details">More...</a></p> <!-- @@@QToolBox --> <pre class="cpp"> <span class="preprocessor">#include <QToolBox></span></pre><p><b>Inherits: </b><a href="qframe.html">QFrame</a>.</p> <ul> <li><a href="qtoolbox-members.html">List of all members, including inherited members</a></li> <li><a href="qtoolbox-qt3.html">Qt 3 support members</a></li> </ul> <a name="properties"></a> <h2>Properties</h2> <ul> <li class="fn"><b><a href="qtoolbox.html#count-prop">count</a></b> : const int</li> <li class="fn"><b><a href="qtoolbox.html#currentIndex-prop">currentIndex</a></b> : int</li> </ul> <ul> <li class="fn">6 properties inherited from <a href="qframe.html#properties">QFrame</a></li> <li class="fn">58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li> <li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li> </ul> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#QToolBox">QToolBox</a></b> ( QWidget * <i>parent</i> = 0, Qt::WindowFlags <i>f</i> = 0 )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#dtor.QToolBox">~QToolBox</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#addItem">addItem</a></b> ( QWidget * <i>widget</i>, const QIcon & <i>iconSet</i>, const QString & <i>text</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#addItem-2">addItem</a></b> ( QWidget * <i>w</i>, const QString & <i>text</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#count-prop">count</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#currentIndex-prop">currentIndex</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#currentWidget">currentWidget</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#indexOf">indexOf</a></b> ( QWidget * <i>widget</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#insertItem">insertItem</a></b> ( int <i>index</i>, QWidget * <i>widget</i>, const QIcon & <i>icon</i>, const QString & <i>text</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#insertItem-2">insertItem</a></b> ( int <i>index</i>, QWidget * <i>widget</i>, const QString & <i>text</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#isItemEnabled">isItemEnabled</a></b> ( int <i>index</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QIcon </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#itemIcon">itemIcon</a></b> ( int <i>index</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#itemText">itemText</a></b> ( int <i>index</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#itemToolTip">itemToolTip</a></b> ( int <i>index</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#removeItem">removeItem</a></b> ( int <i>index</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#setItemEnabled">setItemEnabled</a></b> ( int <i>index</i>, bool <i>enabled</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#setItemIcon">setItemIcon</a></b> ( int <i>index</i>, const QIcon & <i>icon</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#setItemText">setItemText</a></b> ( int <i>index</i>, const QString & <i>text</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#setItemToolTip">setItemToolTip</a></b> ( int <i>index</i>, const QString & <i>toolTip</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#widget">widget</a></b> ( int <i>index</i> ) const</td></tr> </table> <ul> <li class="fn">14 public functions inherited from <a href="qframe.html#public-functions">QFrame</a></li> <li class="fn">221 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li> <li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li> <li class="fn">13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li> </ul> <a name="public-slots"></a> <h2>Public Slots</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.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="qtoolbox.html#setCurrentWidget">setCurrentWidget</a></b> ( QWidget * <i>widget</i> )</td></tr> </table> <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="qobject.html#public-slots">QObject</a></li> </ul> <a name="signals"></a> <h2>Signals</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#currentChanged">currentChanged</a></b> ( int <i>index</i> )</td></tr> </table> <ul> <li class="fn">1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li> <li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li> </ul> <a name="protected-functions"></a> <h2>Protected Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#itemInserted">itemInserted</a></b> ( int <i>index</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#itemRemoved">itemRemoved</a></b> ( int <i>index</i> )</td></tr> </table> <a name="reimplemented-protected-functions"></a> <h2>Reimplemented Protected Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#changeEvent">changeEvent</a></b> ( QEvent * <i>ev</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#event">event</a></b> ( QEvent * <i>e</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbox.html#showEvent">showEvent</a></b> ( QShowEvent * <i>e</i> )</td></tr> </table> <ul> <li class="fn">3 protected functions inherited from <a href="qframe.html#protected-functions">QFrame</a></li> <li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li> <li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li> <li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li class="fn">4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li> <li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li> <li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li> </ul> <a name="details"></a> <!-- $$$QToolBox-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QToolBox class provides a column of tabbed widget items.</p> <p>A toolbox is a widget that displays a column of tabs one above the other, with the current item displayed below the current tab. Every tab has an index position within the column of tabs. A tab's item is a <a href="qwidget.html">QWidget</a>.</p> <p>Each item has an <a href="qtoolbox.html#itemText">itemText</a>(), an optional <a href="qtoolbox.html#itemIcon">itemIcon</a>(), an optional <a href="qtoolbox.html#itemToolTip">itemToolTip</a>(), and a <a href="qtoolbox.html#widget">widget</a>(). The item's attributes can be changed with <a href="qtoolbox.html#setItemText">setItemText</a>(), <a href="qtoolbox.html#setItemIcon">setItemIcon</a>(), and <a href="qtoolbox.html#setItemToolTip">setItemToolTip</a>(). Each item can be enabled or disabled individually with <a href="qtoolbox.html#setItemEnabled">setItemEnabled</a>().</p> <p>Items are added using <a href="qtoolbox.html#addItem">addItem</a>(), or inserted at particular positions using <a href="qtoolbox.html#insertItem">insertItem</a>(). The total number of items is given by <a href="qtoolbox.html#count-prop">count</a>(). Items can be deleted with delete, or removed from the toolbox with <a href="qtoolbox.html#removeItem">removeItem</a>(). Combining <a href="qtoolbox.html#removeItem">removeItem</a>() and <a href="qtoolbox.html#insertItem">insertItem</a>() allows you to move items to different positions.</p> <p>The index of the current item widget is returned by <a href="qtoolbox.html#currentIndex-prop">currentIndex</a>(), and set with <a href="qtoolbox.html#currentIndex-prop">setCurrentIndex</a>(). The index of a particular item can be found using <a href="qtoolbox.html#indexOf">indexOf</a>(), and the item at a given index is returned by <a href="qtoolbox-qt3.html#item" class="compat">item</a>().</p> <p>The <a href="qtoolbox.html#currentChanged">currentChanged</a>() signal is emitted when the current item is changed.</p> </div> <p><b>See also </b><a href="qtabwidget.html">QTabWidget</a>.</p> <!-- @@@QToolBox --> <div class="prop"> <h2>Property Documentation</h2> <!-- $$$count-prop$$$count --> <h3 class="fn"><a name="count-prop"></a><span class="name">count</span> : const <span class="type">int</span></h3> <p>This property holds the number of items contained in the toolbox.</p> <p>By default, this property has a value of 0.</p> <p><b>Access functions:</b></p> <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> <!-- @@@count --> <!-- $$$currentIndex-prop$$$currentIndex$$$setCurrentIndexint$$$currentChangedint --> <h3 class="fn"><a name="currentIndex-prop"></a><span class="name">currentIndex</span> : <span class="type">int</span></h3> <p>This property holds the index of the current item.</p> <p>By default, for an empty toolbox, this property has a value of -1.</p> <p><b>Access functions:</b></p> <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> <p><b>Notifier signal:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qtoolbox.html#currentChanged">currentChanged</a></b></span> ( int <i>index</i> )</td></tr> </table> <p><b>See also </b><a href="qtoolbox.html#indexOf">indexOf</a>() and <a href="qtoolbox.html#widget">widget</a>().</p> <!-- @@@currentIndex --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QToolBox[overload1]$$$QToolBoxQWidget*Qt::WindowFlags --> <h3 class="fn"><a name="QToolBox"></a>QToolBox::<span class="name">QToolBox</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0, <span class="type"><a href="qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>f</i> = 0 )</h3> <p>Constructs a new toolbox with the given <i>parent</i> and the flags, <i>f</i>.</p> <!-- @@@QToolBox --> <!-- $$$~QToolBox[overload1]$$$~QToolBox --> <h3 class="fn"><a name="dtor.QToolBox"></a>QToolBox::<span class="name">~QToolBox</span> ()</h3> <p>Destroys the toolbox.</p> <!-- @@@~QToolBox --> <!-- $$$addItem[overload1]$$$addItemQWidget*constQIcon&constQString& --> <h3 class="fn"><a name="addItem"></a><span class="type">int</span> QToolBox::<span class="name">addItem</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i>, const <span class="type"><a href="qicon.html">QIcon</a></span> & <i>iconSet</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>text</i> )</h3> <p>Adds the <i>widget</i> in a new tab at bottom of the toolbox. The new tab's text is set to <i>text</i>, and the <i>iconSet</i> is displayed to the left of the <i>text</i>. Returns the new tab's index.</p> <!-- @@@addItem --> <!-- $$$addItem$$$addItemQWidget*constQString& --> <h3 class="fn"><a name="addItem-2"></a><span class="type">int</span> QToolBox::<span class="name">addItem</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>w</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>text</i> )</h3> <p>This is an overloaded function.</p> <p>Adds the widget <i>w</i> in a new tab at bottom of the toolbox. The new tab's text is set to <i>text</i>. Returns the new tab's index.</p> <!-- @@@addItem --> <!-- $$$changeEvent[overload1]$$$changeEventQEvent* --> <h3 class="fn"><a name="changeEvent"></a><span class="type">void</span> QToolBox::<span class="name">changeEvent</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>ev</i> )<tt> [virtual protected]</tt></h3> <p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget::changeEvent</a>().</p> <!-- @@@changeEvent --> <!-- $$$currentChanged[overload1]$$$currentChangedint --> <h3 class="fn"><a name="currentChanged"></a><span class="type">void</span> QToolBox::<span class="name">currentChanged</span> ( <span class="type">int</span> <i>index</i> )<tt> [signal]</tt></h3> <p>This signal is emitted when the current item is changed. The new current item's index is passed in <i>index</i>, or -1 if there is no current item.</p> <!-- @@@currentChanged --> <!-- $$$currentWidget[overload1]$$$currentWidget --> <h3 class="fn"><a name="currentWidget"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QToolBox::<span class="name">currentWidget</span> () const</h3> <p>Returns a pointer to the current widget, or 0 if there is no such item.</p> <p><b>See also </b><a href="qtoolbox.html#currentIndex-prop">currentIndex</a>() and <a href="qtoolbox.html#setCurrentWidget">setCurrentWidget</a>().</p> <!-- @@@currentWidget --> <!-- $$$event[overload1]$$$eventQEvent* --> <h3 class="fn"><a name="event"></a><span class="type">bool</span> QToolBox::<span class="name">event</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3> <p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p> <!-- @@@event --> <!-- $$$indexOf[overload1]$$$indexOfQWidget* --> <h3 class="fn"><a name="indexOf"></a><span class="type">int</span> QToolBox::<span class="name">indexOf</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i> ) const</h3> <p>Returns the index of <i>widget</i>, or -1 if the item does not exist.</p> <!-- @@@indexOf --> <!-- $$$insertItem[overload1]$$$insertItemintQWidget*constQIcon&constQString& --> <h3 class="fn"><a name="insertItem"></a><span class="type">int</span> QToolBox::<span class="name">insertItem</span> ( <span class="type">int</span> <i>index</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i>, const <span class="type"><a href="qicon.html">QIcon</a></span> & <i>icon</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>text</i> )</h3> <p>Inserts the <i>widget</i> at position <i>index</i>, or at the bottom of the toolbox if <i>index</i> is out of range. The new item's text is set to <i>text</i>, and the <i>icon</i> is displayed to the left of the <i>text</i>. Returns the new item's index.</p> <!-- @@@insertItem --> <!-- $$$insertItem$$$insertItemintQWidget*constQString& --> <h3 class="fn"><a name="insertItem-2"></a><span class="type">int</span> QToolBox::<span class="name">insertItem</span> ( <span class="type">int</span> <i>index</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>text</i> )</h3> <p>This is an overloaded function.</p> <p>Inserts the <i>widget</i> at position <i>index</i>, or at the bottom of the toolbox if <i>index</i> is out of range. The new item's text is set to <i>text</i>. Returns the new item's index.</p> <!-- @@@insertItem --> <!-- $$$isItemEnabled[overload1]$$$isItemEnabledint --> <h3 class="fn"><a name="isItemEnabled"></a><span class="type">bool</span> QToolBox::<span class="name">isItemEnabled</span> ( <span class="type">int</span> <i>index</i> ) const</h3> <p>Returns true if the item at position <i>index</i> is enabled; otherwise returns false.</p> <!-- @@@isItemEnabled --> <!-- $$$itemIcon[overload1]$$$itemIconint --> <h3 class="fn"><a name="itemIcon"></a><span class="type"><a href="qicon.html">QIcon</a></span> QToolBox::<span class="name">itemIcon</span> ( <span class="type">int</span> <i>index</i> ) const</h3> <p>Returns the icon of the item at position <i>index</i>, or a null icon if <i>index</i> is out of range.</p> <p><b>See also </b><a href="qtoolbox.html#setItemIcon">setItemIcon</a>().</p> <!-- @@@itemIcon --> <!-- $$$itemInserted[overload1]$$$itemInsertedint --> <h3 class="fn"><a name="itemInserted"></a><span class="type">void</span> QToolBox::<span class="name">itemInserted</span> ( <span class="type">int</span> <i>index</i> )<tt> [virtual protected]</tt></h3> <p>This virtual handler is called after a new item was added or inserted at position <i>index</i>.</p> <p><b>See also </b><a href="qtoolbox.html#itemRemoved">itemRemoved</a>().</p> <!-- @@@itemInserted --> <!-- $$$itemRemoved[overload1]$$$itemRemovedint --> <h3 class="fn"><a name="itemRemoved"></a><span class="type">void</span> QToolBox::<span class="name">itemRemoved</span> ( <span class="type">int</span> <i>index</i> )<tt> [virtual protected]</tt></h3> <p>This virtual handler is called after an item was removed from position <i>index</i>.</p> <p><b>See also </b><a href="qtoolbox.html#itemInserted">itemInserted</a>().</p> <!-- @@@itemRemoved --> <!-- $$$itemText[overload1]$$$itemTextint --> <h3 class="fn"><a name="itemText"></a><span class="type"><a href="qstring.html">QString</a></span> QToolBox::<span class="name">itemText</span> ( <span class="type">int</span> <i>index</i> ) const</h3> <p>Returns the text of the item at position <i>index</i>, or an empty string if <i>index</i> is out of range.</p> <p><b>See also </b><a href="qtoolbox.html#setItemText">setItemText</a>().</p> <!-- @@@itemText --> <!-- $$$itemToolTip[overload1]$$$itemToolTipint --> <h3 class="fn"><a name="itemToolTip"></a><span class="type"><a href="qstring.html">QString</a></span> QToolBox::<span class="name">itemToolTip</span> ( <span class="type">int</span> <i>index</i> ) const</h3> <p>Returns the tooltip of the item at position <i>index</i>, or an empty string if <i>index</i> is out of range.</p> <p><b>See also </b><a href="qtoolbox.html#setItemToolTip">setItemToolTip</a>().</p> <!-- @@@itemToolTip --> <!-- $$$removeItem[overload1]$$$removeItemint --> <h3 class="fn"><a name="removeItem"></a><span class="type">void</span> QToolBox::<span class="name">removeItem</span> ( <span class="type">int</span> <i>index</i> )</h3> <p>Removes the item at position <i>index</i> from the toolbox. Note that the widget is <i>not</i> deleted.</p> <!-- @@@removeItem --> <!-- $$$setCurrentWidget[overload1]$$$setCurrentWidgetQWidget* --> <h3 class="fn"><a name="setCurrentWidget"></a><span class="type">void</span> QToolBox::<span class="name">setCurrentWidget</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i> )<tt> [slot]</tt></h3> <p>Makes<i>widget</i> the current widget. The <i>widget</i> must be an item in this tool box.</p> <p><b>See also </b><a href="qtoolbox.html#addItem">addItem</a>(), <a href="qtoolbox.html#currentIndex-prop">setCurrentIndex</a>(), and <a href="qtoolbox.html#currentWidget">currentWidget</a>().</p> <!-- @@@setCurrentWidget --> <!-- $$$setItemEnabled[overload1]$$$setItemEnabledintbool --> <h3 class="fn"><a name="setItemEnabled"></a><span class="type">void</span> QToolBox::<span class="name">setItemEnabled</span> ( <span class="type">int</span> <i>index</i>, <span class="type">bool</span> <i>enabled</i> )</h3> <p>If <i>enabled</i> is true then the item at position <i>index</i> is enabled; otherwise the item at position <i>index</i> is disabled.</p> <p><b>See also </b><a href="qtoolbox.html#isItemEnabled">isItemEnabled</a>().</p> <!-- @@@setItemEnabled --> <!-- $$$setItemIcon[overload1]$$$setItemIconintconstQIcon& --> <h3 class="fn"><a name="setItemIcon"></a><span class="type">void</span> QToolBox::<span class="name">setItemIcon</span> ( <span class="type">int</span> <i>index</i>, const <span class="type"><a href="qicon.html">QIcon</a></span> & <i>icon</i> )</h3> <p>Sets the icon of the item at position <i>index</i> to <i>icon</i>.</p> <p><b>See also </b><a href="qtoolbox.html#itemIcon">itemIcon</a>().</p> <!-- @@@setItemIcon --> <!-- $$$setItemText[overload1]$$$setItemTextintconstQString& --> <h3 class="fn"><a name="setItemText"></a><span class="type">void</span> QToolBox::<span class="name">setItemText</span> ( <span class="type">int</span> <i>index</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>text</i> )</h3> <p>Sets the text of the item at position <i>index</i> to <i>text</i>.</p> <p>If the provided text contains an ampersand character ('&'), a mnemonic is automatically created for it. The character that follows the '&' will be used as the shortcut key. Any previous mnemonic will be overwritten, or cleared if no mnemonic is defined by the text. See the <a href="qshortcut.html#mnemonic">QShortcut</a> documentation for details (to display an actual ampersand, use '&&').</p> <p><b>See also </b><a href="qtoolbox.html#itemText">itemText</a>().</p> <!-- @@@setItemText --> <!-- $$$setItemToolTip[overload1]$$$setItemToolTipintconstQString& --> <h3 class="fn"><a name="setItemToolTip"></a><span class="type">void</span> QToolBox::<span class="name">setItemToolTip</span> ( <span class="type">int</span> <i>index</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>toolTip</i> )</h3> <p>Sets the tooltip of the item at position <i>index</i> to <i>toolTip</i>.</p> <p><b>See also </b><a href="qtoolbox.html#itemToolTip">itemToolTip</a>().</p> <!-- @@@setItemToolTip --> <!-- $$$showEvent[overload1]$$$showEventQShowEvent* --> <h3 class="fn"><a name="showEvent"></a><span class="type">void</span> QToolBox::<span class="name">showEvent</span> ( <span class="type"><a href="qshowevent.html">QShowEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3> <p>Reimplemented from <a href="qwidget.html#showEvent">QWidget::showEvent</a>().</p> <!-- @@@showEvent --> <!-- $$$widget[overload1]$$$widgetint --> <h3 class="fn"><a name="widget"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QToolBox::<span class="name">widget</span> ( <span class="type">int</span> <i>index</i> ) const</h3> <p>Returns the widget at position <i>index</i>, or 0 if there is no such item.</p> <!-- @@@widget --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2015 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> 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.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> 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. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>