1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
|
<?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>QTableWidget 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="../pyqt4ref.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">QTableWidget Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QTableWidget class provides an item-based table view with a default model. <a href="#details">More...</a></p>
<p>Inherits <a href="qtableview.html">QTableView</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtablewidget.html#QTableWidget">__init__</a></b> (<i>self</i>, QWidget <i>parent</i> = None)</li><li><div class="fn" /><b><a href="qtablewidget.html#QTableWidget-2">__init__</a></b> (<i>self</i>, int <i>rows</i>, int <i>columns</i>, QWidget <i>parent</i> = None)</li><li><div class="fn" />QWidget <b><a href="qtablewidget.html#cellWidget">cellWidget</a></b> (<i>self</i>, int <i>row</i>, int <i>column</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#clear">clear</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#closePersistentEditor">closePersistentEditor</a></b> (<i>self</i>, QTableWidgetItem <i>item</i>)</li><li><div class="fn" />int <b><a href="qtablewidget.html#column">column</a></b> (<i>self</i>, QTableWidgetItem <i>item</i>)</li><li><div class="fn" />int <b><a href="qtablewidget.html#columnCount">columnCount</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtablewidget.html#currentColumn">currentColumn</a></b> (<i>self</i>)</li><li><div class="fn" />QTableWidgetItem <b><a href="qtablewidget.html#currentItem">currentItem</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtablewidget.html#currentRow">currentRow</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtablewidget.html#dropMimeData">dropMimeData</a></b> (<i>self</i>, int <i>row</i>, int <i>column</i>, QMimeData <i>data</i>, Qt.DropAction <i>action</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#editItem">editItem</a></b> (<i>self</i>, QTableWidgetItem <i>item</i>)</li><li><div class="fn" />bool <b><a href="qtablewidget.html#event">event</a></b> (<i>self</i>, QEvent <i>e</i>)</li><li><div class="fn" />QTableWidgetItem-list <b><a href="qtablewidget.html#findItems">findItems</a></b> (<i>self</i>, QString <i>text</i>, Qt.MatchFlags <i>flags</i>)</li><li><div class="fn" />QTableWidgetItem <b><a href="qtablewidget.html#horizontalHeaderItem">horizontalHeaderItem</a></b> (<i>self</i>, int <i>column</i>)</li><li><div class="fn" />QModelIndex <b><a href="qtablewidget.html#indexFromItem">indexFromItem</a></b> (<i>self</i>, QTableWidgetItem <i>item</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#insertColumn">insertColumn</a></b> (<i>self</i>, int <i>column</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#insertRow">insertRow</a></b> (<i>self</i>, int <i>row</i>)</li><li><div class="fn" />bool <b><a href="qtablewidget.html#isItemSelected">isItemSelected</a></b> (<i>self</i>, QTableWidgetItem <i>item</i>)</li><li><div class="fn" />bool <b><a href="qtablewidget.html#isSortingEnabled">isSortingEnabled</a></b> (<i>self</i>)</li><li><div class="fn" />QTableWidgetItem <b><a href="qtablewidget.html#item">item</a></b> (<i>self</i>, int <i>row</i>, int <i>column</i>)</li><li><div class="fn" />QTableWidgetItem <b><a href="qtablewidget.html#itemAt">itemAt</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" />QTableWidgetItem <b><a href="qtablewidget.html#itemAt-2">itemAt</a></b> (<i>self</i>, int <i>ax</i>, int <i>ay</i>)</li><li><div class="fn" />QTableWidgetItem <b><a href="qtablewidget.html#itemFromIndex">itemFromIndex</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" />QTableWidgetItem <b><a href="qtablewidget.html#itemPrototype">itemPrototype</a></b> (<i>self</i>)</li><li><div class="fn" />QTableWidgetItem-list <b><a href="qtablewidget.html#items">items</a></b> (<i>self</i>, QMimeData <i>data</i>)</li><li><div class="fn" />QMimeData <b><a href="qtablewidget.html#mimeData">mimeData</a></b> (<i>self</i>, QTableWidgetItem-list <i>items</i>)</li><li><div class="fn" />QStringList <b><a href="qtablewidget.html#mimeTypes">mimeTypes</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#openPersistentEditor">openPersistentEditor</a></b> (<i>self</i>, QTableWidgetItem <i>item</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#removeColumn">removeColumn</a></b> (<i>self</i>, int <i>column</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#removeRow">removeRow</a></b> (<i>self</i>, int <i>row</i>)</li><li><div class="fn" />int <b><a href="qtablewidget.html#row">row</a></b> (<i>self</i>, QTableWidgetItem <i>item</i>)</li><li><div class="fn" />int <b><a href="qtablewidget.html#rowCount">rowCount</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#scrollToItem">scrollToItem</a></b> (<i>self</i>, QTableWidgetItem <i>item</i>, QAbstractItemView.ScrollHint <i>hint</i> = QAbstractItemView.EnsureVisible)</li><li><div class="fn" />QTableWidgetItem-list <b><a href="qtablewidget.html#selectedItems">selectedItems</a></b> (<i>self</i>)</li><li><div class="fn" />QTableWidgetSelectionRange-list <b><a href="qtablewidget.html#selectedRanges">selectedRanges</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#setCellWidget">setCellWidget</a></b> (<i>self</i>, int <i>row</i>, int <i>column</i>, QWidget <i>widget</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#setColumnCount">setColumnCount</a></b> (<i>self</i>, int <i>columns</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#setCurrentCell">setCurrentCell</a></b> (<i>self</i>, int <i>row</i>, int <i>column</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#setCurrentItem">setCurrentItem</a></b> (<i>self</i>, QTableWidgetItem <i>item</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#setHorizontalHeaderItem">setHorizontalHeaderItem</a></b> (<i>self</i>, int <i>column</i>, QTableWidgetItem <i>item</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#setHorizontalHeaderLabels">setHorizontalHeaderLabels</a></b> (<i>self</i>, QStringList <i>labels</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#setItem">setItem</a></b> (<i>self</i>, int <i>row</i>, int <i>column</i>, QTableWidgetItem <i>item</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#setItemPrototype">setItemPrototype</a></b> (<i>self</i>, QTableWidgetItem <i>item</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#setItemSelected">setItemSelected</a></b> (<i>self</i>, QTableWidgetItem <i>item</i>, bool <i>select</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#setRangeSelected">setRangeSelected</a></b> (<i>self</i>, QTableWidgetSelectionRange <i>range</i>, bool <i>select</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#setRowCount">setRowCount</a></b> (<i>self</i>, int <i>rows</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#setSortingEnabled">setSortingEnabled</a></b> (<i>self</i>, bool <i>enable</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#setVerticalHeaderItem">setVerticalHeaderItem</a></b> (<i>self</i>, int <i>row</i>, QTableWidgetItem <i>item</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#setVerticalHeaderLabels">setVerticalHeaderLabels</a></b> (<i>self</i>, QStringList <i>labels</i>)</li><li><div class="fn" /><b><a href="qtablewidget.html#sortItems">sortItems</a></b> (<i>self</i>, int <i>column</i>, Qt.SortOrder <i>order</i> = Qt.AscendingOrder)</li><li><div class="fn" />Qt.DropActions <b><a href="qtablewidget.html#supportedDropActions">supportedDropActions</a></b> (<i>self</i>)</li><li><div class="fn" />QTableWidgetItem <b><a href="qtablewidget.html#takeHorizontalHeaderItem">takeHorizontalHeaderItem</a></b> (<i>self</i>, int <i>column</i>)</li><li><div class="fn" />QTableWidgetItem <b><a href="qtablewidget.html#takeItem">takeItem</a></b> (<i>self</i>, int <i>row</i>, int <i>column</i>)</li><li><div class="fn" />QTableWidgetItem <b><a href="qtablewidget.html#takeVerticalHeaderItem">takeVerticalHeaderItem</a></b> (<i>self</i>, int <i>row</i>)</li><li><div class="fn" />QTableWidgetItem <b><a href="qtablewidget.html#verticalHeaderItem">verticalHeaderItem</a></b> (<i>self</i>, int <i>row</i>)</li><li><div class="fn" />int <b><a href="qtablewidget.html#visualColumn">visualColumn</a></b> (<i>self</i>, int <i>logicalColumn</i>)</li><li><div class="fn" />QRect <b><a href="qtablewidget.html#visualItemRect">visualItemRect</a></b> (<i>self</i>, QTableWidgetItem <i>item</i>)</li><li><div class="fn" />int <b><a href="qtablewidget.html#visualRow">visualRow</a></b> (<i>self</i>, int <i>logicalRow</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qtablewidget.html#cellActivated">cellActivated</a></b> (int,int)</li><li><div class="fn" />void <b><a href="qtablewidget.html#cellChanged">cellChanged</a></b> (int,int)</li><li><div class="fn" />void <b><a href="qtablewidget.html#cellClicked">cellClicked</a></b> (int,int)</li><li><div class="fn" />void <b><a href="qtablewidget.html#cellDoubleClicked">cellDoubleClicked</a></b> (int,int)</li><li><div class="fn" />void <b><a href="qtablewidget.html#cellEntered">cellEntered</a></b> (int,int)</li><li><div class="fn" />void <b><a href="qtablewidget.html#cellPressed">cellPressed</a></b> (int,int)</li><li><div class="fn" />void <b><a href="qtablewidget.html#currentCellChanged">currentCellChanged</a></b> (int,int,int,int)</li><li><div class="fn" />void <b><a href="qtablewidget.html#currentItemChanged">currentItemChanged</a></b> (QTableWidgetItem *,QTableWidgetItem *)</li><li><div class="fn" />void <b><a href="qtablewidget.html#itemActivated">itemActivated</a></b> (QTableWidgetItem *)</li><li><div class="fn" />void <b><a href="qtablewidget.html#itemChanged">itemChanged</a></b> (QTableWidgetItem *)</li><li><div class="fn" />void <b><a href="qtablewidget.html#itemClicked">itemClicked</a></b> (QTableWidgetItem *)</li><li><div class="fn" />void <b><a href="qtablewidget.html#itemDoubleClicked">itemDoubleClicked</a></b> (QTableWidgetItem *)</li><li><div class="fn" />void <b><a href="qtablewidget.html#itemEntered">itemEntered</a></b> (QTableWidgetItem *)</li><li><div class="fn" />void <b><a href="qtablewidget.html#itemPressed">itemPressed</a></b> (QTableWidgetItem *)</li><li><div class="fn" />void <b><a href="qtablewidget.html#itemSelectionChanged">itemSelectionChanged</a></b> ()</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTableWidget class provides an item-based table view with a default model.</p>
<p>Table widgets provide standard table display facilities for applications. The items in a QTableWidget are provided by <a href="qtablewidgetitem.html">QTableWidgetItem</a>.</p>
<p>If you want a table that uses your own data model you should use <a href="qtableview.html">QTableView</a> rather than this class.</p>
<p>Table widgets can be constructed with the required numbers of rows and columns:</p>
<pre>
tableWidget = new QTableWidget(12, 3, this);
</pre>
<p>Alternatively, tables can be constructed without a given size and resized later:</p>
<pre>
tableWidget = new QTableWidget(this);
tableWidget->setRowCount(10);
tableWidget->setColumnCount(5);
</pre>
<p>Items are created ouside the table (with no parent widget) and inserted into the table with <a href="qtablewidget.html#setItem">setItem</a>():</p>
<pre>
QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg(
(row+1)*(column+1)));
tableWidget->setItem(row, column, newItem);
</pre>
<p>Tables can be given both horizontal and vertical headers. The simplest way to create the headers is to supply a list of strings to the <a href="qtablewidget.html#setHorizontalHeaderLabels">setHorizontalHeaderLabels</a>() and <a href="qtablewidget.html#setVerticalHeaderLabels">setVerticalHeaderLabels</a>() functions. These will provide simple textual headers for the table's columns and rows. More sophisticated headers can be created from existing table items that are usually constructed outside the table. For example, we can construct a table item with an icon and aligned text, and use it as the header for a particular column:</p>
<pre>
QTableWidgetItem *cubesHeaderItem = new QTableWidgetItem(tr("Cubes"));
cubesHeaderItem->setIcon(QIcon(QPixmap(":/Images/cubed.png")));
cubesHeaderItem->setTextAlignment(Qt.AlignVCenter);
</pre>
<p>The number of rows in the table can be found with <a href="qtablewidget.html#rowCount-prop">rowCount</a>(), and the number of columns with <a href="qtablewidget.html#columnCount-prop">columnCount</a>(). The table can be cleared with the <a href="qtablewidget.html#clear">clear</a>() function.</p>
<table align="center" border="0" cellpadding="2" cellspacing="1" width="100%">
<tr bgcolor="#F0F0F0" valign="top">
<td><img alt="Screenshot of a Windows XP style table widget" src="images/windowsxp-tableview.png" /></td>
<td><img alt="Screenshot of a Macintosh style table widget" src="images/macintosh-tableview.png" /></td>
<td><img alt="Screenshot of a Plastique style table widget" src="images/plastique-tableview.png" /></td>
</tr>
<tr bgcolor="#E0E0E0" valign="top">
<td>A <a href="gallery-windowsxp.html">Windows XP style</a> table widget.</td>
<td>A <a href="gallery-macintosh.html">Macintosh style</a> table widget.</td>
<td>A <a href="gallery-plastique.html">Plastique style</a> table widget.</td>
</tr>
</table>
<br />
<br />
<p>See also <a href="qtablewidgetitem.html">QTableWidgetItem</a>, <a href="qtableview.html">QTableView</a>, and <a href="model-view-programming.html">Model/View Programming</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTableWidget" />QTableWidget.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>parent</i> = None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Creates a new table view with the given <i>parent</i>.</p>
<h3 class="fn"><a name="QTableWidget-2" />QTableWidget.__init__ (<i>self</i>, int <i>rows</i>, int <i>columns</i>, <a href="qwidget.html">QWidget</a> <i>parent</i> = None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Creates a new table view with the given <i>rows</i> and <i>columns</i>, and with the given <i>parent</i>.</p>
<h3 class="fn"><a name="cellWidget" /><a href="qwidget.html">QWidget</a> QTableWidget.cellWidget (<i>self</i>, int <i>row</i>, int <i>column</i>)</h3><p>Returns the widget displayed in the cell in the given <i>row</i> and <i>column</i>.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qtablewidget.html#setCellWidget">setCellWidget</a>().</p>
<h3 class="fn"><a name="clear" />QTableWidget.clear (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void clear()</tt>.</p><p>Removes all items and selections in the view. The table dimentions stay the same.</p>
<h3 class="fn"><a name="closePersistentEditor" />QTableWidget.closePersistentEditor (<i>self</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>)</h3><p>Closes the persistent editor for <i>item</i>.</p>
<p>See also <a href="qtablewidget.html#openPersistentEditor">openPersistentEditor</a>().</p>
<h3 class="fn"><a name="column" />int QTableWidget.column (<i>self</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>)</h3><p>Returns the column for the <i>item</i>.</p>
<h3 class="fn"><a name="columnCount" />int QTableWidget.columnCount (<i>self</i>)</h3><h3 class="fn"><a name="currentColumn" />int QTableWidget.currentColumn (<i>self</i>)</h3><p>Returns the column of the current item.</p>
<p>See also <a href="qtablewidget.html#currentRow">currentRow</a>() and <a href="qtablewidget.html#setCurrentCell">setCurrentCell</a>().</p>
<h3 class="fn"><a name="currentItem" /><a href="qtablewidgetitem.html">QTableWidgetItem</a> QTableWidget.currentItem (<i>self</i>)</h3><p>Returns the current item.</p>
<p>See also <a href="qtablewidget.html#setCurrentItem">setCurrentItem</a>().</p>
<h3 class="fn"><a name="currentRow" />int QTableWidget.currentRow (<i>self</i>)</h3><p>Returns the row of the current item.</p>
<p>See also <a href="qtablewidget.html#currentColumn">currentColumn</a>() and <a href="qtablewidget.html#setCurrentCell">setCurrentCell</a>().</p>
<h3 class="fn"><a name="dropMimeData" />bool QTableWidget.dropMimeData (<i>self</i>, int <i>row</i>, int <i>column</i>, <a href="qmimedata.html">QMimeData</a> <i>data</i>, <a href="qt.html#DropAction-enum">Qt.DropAction</a> <i>action</i>)</h3><p>Handles the <i>data</i> supplied by a drag and drop operation that ended with the given <i>action</i> in the given <i>row</i> and <i>column</i>.</p>
<p>See also <a href="qtablewidget.html#supportedDropActions">supportedDropActions</a>().</p>
<h3 class="fn"><a name="editItem" />QTableWidget.editItem (<i>self</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>)</h3><p>Starts editing the <i>item</i> if it is editable.</p>
<h3 class="fn"><a name="event" />bool QTableWidget.event (<i>self</i>, <a href="qevent.html">QEvent</a> <i>e</i>)</h3><h3 class="fn"><a name="findItems" />QTableWidgetItem-list QTableWidget.findItems (<i>self</i>, <a href="qstring.html">QString</a> <i>text</i>, <a href="qt-matchflags.html">Qt.MatchFlags</a> <i>flags</i>)</h3><p>Finds items that matches the <i>text</i> using the given <i>flags</i>.</p>
<h3 class="fn"><a name="horizontalHeaderItem" /><a href="qtablewidgetitem.html">QTableWidgetItem</a> QTableWidget.horizontalHeaderItem (<i>self</i>, int <i>column</i>)</h3><p>Returns the horizontal header item for column <i>column</i>.</p>
<p>See also <a href="qtablewidget.html#setHorizontalHeaderItem">setHorizontalHeaderItem</a>().</p>
<h3 class="fn"><a name="indexFromItem" /><a href="qmodelindex.html">QModelIndex</a> QTableWidget.indexFromItem (<i>self</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>)</h3><p>Returns the <a href="qmodelindex.html">QModelIndex</a> assocated with the given <i>item</i>.</p>
<h3 class="fn"><a name="insertColumn" />QTableWidget.insertColumn (<i>self</i>, int <i>column</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void insertColumn(int)</tt>.</p><p>Inserts an empty column into the table at <i>column</i>.</p>
<h3 class="fn"><a name="insertRow" />QTableWidget.insertRow (<i>self</i>, int <i>row</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void insertRow(int)</tt>.</p><p>Inserts an empty row into the table at <i>row</i>.</p>
<h3 class="fn"><a name="isItemSelected" />bool QTableWidget.isItemSelected (<i>self</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>)</h3><p>Returns true if the <i>item</i> is selected, otherwise returns false.</p>
<h3 class="fn"><a name="isSortingEnabled" />bool QTableWidget.isSortingEnabled (<i>self</i>)</h3><h3 class="fn"><a name="item" /><a href="qtablewidgetitem.html">QTableWidgetItem</a> QTableWidget.item (<i>self</i>, int <i>row</i>, int <i>column</i>)</h3><p>Returns the item for the given <i>row</i> and <i>column</i> if one has been set; otherwise returns 0.</p>
<p>See also <a href="qtablewidget.html#setItem">setItem</a>().</p>
<h3 class="fn"><a name="itemAt" /><a href="qtablewidgetitem.html">QTableWidgetItem</a> QTableWidget.itemAt (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</i>)</h3><p>Returns a pointer to the item at the given <i>point</i>, or returns 0 if the point is not covered by an item in the table widget.</p>
<p>See also <a href="qtablewidget.html#item">item</a>().</p>
<h3 class="fn"><a name="itemAt-2" /><a href="qtablewidgetitem.html">QTableWidgetItem</a> QTableWidget.itemAt (<i>self</i>, int <i>ax</i>, int <i>ay</i>)</h3><p>This is an overloaded member function, provided for convenience.</p>
<p>Returns the item at the position (<i>ax</i>, <i>ay</i>) in the table widget's coordinate system, or returns 0 if the specified point is not covered by an item in the table widget.</p>
<p>See also <a href="qtablewidget.html#item">item</a>().</p>
<h3 class="fn"><a name="itemFromIndex" /><a href="qtablewidgetitem.html">QTableWidgetItem</a> QTableWidget.itemFromIndex (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>Returns a pointer to the <a href="qtablewidgetitem.html">QTableWidgetItem</a> assocated with the given <i>index</i>.</p>
<h3 class="fn"><a name="itemPrototype" /><a href="qtablewidgetitem.html">QTableWidgetItem</a> QTableWidget.itemPrototype (<i>self</i>)</h3><p>Returns the item prototype used by the table.</p>
<p>Copies of the item prototype are returned by the createItem() function.</p>
<p>See also <a href="qtablewidget.html#setItemPrototype">setItemPrototype</a>().</p>
<h3 class="fn"><a name="items" />QTableWidgetItem-list QTableWidget.items (<i>self</i>, <a href="qmimedata.html">QMimeData</a> <i>data</i>)</h3><p>Returns a list of pointers to the items contained in the <i>data</i> object. If the object was not created by a <a href="qtreewidget.html">QTreeWidget</a> in the same process, the list is empty.</p>
<h3 class="fn"><a name="mimeData" /><a href="qmimedata.html">QMimeData</a> QTableWidget.mimeData (<i>self</i>, QTableWidgetItem-list <i>items</i>)</h3><p>The <i>QMimeData</i> result</p><p>Returns an object that contains a serialized description of the specified <i>items</i>. The format used to describe the items is obtained from the <a href="qtablewidget.html#mimeTypes">mimeTypes</a>() function.</p>
<p>If the list of items is empty, 0 is returned rather than a serialized empty list.</p>
<h3 class="fn"><a name="mimeTypes" /><a href="qstringlist.html">QStringList</a> QTableWidget.mimeTypes (<i>self</i>)</h3><p>Returns a list of MIME types that can be used to describe a list of tablewidget items.</p>
<p>See also <a href="qtablewidget.html#mimeData">mimeData</a>().</p>
<h3 class="fn"><a name="openPersistentEditor" />QTableWidget.openPersistentEditor (<i>self</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>)</h3><p>Opens an editor for the give <i>item</i>. The editor remains open after editing.</p>
<p>See also <a href="qtablewidget.html#closePersistentEditor">closePersistentEditor</a>().</p>
<h3 class="fn"><a name="removeColumn" />QTableWidget.removeColumn (<i>self</i>, int <i>column</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void removeColumn(int)</tt>.</p><p>Removes the column <i>column</i> and all its items from the table.</p>
<h3 class="fn"><a name="removeRow" />QTableWidget.removeRow (<i>self</i>, int <i>row</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void removeRow(int)</tt>.</p><p>Removes the row <i>row</i> and all its items from the table.</p>
<h3 class="fn"><a name="row" />int QTableWidget.row (<i>self</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>)</h3><p>Returns the row for the <i>item</i>.</p>
<h3 class="fn"><a name="rowCount" />int QTableWidget.rowCount (<i>self</i>)</h3><h3 class="fn"><a name="scrollToItem" />QTableWidget.scrollToItem (<i>self</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>, <a href="qabstractitemview.html#ScrollHint-enum">QAbstractItemView.ScrollHint</a> <i>hint</i> = QAbstractItemView.EnsureVisible)</h3><p>This method is also a Qt slot with the C++ signature <tt>void scrollToItem(const QTableWidgetItem *,QAbstractItemView::ScrollHint = QAbstractItemView.EnsureVisible)</tt>.</p><p>Scrolls the view if necessary to ensure that the <i>item</i> is visible. The <i>hint</i> parameter specifies more precisely where the <i>item</i> should be located after the operation.</p>
<h3 class="fn"><a name="selectedItems" />QTableWidgetItem-list QTableWidget.selectedItems (<i>self</i>)</h3><p>Returns a list of all selected items.</p>
<h3 class="fn"><a name="selectedRanges" />QTableWidgetSelectionRange-list QTableWidget.selectedRanges (<i>self</i>)</h3><p>Returns a list of all selected ranges.</p>
<p>See also <a href="qtablewidgetselectionrange.html">QTableWidgetSelectionRange</a>.</p>
<h3 class="fn"><a name="setCellWidget" />QTableWidget.setCellWidget (<i>self</i>, int <i>row</i>, int <i>column</i>, <a href="qwidget.html">QWidget</a> <i>widget</i>)</h3><p>Sets the <i>widget</i> to be displayed in the cell in the given <i>row</i> and <i>column</i>.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qtablewidget.html#cellWidget">cellWidget</a>().</p>
<h3 class="fn"><a name="setColumnCount" />QTableWidget.setColumnCount (<i>self</i>, int <i>columns</i>)</h3><h3 class="fn"><a name="setCurrentCell" />QTableWidget.setCurrentCell (<i>self</i>, int <i>row</i>, int <i>column</i>)</h3><p>Sets the current cell to be the cell at position (<i>row</i>, <i>column</i>).</p>
<p>Depending on the current selection mode, the cell may also be selected.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qtablewidget.html#setCurrentItem">setCurrentItem</a>(), <a href="qtablewidget.html#currentRow">currentRow</a>(), and <a href="qtablewidget.html#currentColumn">currentColumn</a>().</p>
<h3 class="fn"><a name="setCurrentItem" />QTableWidget.setCurrentItem (<i>self</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>)</h3><p>Sets the current item to <i>item</i>.</p>
<p>Depending on the current selection mode, the item may also be selected.</p>
<p>See also <a href="qtablewidget.html#currentItem">currentItem</a>() and <a href="qtablewidget.html#setCurrentCell">setCurrentCell</a>().</p>
<h3 class="fn"><a name="setHorizontalHeaderItem" />QTableWidget.setHorizontalHeaderItem (<i>self</i>, int <i>column</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>)</h3><p>The <i>item</i> argument has it's ownership transferred to Qt.</p><p>Sets the horizontal header item for column <i>column</i> to <i>item</i>.</p>
<p>See also <a href="qtablewidget.html#horizontalHeaderItem">horizontalHeaderItem</a>().</p>
<h3 class="fn"><a name="setHorizontalHeaderLabels" />QTableWidget.setHorizontalHeaderLabels (<i>self</i>, <a href="qstringlist.html">QStringList</a> <i>labels</i>)</h3><p>Sets the horizontal header labels using <i>labels</i>.</p>
<h3 class="fn"><a name="setItem" />QTableWidget.setItem (<i>self</i>, int <i>row</i>, int <i>column</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>)</h3><p>The <i>item</i> argument has it's ownership transferred to Qt.</p><p>Sets the item for the given <i>row</i> and <i>column</i> to <i>item</i>.</p>
<p>The table takes ownership of the item.</p>
<p>See also <a href="qtablewidget.html#item">item</a>() and <a href="qtablewidget.html#takeItem">takeItem</a>().</p>
<h3 class="fn"><a name="setItemPrototype" />QTableWidget.setItemPrototype (<i>self</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>)</h3><p>Sets the item prototype for the table to the specified <i>item</i>.</p>
<p>See also <a href="qtablewidget.html#itemPrototype">itemPrototype</a>().</p>
<h3 class="fn"><a name="setItemSelected" />QTableWidget.setItemSelected (<i>self</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>, bool <i>select</i>)</h3><p>Selects or deselects <i>item</i> depending on <i>select</i>.</p>
<p>See also <a href="qtablewidget.html#isItemSelected">isItemSelected</a>().</p>
<h3 class="fn"><a name="setRangeSelected" />QTableWidget.setRangeSelected (<i>self</i>, <a href="qtablewidgetselectionrange.html">QTableWidgetSelectionRange</a> <i>range</i>, bool <i>select</i>)</h3><p>Selects or deselects the <i>range</i> depending on <i>select</i>.</p>
<h3 class="fn"><a name="setRowCount" />QTableWidget.setRowCount (<i>self</i>, int <i>rows</i>)</h3><h3 class="fn"><a name="setSortingEnabled" />QTableWidget.setSortingEnabled (<i>self</i>, bool <i>enable</i>)</h3><h3 class="fn"><a name="setVerticalHeaderItem" />QTableWidget.setVerticalHeaderItem (<i>self</i>, int <i>row</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>)</h3><p>The <i>item</i> argument has it's ownership transferred to Qt.</p><p>Sets the vertical header item for row <i>row</i> to <i>item</i>.</p>
<p>See also <a href="qtablewidget.html#verticalHeaderItem">verticalHeaderItem</a>().</p>
<h3 class="fn"><a name="setVerticalHeaderLabels" />QTableWidget.setVerticalHeaderLabels (<i>self</i>, <a href="qstringlist.html">QStringList</a> <i>labels</i>)</h3><p>Sets the vertical header labels using <i>labels</i>.</p>
<h3 class="fn"><a name="sortItems" />QTableWidget.sortItems (<i>self</i>, int <i>column</i>, <a href="qt.html#SortOrder-enum">Qt.SortOrder</a> <i>order</i> = Qt.AscendingOrder)</h3><p>Sorts all the rows in the table widget based on <i>column</i> and <i>order</i>.</p>
<h3 class="fn"><a name="supportedDropActions" /><a href="qt-dropactions.html">Qt.DropActions</a> QTableWidget.supportedDropActions (<i>self</i>)</h3><p>Returns the drop actions supported by this view.</p>
<p>See also <a href="qt.html#DropAction-enum">Qt.DropActions</a>.</p>
<h3 class="fn"><a name="takeHorizontalHeaderItem" /><a href="qtablewidgetitem.html">QTableWidgetItem</a> QTableWidget.takeHorizontalHeaderItem (<i>self</i>, int <i>column</i>)</h3><p>The <i>QTableWidgetItem</i> result</p><p>Removes the horizontal header item at <i>column</i> from the header without deleting it.</p>
<p>This function was introduced in Qt 4.1.</p>
<h3 class="fn"><a name="takeItem" /><a href="qtablewidgetitem.html">QTableWidgetItem</a> QTableWidget.takeItem (<i>self</i>, int <i>row</i>, int <i>column</i>)</h3><p>The <i>QTableWidgetItem</i> result</p><p>Removes the item at <i>row</i> and <i>column</i> from the table without deleting it.</p>
<h3 class="fn"><a name="takeVerticalHeaderItem" /><a href="qtablewidgetitem.html">QTableWidgetItem</a> QTableWidget.takeVerticalHeaderItem (<i>self</i>, int <i>row</i>)</h3><p>The <i>QTableWidgetItem</i> result</p><p>Removes the vertical header item at <i>row</i> from the header without deleting it.</p>
<p>This function was introduced in Qt 4.1.</p>
<h3 class="fn"><a name="verticalHeaderItem" /><a href="qtablewidgetitem.html">QTableWidgetItem</a> QTableWidget.verticalHeaderItem (<i>self</i>, int <i>row</i>)</h3><p>Returns the vertical header item for row <i>row</i>.</p>
<p>See also <a href="qtablewidget.html#setVerticalHeaderItem">setVerticalHeaderItem</a>().</p>
<h3 class="fn"><a name="visualColumn" />int QTableWidget.visualColumn (<i>self</i>, int <i>logicalColumn</i>)</h3><p>Returns the visual column of the given <i>logicalColumn</i>.</p>
<h3 class="fn"><a name="visualItemRect" /><a href="qrect.html">QRect</a> QTableWidget.visualItemRect (<i>self</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a> <i>item</i>)</h3><p>Returns the rectangle on the viewport occupied by the item at <i>item</i>.</p>
<h3 class="fn"><a name="visualRow" />int QTableWidget.visualRow (<i>self</i>, int <i>logicalRow</i>)</h3><p>Returns the visual row of the given <i>logicalRow</i>.</p>
<hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="cellActivated" />void cellActivated (int,int)</h3><p>This signal is emitted when the cell specified by <i>row</i> and <i>column</i> has been activated</p>
<p>This function was introduced in Qt 4.1.</p>
<h3 class="fn"><a name="cellChanged" />void cellChanged (int,int)</h3><p>This signal is emitted whenever the data of the item in the cell specidied by <i>row</i> and <i>column</i> has changed.</p>
<p>This function was introduced in Qt 4.1.</p>
<h3 class="fn"><a name="cellClicked" />void cellClicked (int,int)</h3><p>This signal is emitted whenever a cell in the table is clicked. The <i>row</i> and <i>column</i> specified is the cell that was clicked.</p>
<p>This function was introduced in Qt 4.1.</p>
<h3 class="fn"><a name="cellDoubleClicked" />void cellDoubleClicked (int,int)</h3><p>This signal is emitted whenever a cell in the table is double clicked. The <i>row</i> and <i>column</i> specified is the cell that was double clicked.</p>
<p>This function was introduced in Qt 4.1.</p>
<h3 class="fn"><a name="cellEntered" />void cellEntered (int,int)</h3><p>This signal is emitted when the mouse cursor enters a cell. The cell is specified by <i>row</i> and <i>column</i>.</p>
<p>This signal is only emitted when <a href="qwidget.html#mouseTracking-prop">mouseTracking</a> is turned on, or when a mouse button is pressed while moving into an item.</p>
<p>This function was introduced in Qt 4.1.</p>
<h3 class="fn"><a name="cellPressed" />void cellPressed (int,int)</h3><p>This signal is emitted whenever a cell the table is pressed. The <i>row</i> and <i>column</i> specified is the cell that was pressed.</p>
<p>This function was introduced in Qt 4.1.</p>
<h3 class="fn"><a name="currentCellChanged" />void currentCellChanged (int,int,int,int)</h3><p>This signal is emitted whenever the current cell changes. The cell specified by <i>previousRow</i> and <i>previousColumn</i> is the cell that previously had the focus, the cell specified by <i>currentRow</i> and <i>currentColumn</i> is the new current cell.</p>
<p>This function was introduced in Qt 4.1.</p>
<h3 class="fn"><a name="currentItemChanged" />void currentItemChanged (QTableWidgetItem *,QTableWidgetItem *)</h3><p>This signal is emitted whenever the current item changes. The <i>previous</i> item is the item that previously had the focus, <i>current</i> is the new current item.</p>
<h3 class="fn"><a name="itemActivated" />void itemActivated (QTableWidgetItem *)</h3><p>This signal is emitted when the specified <i>item</i> has been activated</p>
<h3 class="fn"><a name="itemChanged" />void itemChanged (QTableWidgetItem *)</h3><p>This signal is emitted whenever the data of <i>item</i> has changed.</p>
<h3 class="fn"><a name="itemClicked" />void itemClicked (QTableWidgetItem *)</h3><p>This signal is emitted whenever an item in the table is clicked. The <i>item</i> specified is the item that was clicked.</p>
<h3 class="fn"><a name="itemDoubleClicked" />void itemDoubleClicked (QTableWidgetItem *)</h3><p>This signal is emitted whenever an item in the table is double clicked. The <i>item</i> specified is the item that was double clicked.</p>
<h3 class="fn"><a name="itemEntered" />void itemEntered (QTableWidgetItem *)</h3><p>This signal is emitted when the mouse cursor enters an item. The <i>item</i> is the item entered.</p>
<p>This signal is only emitted when <a href="qwidget.html#mouseTracking-prop">mouseTracking</a> is turned on, or when a mouse button is pressed while moving into an item.</p>
<h3 class="fn"><a name="itemPressed" />void itemPressed (QTableWidgetItem *)</h3><p>This signal is emitted whenever an item in the table is pressed. The <i>item</i> specified is the item that was pressed.</p>
<h3 class="fn"><a name="itemSelectionChanged" />void itemSelectionChanged ()</h3><p>This signal is emitted whenever the selection changes.</p>
<p>See also <a href="qtablewidget.html#selectedItems">selectedItems</a>() and <a href="qtablewidget.html#isItemSelected">isItemSelected</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td width="25%">PyQt 4.0.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.trolltech.com">Trolltech AS</a> 2006</td><td align="right" width="25%">Qt 4.1.4</td></tr></table></div></address></body></html>
|