1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QToolBox Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QToolBox Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QToolBox class provides a column of tabbed widget items.
<a href="#details">More...</a></p>
<p>Inherits <a href="qframe.html">QFrame</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtoolbox.html#QToolBox">__init__</a></b> (<i>self</i>, QWidget <i>parent</i> = None, Qt.WindowFlags <i>flags</i> = 0)</li><li><div class="fn" />int <b><a href="qtoolbox.html#addItem">addItem</a></b> (<i>self</i>, QWidget <i>item</i>, QString <i>text</i>)</li><li><div class="fn" />int <b><a href="qtoolbox.html#addItem-2">addItem</a></b> (<i>self</i>, QWidget <i>item</i>, QIcon <i>iconSet</i>, QString <i>text</i>)</li><li><div class="fn" /><b><a href="qtoolbox.html#changeEvent">changeEvent</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" />int <b><a href="qtoolbox.html#count">count</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtoolbox.html#currentIndex">currentIndex</a></b> (<i>self</i>)</li><li><div class="fn" />QWidget <b><a href="qtoolbox.html#currentWidget">currentWidget</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtoolbox.html#event">event</a></b> (<i>self</i>, QEvent <i>e</i>)</li><li><div class="fn" />int <b><a href="qtoolbox.html#indexOf">indexOf</a></b> (<i>self</i>, QWidget <i>widget</i>)</li><li><div class="fn" />int <b><a href="qtoolbox.html#insertItem">insertItem</a></b> (<i>self</i>, int <i>index</i>, QWidget <i>item</i>, QString <i>text</i>)</li><li><div class="fn" />int <b><a href="qtoolbox.html#insertItem-2">insertItem</a></b> (<i>self</i>, int <i>index</i>, QWidget <i>widget</i>, QIcon <i>icon</i>, QString <i>text</i>)</li><li><div class="fn" />bool <b><a href="qtoolbox.html#isItemEnabled">isItemEnabled</a></b> (<i>self</i>, int <i>index</i>)</li><li><div class="fn" />QIcon <b><a href="qtoolbox.html#itemIcon">itemIcon</a></b> (<i>self</i>, int <i>index</i>)</li><li><div class="fn" /><b><a href="qtoolbox.html#itemInserted">itemInserted</a></b> (<i>self</i>, int <i>index</i>)</li><li><div class="fn" /><b><a href="qtoolbox.html#itemRemoved">itemRemoved</a></b> (<i>self</i>, int <i>index</i>)</li><li><div class="fn" />QString <b><a href="qtoolbox.html#itemText">itemText</a></b> (<i>self</i>, int <i>index</i>)</li><li><div class="fn" />QString <b><a href="qtoolbox.html#itemToolTip">itemToolTip</a></b> (<i>self</i>, int <i>index</i>)</li><li><div class="fn" /><b><a href="qtoolbox.html#removeItem">removeItem</a></b> (<i>self</i>, int <i>index</i>)</li><li><div class="fn" /><b><a href="qtoolbox.html#setCurrentIndex">setCurrentIndex</a></b> (<i>self</i>, int <i>index</i>)</li><li><div class="fn" /><b><a href="qtoolbox.html#setCurrentWidget">setCurrentWidget</a></b> (<i>self</i>, QWidget <i>widget</i>)</li><li><div class="fn" /><b><a href="qtoolbox.html#setItemEnabled">setItemEnabled</a></b> (<i>self</i>, int <i>index</i>, bool <i>enabled</i>)</li><li><div class="fn" /><b><a href="qtoolbox.html#setItemIcon">setItemIcon</a></b> (<i>self</i>, int <i>index</i>, QIcon <i>icon</i>)</li><li><div class="fn" /><b><a href="qtoolbox.html#setItemText">setItemText</a></b> (<i>self</i>, int <i>index</i>, QString <i>text</i>)</li><li><div class="fn" /><b><a href="qtoolbox.html#setItemToolTip">setItemToolTip</a></b> (<i>self</i>, int <i>index</i>, QString <i>toolTip</i>)</li><li><div class="fn" /><b><a href="qtoolbox.html#showEvent">showEvent</a></b> (<i>self</i>, QShowEvent <i>e</i>)</li><li><div class="fn" />QWidget <b><a href="qtoolbox.html#widget">widget</a></b> (<i>self</i>, int <i>index</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" /> <b><a href="qtoolbox.html#__len__">__len__</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qtoolbox.html#currentChanged">currentChanged</a></b> (int)</li></ul><a name="details" /><hr /><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 class="compat" href="qtoolbox-qt3.html#item">item</a>().</p>
<p>The <a href="qtoolbox.html#currentChanged">currentChanged</a>()
signal is emitted when the current item is changed.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QToolBox" />QToolBox.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>parent</i> = None, <a href="qt-windowflags.html">Qt.WindowFlags</a> <i>flags</i> = 0)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a new toolbox with the given <i>parent</i> and the
flags, <i>f</i>.</p>
<h3 class="fn"><a name="addItem" />int QToolBox.addItem (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>item</i>, QString <i>text</i>)</h3><p>The <i>item</i> argument has it's ownership transferred to Qt.</p><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>
<h3 class="fn"><a name="addItem-2" />int QToolBox.addItem (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>item</i>, <a href="qicon.html">QIcon</a> <i>iconSet</i>, QString <i>text</i>)</h3><p>The <i>item</i> argument has it's ownership transferred to Qt.</p><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>
<h3 class="fn"><a name="changeEvent" />QToolBox.changeEvent (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget.changeEvent</a>().</p>
<h3 class="fn"><a name="count" />int QToolBox.count (<i>self</i>)</h3><h3 class="fn"><a name="currentIndex" />int QToolBox.currentIndex (<i>self</i>)</h3><h3 class="fn"><a name="currentWidget" /><a href="qwidget.html">QWidget</a> QToolBox.currentWidget (<i>self</i>)</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>
<h3 class="fn"><a name="event" />bool QToolBox.event (<i>self</i>, <a href="qevent.html">QEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>
<h3 class="fn"><a name="indexOf" />int QToolBox.indexOf (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>widget</i>)</h3><p>Returns the index of <i>widget</i>, or -1 if the item does not
exist.</p>
<h3 class="fn"><a name="insertItem" />int QToolBox.insertItem (<i>self</i>, int <i>index</i>, <a href="qwidget.html">QWidget</a> <i>item</i>, QString <i>text</i>)</h3><p>The <i>item</i> argument has it's ownership transferred to Qt.</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>, and the <i>icon</i> is displayed
to the left of the <i>text</i>. Returns the new item's index.</p>
<h3 class="fn"><a name="insertItem-2" />int QToolBox.insertItem (<i>self</i>, int <i>index</i>, <a href="qwidget.html">QWidget</a> <i>widget</i>, <a href="qicon.html">QIcon</a> <i>icon</i>, QString <i>text</i>)</h3><p>The <i>widget</i> argument has it's ownership transferred to Qt.</p><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>
<h3 class="fn"><a name="isItemEnabled" />bool QToolBox.isItemEnabled (<i>self</i>, int <i>index</i>)</h3><p>Returns true if the item at position <i>index</i> is enabled;
otherwise returns false.</p>
<h3 class="fn"><a name="itemIcon" /><a href="qicon.html">QIcon</a> QToolBox.itemIcon (<i>self</i>, int <i>index</i>)</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>
<h3 class="fn"><a name="itemInserted" />QToolBox.itemInserted (<i>self</i>, int <i>index</i>)</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>
<h3 class="fn"><a name="itemRemoved" />QToolBox.itemRemoved (<i>self</i>, int <i>index</i>)</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>
<h3 class="fn"><a name="itemText" />QString QToolBox.itemText (<i>self</i>, int <i>index</i>)</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>
<h3 class="fn"><a name="itemToolTip" />QString QToolBox.itemToolTip (<i>self</i>, int <i>index</i>)</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>
<h3 class="fn"><a name="removeItem" />QToolBox.removeItem (<i>self</i>, int <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>
<h3 class="fn"><a name="setCurrentIndex" />QToolBox.setCurrentIndex (<i>self</i>, int <i>index</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentIndex(int)</tt>.</p><h3 class="fn"><a name="setCurrentWidget" />QToolBox.setCurrentWidget (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>widget</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentWidget(QWidget *)</tt>.</p><p>Makes<i>widget</i> the current widget. The <i>widget</i> 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>
<h3 class="fn"><a name="setItemEnabled" />QToolBox.setItemEnabled (<i>self</i>, int <i>index</i>, bool <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>
<h3 class="fn"><a name="setItemIcon" />QToolBox.setItemIcon (<i>self</i>, int <i>index</i>, <a href="qicon.html">QIcon</a> <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>
<h3 class="fn"><a name="setItemText" />QToolBox.setItemText (<i>self</i>, int <i>index</i>, QString <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>
<h3 class="fn"><a name="setItemToolTip" />QToolBox.setItemToolTip (<i>self</i>, int <i>index</i>, QString <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>
<h3 class="fn"><a name="showEvent" />QToolBox.showEvent (<i>self</i>, <a href="qshowevent.html">QShowEvent</a> <i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#showEvent">QWidget.showEvent</a>().</p>
<h3 class="fn"><a name="widget" /><a href="qwidget.html">QWidget</a> QToolBox.widget (<i>self</i>, int <i>index</i>)</h3><p>Returns the widget at position <i>index</i>, or 0 if there is no
such item.</p>
<h3 class="fn"><a name="__len__" /> QToolBox.__len__ (<i>self</i>)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="currentChanged" />void currentChanged (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted 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>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.9.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.2</td></tr></table></div></address></body></html>
|