File: qtableview.html

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (208 lines) | stat: -rw-r--r-- 42,511 bytes parent folder | download
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<?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>QTableView 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">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QTableView Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QTableView class provides a default model/view implementation of a table view. <a href="#details">More...</a></p>
<p>Inherits <a href="qabstractitemview.html">QAbstractItemView</a>.</p><p>Inherited by <a href="qtablewidget.html">QTableWidget</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtableview.html#QTableView">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qtableview.html#clearSpans">clearSpans</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtableview.html#columnAt">columnAt</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtableview.html#columnCountChanged">columnCountChanged</a></b> (<i>self</i>, int, int)</li><li><div class="fn" /><b><a href="qtableview.html#columnMoved">columnMoved</a></b> (<i>self</i>, int, int, int)</li><li><div class="fn" /><b><a href="qtableview.html#columnResized">columnResized</a></b> (<i>self</i>, int, int, int)</li><li><div class="fn" />int <b><a href="qtableview.html#columnSpan">columnSpan</a></b> (<i>self</i>, int, int)</li><li><div class="fn" />int <b><a href="qtableview.html#columnViewportPosition">columnViewportPosition</a></b> (<i>self</i>, int)</li><li><div class="fn" />int <b><a href="qtableview.html#columnWidth">columnWidth</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtableview.html#currentChanged">currentChanged</a></b> (<i>self</i>, QModelIndex, QModelIndex)</li><li><div class="fn" />Qt.PenStyle <b><a href="qtableview.html#gridStyle">gridStyle</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtableview.html#hideColumn">hideColumn</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtableview.html#hideRow">hideRow</a></b> (<i>self</i>, int)</li><li><div class="fn" />QHeaderView <b><a href="qtableview.html#horizontalHeader">horizontalHeader</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtableview.html#horizontalOffset">horizontalOffset</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtableview.html#horizontalScrollbarAction">horizontalScrollbarAction</a></b> (<i>self</i>, int)</li><li><div class="fn" />QModelIndex <b><a href="qtableview.html#indexAt">indexAt</a></b> (<i>self</i>, QPoint)</li><li><div class="fn" />bool <b><a href="qtableview.html#isColumnHidden">isColumnHidden</a></b> (<i>self</i>, int)</li><li><div class="fn" />bool <b><a href="qtableview.html#isCornerButtonEnabled">isCornerButtonEnabled</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtableview.html#isIndexHidden">isIndexHidden</a></b> (<i>self</i>, QModelIndex)</li><li><div class="fn" />bool <b><a href="qtableview.html#isRowHidden">isRowHidden</a></b> (<i>self</i>, int)</li><li><div class="fn" />bool <b><a href="qtableview.html#isSortingEnabled">isSortingEnabled</a></b> (<i>self</i>)</li><li><div class="fn" />QModelIndex <b><a href="qtableview.html#moveCursor">moveCursor</a></b> (<i>self</i>, QAbstractItemView.CursorAction, Qt.KeyboardModifiers)</li><li><div class="fn" /><b><a href="qtableview.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent)</li><li><div class="fn" /><b><a href="qtableview.html#resizeColumnsToContents">resizeColumnsToContents</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtableview.html#resizeColumnToContents">resizeColumnToContents</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtableview.html#resizeRowsToContents">resizeRowsToContents</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtableview.html#resizeRowToContents">resizeRowToContents</a></b> (<i>self</i>, int)</li><li><div class="fn" />int <b><a href="qtableview.html#rowAt">rowAt</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtableview.html#rowCountChanged">rowCountChanged</a></b> (<i>self</i>, int, int)</li><li><div class="fn" />int <b><a href="qtableview.html#rowHeight">rowHeight</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtableview.html#rowMoved">rowMoved</a></b> (<i>self</i>, int, int, int)</li><li><div class="fn" /><b><a href="qtableview.html#rowResized">rowResized</a></b> (<i>self</i>, int, int, int)</li><li><div class="fn" />int <b><a href="qtableview.html#rowSpan">rowSpan</a></b> (<i>self</i>, int, int)</li><li><div class="fn" />int <b><a href="qtableview.html#rowViewportPosition">rowViewportPosition</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtableview.html#scrollContentsBy">scrollContentsBy</a></b> (<i>self</i>, int, int)</li><li><div class="fn" /><b><a href="qtableview.html#scrollTo">scrollTo</a></b> (<i>self</i>, QModelIndex, QAbstractItemView.ScrollHint&#160;<i>hint</i>&#160;=&#160;QAbstractItemView.EnsureVisible)</li><li><div class="fn" /><b><a href="qtableview.html#selectColumn">selectColumn</a></b> (<i>self</i>, int)</li><li><div class="fn" />list-of-QModelIndex <b><a href="qtableview.html#selectedIndexes">selectedIndexes</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtableview.html#selectionChanged">selectionChanged</a></b> (<i>self</i>, QItemSelection, QItemSelection)</li><li><div class="fn" /><b><a href="qtableview.html#selectRow">selectRow</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtableview.html#setColumnHidden">setColumnHidden</a></b> (<i>self</i>, int, bool)</li><li><div class="fn" /><b><a href="qtableview.html#setColumnWidth">setColumnWidth</a></b> (<i>self</i>, int, int)</li><li><div class="fn" /><b><a href="qtableview.html#setCornerButtonEnabled">setCornerButtonEnabled</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtableview.html#setGridStyle">setGridStyle</a></b> (<i>self</i>, Qt.PenStyle)</li><li><div class="fn" /><b><a href="qtableview.html#setHorizontalHeader">setHorizontalHeader</a></b> (<i>self</i>, QHeaderView)</li><li><div class="fn" /><b><a href="qtableview.html#setModel">setModel</a></b> (<i>self</i>, QAbstractItemModel)</li><li><div class="fn" /><b><a href="qtableview.html#setRootIndex">setRootIndex</a></b> (<i>self</i>, QModelIndex)</li><li><div class="fn" /><b><a href="qtableview.html#setRowHeight">setRowHeight</a></b> (<i>self</i>, int, int)</li><li><div class="fn" /><b><a href="qtableview.html#setRowHidden">setRowHidden</a></b> (<i>self</i>, int, bool)</li><li><div class="fn" /><b><a href="qtableview.html#setSelection">setSelection</a></b> (<i>self</i>, QRect, QItemSelectionModel.SelectionFlags)</li><li><div class="fn" /><b><a href="qtableview.html#setSelectionModel">setSelectionModel</a></b> (<i>self</i>, QItemSelectionModel)</li><li><div class="fn" /><b><a href="qtableview.html#setShowGrid">setShowGrid</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtableview.html#setSortingEnabled">setSortingEnabled</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtableview.html#setSpan">setSpan</a></b> (<i>self</i>, int, int, int, int)</li><li><div class="fn" /><b><a href="qtableview.html#setVerticalHeader">setVerticalHeader</a></b> (<i>self</i>, QHeaderView)</li><li><div class="fn" /><b><a href="qtableview.html#setWordWrap">setWordWrap</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtableview.html#showColumn">showColumn</a></b> (<i>self</i>, int)</li><li><div class="fn" />bool <b><a href="qtableview.html#showGrid">showGrid</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtableview.html#showRow">showRow</a></b> (<i>self</i>, int)</li><li><div class="fn" />int <b><a href="qtableview.html#sizeHintForColumn">sizeHintForColumn</a></b> (<i>self</i>, int)</li><li><div class="fn" />int <b><a href="qtableview.html#sizeHintForRow">sizeHintForRow</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtableview.html#sortByColumn">sortByColumn</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtableview.html#sortByColumn-2">sortByColumn</a></b> (<i>self</i>, int, Qt.SortOrder)</li><li><div class="fn" /><b><a href="qtableview.html#timerEvent">timerEvent</a></b> (<i>self</i>, QTimerEvent)</li><li><div class="fn" /><b><a href="qtableview.html#updateGeometries">updateGeometries</a></b> (<i>self</i>)</li><li><div class="fn" />QHeaderView <b><a href="qtableview.html#verticalHeader">verticalHeader</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtableview.html#verticalOffset">verticalOffset</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtableview.html#verticalScrollbarAction">verticalScrollbarAction</a></b> (<i>self</i>, int)</li><li><div class="fn" />QStyleOptionViewItem <b><a href="qtableview.html#viewOptions">viewOptions</a></b> (<i>self</i>)</li><li><div class="fn" />QRect <b><a href="qtableview.html#visualRect">visualRect</a></b> (<i>self</i>, QModelIndex)</li><li><div class="fn" />QRegion <b><a href="qtableview.html#visualRegionForSelection">visualRegionForSelection</a></b> (<i>self</i>, QItemSelection)</li><li><div class="fn" />bool <b><a href="qtableview.html#wordWrap">wordWrap</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTableView class provides a default model/view implementation of a table view.</p>
<p>A QTableView implements a table view that displays items from a model. This class is used to provide standard tables that were previously provided by the <a href="porting4.html#qtable">QTable</a> class, but using the more flexible approach provided by Qt's model/view architecture.</p>
<p>The QTableView class is one of the <a href="model-view.html">Model/View Classes</a> and is part of Qt's <a href="model-view-programming.html">model/view framework</a>.</p>
<p>QTableView implements the interfaces defined by the <a href="qabstractitemview.html">QAbstractItemView</a> class to allow it to display data provided by models derived from the <a href="qabstractitemmodel.html">QAbstractItemModel</a> class.</p>
<a name="navigation" />
<h3>Navigation</h3>
<p>You can navigate the cells in the table by clicking on a cell with the mouse, or by using the arrow keys. Because QTableView enables <a href="qabstractitemview.html#tabKeyNavigation-prop">tabKeyNavigation</a> by default, you can also hit Tab and Backtab to move from cell to cell.</p>
<a name="visual-appearance" />
<h3>Visual Appearance</h3>
<p>The table has a vertical header that can be obtained using the <a href="qtableview.html#verticalHeader">verticalHeader</a>() function, and a horizontal header that is available through the <a href="qtableview.html#horizontalHeader">horizontalHeader</a>() function. The height of each row in the table can be found by using <a href="qtableview.html#rowHeight">rowHeight</a>(); similarly, the width of columns can be found using <a href="qtableview.html#columnWidth">columnWidth</a>(). Since both of these are plain widgets, you can hide either of them using their <a href="qwidget.html#hide">hide</a>() functions.</p>
<p>Rows and columns can be hidden and shown with <a href="qtableview.html#hideRow">hideRow</a>(), <a href="qtableview.html#hideColumn">hideColumn</a>(), <a href="qtableview.html#showRow">showRow</a>(), and <a href="qtableview.html#showColumn">showColumn</a>(). They can be selected with <a href="qtableview.html#selectRow">selectRow</a>() and <a href="qtableview.html#selectColumn">selectColumn</a>(). The table will show a grid depending on the <a href="qtableview.html#showGrid-prop">showGrid</a> property.</p>
<p>The items shown in a table view, like those in the other item views, are rendered and edited using standard <a href="qitemdelegate.html">delegates</a>. However, for some tasks it is sometimes useful to be able to insert widgets in a table instead. Widgets are set for particular indexes with the <a href="qabstractitemview.html#setIndexWidget">setIndexWidget()</a> function, and later retrieved with <a href="qabstractitemview.html#indexWidget">indexWidget()</a>.</p>
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic">
<tr class="odd" valign="top"><td><img src="images/qtableview-resized.png" /></td><td>By default, the cells in a table do not expand to fill the available space.<p>You can make the cells fill the available space by stretching the last header section. Access the relevant header using <a href="qtableview.html#horizontalHeader">horizontalHeader</a>() or <a href="qtableview.html#verticalHeader">verticalHeader</a>() and set the header's <a href="qheaderview.html#stretchLastSection-prop">stretchLastSection</a> property.</p>
<p>To distribute the available space according to the space requirement of each column or row, call the view's <a href="qtableview.html#resizeColumnsToContents">resizeColumnsToContents</a>() or <a href="qtableview.html#resizeRowsToContents">resizeRowsToContents</a>() functions.</p>
</td></tr>
</table></p>
<a name="coordinate-systems" />
<h3>Coordinate Systems</h3>
<p>For some specialized forms of tables it is useful to be able to convert between row and column indexes and widget coordinates. The <a href="qtableview.html#rowAt">rowAt</a>() function provides the y-coordinate within the view of the specified row; the row index can be used to obtain a corresponding y-coordinate with <a href="qtableview.html#rowViewportPosition">rowViewportPosition</a>(). The <a href="qtableview.html#columnAt">columnAt</a>() and <a href="qtableview.html#columnViewportPosition">columnViewportPosition</a>() functions provide the equivalent conversion operations between x-coordinates and column indexes.</p>
<a name="styles" />
<h3>Styles</h3>
<p>QTableView is styled appropriately for each platform. The following images show how it looks on three different platforms. Go to the <a href="gallery.html">Qt Widget Gallery</a> to see its appearance in other styles.</p>
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic" width="100%">
<tr class="odd" valign="top"><td><img alt="Screenshot of a Windows XP style table view" src="images/windowsxp-tableview.png" /></td><td><img alt="Screenshot of a Macintosh style table view" src="images/macintosh-tableview.png" /></td><td><img alt="Screenshot of a Plastique style table view" src="images/plastique-tableview.png" /></td></tr>
<tr class="even" valign="top"><td>A <a href="gallery-windowsxp.html">Windows XP style</a> table view.</td><td>A <a href="gallery-macintosh.html">Macintosh style</a> table view.</td><td>A <a href="gallery-plastique.html">Plastique style</a> table view.</td></tr>
</table></p>
<p>See also <a href="qtablewidget.html">QTableWidget</a>, <a href="model-view-view.html">View Classes</a>, <a href="qabstractitemmodel.html">QAbstractItemModel</a>, <a href="qabstractitemview.html">QAbstractItemView</a>, <a href="itemviews-chart.html">Chart Example</a>, <a href="itemviews-pixelator.html">Pixelator Example</a>, and <a href="sql-tablemodel.html">Table Model Example</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTableView" />QTableView.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;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>Constructs a table view with a <i>parent</i> to represent the data.</p>
<p>See also <a href="qabstractitemmodel.html">QAbstractItemModel</a>.</p>
<a name="//apple_ref/cpp/instm/QTableView/~QTableView" />
<h3 class="fn"><a name="clearSpans" />QTableView.clearSpans (<i>self</i>)</h3><p>Removes all row and column spans in the table view.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qtableview.html#setSpan">setSpan</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/columnAt" />
<h3 class="fn"><a name="columnAt" />int QTableView.columnAt (<i>self</i>, int)</h3><p>Returns the column in which the given x-coordinate, <i>x</i>, in contents coordinates is located.</p>
<p><b>Note:</b> This function returns -1 if the given coordinate is not valid (has no column).</p>
<p>See also <a href="qtableview.html#rowAt">rowAt</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/columnCountChanged" />
<h3 class="fn"><a name="columnCountChanged" />QTableView.columnCountChanged (<i>self</i>, int, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void columnCountChanged(int,int)</tt>.</p><p>This slot is called whenever columns are added or deleted. The previous number of columns is specified by <i>oldCount</i>, and the new number of columns is specified by <i>newCount</i>.</p>
<a name="//apple_ref/cpp/instm/QTableView/columnMoved" />
<h3 class="fn"><a name="columnMoved" />QTableView.columnMoved (<i>self</i>, int, int, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void columnMoved(int,int,int)</tt>.</p><p>This slot is called to change the index of the given <i>column</i> in the table view. The old index is specified by <i>oldIndex</i>, and the new index by <i>newIndex</i>.</p>
<p>See also <a href="qtableview.html#rowMoved">rowMoved</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/columnResized" />
<h3 class="fn"><a name="columnResized" />QTableView.columnResized (<i>self</i>, int, int, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void columnResized(int,int,int)</tt>.</p><p>This slot is called to change the width of the given <i>column</i>. The old width is specified by <i>oldWidth</i>, and the new width by <i>newWidth</i>.</p>
<p>See also <a href="qtableview.html#rowResized">rowResized</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/columnSpan" />
<h3 class="fn"><a name="columnSpan" />int QTableView.columnSpan (<i>self</i>, int, int)</h3><p>Returns the column span of the table element at (<i>row</i>, <i>column</i>). The default is 1.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtableview.html#setSpan">setSpan</a>() and <a href="qtableview.html#rowSpan">rowSpan</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/columnViewportPosition" />
<h3 class="fn"><a name="columnViewportPosition" />int QTableView.columnViewportPosition (<i>self</i>, int)</h3><p>Returns the x-coordinate in contents coordinates of the given <i>column</i>.</p>
<a name="//apple_ref/cpp/instm/QTableView/columnWidth" />
<h3 class="fn"><a name="columnWidth" />int QTableView.columnWidth (<i>self</i>, int)</h3><p>Returns the width of the given <i>column</i>.</p>
<p>See also <a href="qtableview.html#setColumnWidth">setColumnWidth</a>(), <a href="qtableview.html#resizeColumnToContents">resizeColumnToContents</a>(), and <a href="qtableview.html#rowHeight">rowHeight</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/currentChanged" />
<h3 class="fn"><a name="currentChanged" />QTableView.currentChanged (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>Reimplemented from <a href="qabstractitemview.html#currentChanged">QAbstractItemView.currentChanged</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/hideColumn" />
<h3 class="fn"><a name="gridStyle" /><a href="qt.html#PenStyle-enum">Qt.PenStyle</a> QTableView.gridStyle (<i>self</i>)</h3><h3 class="fn"><a name="hideColumn" />QTableView.hideColumn (<i>self</i>, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void hideColumn(int)</tt>.</p><p>Hide the given <i>column</i>.</p>
<p>See also <a href="qtableview.html#showColumn">showColumn</a>() and <a href="qtableview.html#hideRow">hideRow</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/hideRow" />
<h3 class="fn"><a name="hideRow" />QTableView.hideRow (<i>self</i>, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void hideRow(int)</tt>.</p><p>Hide the given <i>row</i>.</p>
<p>See also <a href="qtableview.html#showRow">showRow</a>() and <a href="qtableview.html#hideColumn">hideColumn</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/horizontalHeader" />
<h3 class="fn"><a name="horizontalHeader" /><a href="qheaderview.html">QHeaderView</a> QTableView.horizontalHeader (<i>self</i>)</h3><p>Returns the table view's horizontal header.</p>
<p>See also <a href="qtableview.html#setHorizontalHeader">setHorizontalHeader</a>(), <a href="qtableview.html#verticalHeader">verticalHeader</a>(), and <a href="qabstractitemmodel.html#headerData">QAbstractItemModel.headerData</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/horizontalOffset" />
<h3 class="fn"><a name="horizontalOffset" />int QTableView.horizontalOffset (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemview.html#horizontalOffset">QAbstractItemView.horizontalOffset</a>().</p>
<p>Returns the horizontal offset of the items in the table view.</p>
<p>Note that the table view uses the horizontal header section positions to determine the positions of columns in the view.</p>
<p>See also <a href="qtableview.html#verticalOffset">verticalOffset</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/indexAt" />
<h3 class="fn"><a name="horizontalScrollbarAction" />QTableView.horizontalScrollbarAction (<i>self</i>, int)</h3><h3 class="fn"><a name="indexAt" /><a href="qmodelindex.html">QModelIndex</a> QTableView.indexAt (<i>self</i>, <a href="qpoint.html">QPoint</a>)</h3><p>Reimplemented from <a href="qabstractitemview.html#indexAt">QAbstractItemView.indexAt</a>().</p>
<p>Returns the index position of the model item corresponding to the table item at position <i>pos</i> in contents coordinates.</p>
<a name="//apple_ref/cpp/instm/QTableView/isColumnHidden" />
<h3 class="fn"><a name="isColumnHidden" />bool QTableView.isColumnHidden (<i>self</i>, int)</h3><p>Returns true if the given <i>column</i> is hidden; otherwise returns false.</p>
<p>See also <a href="qtableview.html#isRowHidden">isRowHidden</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/isIndexHidden" />
<h3 class="fn"><a name="isCornerButtonEnabled" />bool QTableView.isCornerButtonEnabled (<i>self</i>)</h3><h3 class="fn"><a name="isIndexHidden" />bool QTableView.isIndexHidden (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>Reimplemented from <a href="qabstractitemview.html#isIndexHidden">QAbstractItemView.isIndexHidden</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/isRowHidden" />
<h3 class="fn"><a name="isRowHidden" />bool QTableView.isRowHidden (<i>self</i>, int)</h3><p>Returns true if the given <i>row</i> is hidden; otherwise returns false.</p>
<p>See also <a href="qtableview.html#isColumnHidden">isColumnHidden</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/moveCursor" />
<h3 class="fn"><a name="isSortingEnabled" />bool QTableView.isSortingEnabled (<i>self</i>)</h3><h3 class="fn"><a name="moveCursor" /><a href="qmodelindex.html">QModelIndex</a> QTableView.moveCursor (<i>self</i>, <a href="qabstractitemview.html#CursorAction-enum">QAbstractItemView.CursorAction</a>, <a href="qt-keyboardmodifiers.html">Qt.KeyboardModifiers</a>)</h3><p>Reimplemented from <a href="qabstractitemview.html#moveCursor">QAbstractItemView.moveCursor</a>().</p>
<p>Moves the cursor in accordance with the given <i>cursorAction</i>, using the information provided by the <i>modifiers</i>.</p>
<p>See also <a href="qabstractitemview.html#CursorAction-enum">QAbstractItemView.CursorAction</a>.</p>
<a name="//apple_ref/cpp/instm/QTableView/paintEvent" />
<h3 class="fn"><a name="paintEvent" />QTableView.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget.paintEvent</a>().</p>
<p>Paints the table on receipt of the given paint event <i>event</i>.</p>
<a name="//apple_ref/cpp/instm/QTableView/resizeColumnToContents" />
<h3 class="fn"><a name="resizeColumnsToContents" />QTableView.resizeColumnsToContents (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void resizeColumnsToContents()</tt>.</p><p>Resizes all columns based on the size hints of the delegate used to render each item in the columns.</p>
<a name="//apple_ref/cpp/instm/QTableView/resizeRowToContents" />
<h3 class="fn"><a name="resizeColumnToContents" />QTableView.resizeColumnToContents (<i>self</i>, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void resizeColumnToContents(int)</tt>.</p><p>Resizes the given <i>column</i> based on the size hints of the delegate used to render each item in the column.</p>
<p><b>Note:</b> Only visible columns will be resized. Reimplement <a href="qtableview.html#sizeHintForColumn">sizeHintForColumn</a>() to resize hidden columns as well.</p>
<a name="//apple_ref/cpp/instm/QTableView/resizeColumnsToContents" />
<h3 class="fn"><a name="resizeRowsToContents" />QTableView.resizeRowsToContents (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void resizeRowsToContents()</tt>.</p><p>Resizes all rows based on the size hints of the delegate used to render each item in the rows.</p>
<a name="//apple_ref/cpp/instm/QTableView/rowAt" />
<h3 class="fn"><a name="resizeRowToContents" />QTableView.resizeRowToContents (<i>self</i>, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void resizeRowToContents(int)</tt>.</p><p>Resizes the given <i>row</i> based on the size hints of the delegate used to render each item in the row.</p>
<a name="//apple_ref/cpp/instm/QTableView/resizeRowsToContents" />
<h3 class="fn"><a name="rowAt" />int QTableView.rowAt (<i>self</i>, int)</h3><p>Returns the row in which the given y-coordinate, <i>y</i>, in contents coordinates is located.</p>
<p><b>Note:</b> This function returns -1 if the given coordinate is not valid (has no row).</p>
<p>See also <a href="qtableview.html#columnAt">columnAt</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/rowCountChanged" />
<h3 class="fn"><a name="rowCountChanged" />QTableView.rowCountChanged (<i>self</i>, int, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void rowCountChanged(int,int)</tt>.</p><p>This slot is called whenever rows are added or deleted. The previous number of rows is specified by <i>oldCount</i>, and the new number of rows is specified by <i>newCount</i>.</p>
<a name="//apple_ref/cpp/instm/QTableView/rowHeight" />
<h3 class="fn"><a name="rowHeight" />int QTableView.rowHeight (<i>self</i>, int)</h3><p>Returns the height of the given <i>row</i>.</p>
<p>See also <a href="qtableview.html#setRowHeight">setRowHeight</a>(), <a href="qtableview.html#resizeRowToContents">resizeRowToContents</a>(), and <a href="qtableview.html#columnWidth">columnWidth</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/rowMoved" />
<h3 class="fn"><a name="rowMoved" />QTableView.rowMoved (<i>self</i>, int, int, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void rowMoved(int,int,int)</tt>.</p><p>This slot is called to change the index of the given <i>row</i> in the table view. The old index is specified by <i>oldIndex</i>, and the new index by <i>newIndex</i>.</p>
<p>See also <a href="qtableview.html#columnMoved">columnMoved</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/rowResized" />
<h3 class="fn"><a name="rowResized" />QTableView.rowResized (<i>self</i>, int, int, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void rowResized(int,int,int)</tt>.</p><p>This slot is called to change the height of the given <i>row</i>. The old height is specified by <i>oldHeight</i>, and the new height by <i>newHeight</i>.</p>
<p>See also <a href="qtableview.html#columnResized">columnResized</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/rowSpan" />
<h3 class="fn"><a name="rowSpan" />int QTableView.rowSpan (<i>self</i>, int, int)</h3><p>Returns the row span of the table element at (<i>row</i>, <i>column</i>). The default is 1.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtableview.html#setSpan">setSpan</a>() and <a href="qtableview.html#columnSpan">columnSpan</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/rowViewportPosition" />
<h3 class="fn"><a name="rowViewportPosition" />int QTableView.rowViewportPosition (<i>self</i>, int)</h3><p>Returns the y-coordinate in contents coordinates of the given <i>row</i>.</p>
<a name="//apple_ref/cpp/instm/QTableView/selectColumn" />
<h3 class="fn"><a name="scrollContentsBy" />QTableView.scrollContentsBy (<i>self</i>, int, int)</h3><h3 class="fn"><a name="scrollTo" />QTableView.scrollTo (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>, <a href="qabstractitemview.html#ScrollHint-enum">QAbstractItemView.ScrollHint</a>&#160;<i>hint</i>&#160;=&#160;QAbstractItemView.EnsureVisible)</h3><h3 class="fn"><a name="selectColumn" />QTableView.selectColumn (<i>self</i>, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void selectColumn(int)</tt>.</p><p>Selects the given <i>column</i> in the table view if the current <a href="qabstractitemview.html#SelectionMode-enum">SelectionMode</a> and <a href="qabstractitemview.html#SelectionBehavior-enum">SelectionBehavior</a> allows columns to be selected.</p>
<p>See also <a href="qtableview.html#selectRow">selectRow</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/selectRow" />
<h3 class="fn"><a name="selectedIndexes" />list-of-QModelIndex QTableView.selectedIndexes (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemview.html#selectedIndexes">QAbstractItemView.selectedIndexes</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/selectionChanged" />
<h3 class="fn"><a name="selectionChanged" />QTableView.selectionChanged (<i>self</i>, <a href="qitemselection.html">QItemSelection</a>, <a href="qitemselection.html">QItemSelection</a>)</h3><p>Reimplemented from <a href="qabstractitemview.html#selectionChanged">QAbstractItemView.selectionChanged</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/setColumnHidden" />
<h3 class="fn"><a name="selectRow" />QTableView.selectRow (<i>self</i>, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void selectRow(int)</tt>.</p><p>Selects the given <i>row</i> in the table view if the current <a href="qabstractitemview.html#SelectionMode-enum">SelectionMode</a> and <a href="qabstractitemview.html#SelectionBehavior-enum">SelectionBehavior</a> allows rows to be selected.</p>
<p>See also <a href="qtableview.html#selectColumn">selectColumn</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/selectedIndexes" />
<h3 class="fn"><a name="setColumnHidden" />QTableView.setColumnHidden (<i>self</i>, int, bool)</h3><p>If <i>hide</i> is true the given <i>column</i> will be hidden; otherwise it will be shown.</p>
<p>See also <a href="qtableview.html#isColumnHidden">isColumnHidden</a>() and <a href="qtableview.html#setRowHidden">setRowHidden</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/setColumnWidth" />
<h3 class="fn"><a name="setColumnWidth" />QTableView.setColumnWidth (<i>self</i>, int, int)</h3><p>Sets the width of the given <i>column</i> to be <i>width</i>.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qtableview.html#columnWidth">columnWidth</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/setHorizontalHeader" />
<h3 class="fn"><a name="setCornerButtonEnabled" />QTableView.setCornerButtonEnabled (<i>self</i>, bool)</h3><h3 class="fn"><a name="setGridStyle" />QTableView.setGridStyle (<i>self</i>, <a href="qt.html#PenStyle-enum">Qt.PenStyle</a>)</h3><h3 class="fn"><a name="setHorizontalHeader" />QTableView.setHorizontalHeader (<i>self</i>, <a href="qheaderview.html">QHeaderView</a>)</h3><p>The <i>QHeaderView</i> argument has it's ownership transferred to Qt.</p><p>Sets the widget to use for the horizontal header to <i>header</i>.</p>
<p>See also <a href="qtableview.html#horizontalHeader">horizontalHeader</a>() and <a href="qtableview.html#setVerticalHeader">setVerticalHeader</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/setModel" />
<h3 class="fn"><a name="setModel" />QTableView.setModel (<i>self</i>, <a href="qabstractitemmodel.html">QAbstractItemModel</a>)</h3><p>Reimplemented from <a href="qabstractitemview.html#setModel">QAbstractItemView.setModel</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/setRootIndex" />
<h3 class="fn"><a name="setRootIndex" />QTableView.setRootIndex (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>Reimplemented from <a href="qabstractitemview.html#setRootIndex">QAbstractItemView.setRootIndex</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/setRowHeight" />
<h3 class="fn"><a name="setRowHeight" />QTableView.setRowHeight (<i>self</i>, int, int)</h3><p>Sets the height of the given <i>row</i> to be <i>height</i>.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qtableview.html#rowHeight">rowHeight</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/setRowHidden" />
<h3 class="fn"><a name="setRowHidden" />QTableView.setRowHidden (<i>self</i>, int, bool)</h3><p>If <i>hide</i> is true <i>row</i> will be hidden, otherwise it will be shown.</p>
<p>See also <a href="qtableview.html#isRowHidden">isRowHidden</a>() and <a href="qtableview.html#setColumnHidden">setColumnHidden</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/setSelection" />
<h3 class="fn"><a name="setSelection" />QTableView.setSelection (<i>self</i>, <a href="qrect.html">QRect</a>, <a href="qitemselectionmodel-selectionflags.html">QItemSelectionModel.SelectionFlags</a>)</h3><p>Reimplemented from <a href="qabstractitemview.html#setSelection">QAbstractItemView.setSelection</a>().</p>
<p>Selects the items within the given <i>rect</i> and in accordance with the specified selection <i>flags</i>.</p>
<a name="//apple_ref/cpp/instm/QTableView/setSelectionModel" />
<h3 class="fn"><a name="setSelectionModel" />QTableView.setSelectionModel (<i>self</i>, <a href="qitemselectionmodel.html">QItemSelectionModel</a>)</h3><p>Reimplemented from <a href="qabstractitemview.html#setSelectionModel">QAbstractItemView.setSelectionModel</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/setSpan" />
<h3 class="fn"><a name="setShowGrid" />QTableView.setShowGrid (<i>self</i>, bool)</h3><h3 class="fn"><a name="setSortingEnabled" />QTableView.setSortingEnabled (<i>self</i>, bool)</h3><h3 class="fn"><a name="setSpan" />QTableView.setSpan (<i>self</i>, int, int, int, int)</h3><p>Sets the span of the table element at (<i>row</i>, <i>column</i>) to the number of rows and columns specified by (<i>rowSpanCount</i>, <i>columnSpanCount</i>).</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtableview.html#rowSpan">rowSpan</a>() and <a href="qtableview.html#columnSpan">columnSpan</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/setVerticalHeader" />
<h3 class="fn"><a name="setVerticalHeader" />QTableView.setVerticalHeader (<i>self</i>, <a href="qheaderview.html">QHeaderView</a>)</h3><p>The <i>QHeaderView</i> argument has it's ownership transferred to Qt.</p><p>Sets the widget to use for the vertical header to <i>header</i>.</p>
<p>See also <a href="qtableview.html#verticalHeader">verticalHeader</a>() and <a href="qtableview.html#setHorizontalHeader">setHorizontalHeader</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/showColumn" />
<h3 class="fn"><a name="setWordWrap" />QTableView.setWordWrap (<i>self</i>, bool)</h3><h3 class="fn"><a name="showColumn" />QTableView.showColumn (<i>self</i>, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void showColumn(int)</tt>.</p><p>Show the given <i>column</i>.</p>
<p>See also <a href="qtableview.html#hideColumn">hideColumn</a>() and <a href="qtableview.html#showRow">showRow</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/showRow" />
<h3 class="fn"><a name="showGrid" />bool QTableView.showGrid (<i>self</i>)</h3><h3 class="fn"><a name="showRow" />QTableView.showRow (<i>self</i>, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void showRow(int)</tt>.</p><p>Show the given <i>row</i>.</p>
<p>See also <a href="qtableview.html#hideRow">hideRow</a>() and <a href="qtableview.html#showColumn">showColumn</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/sizeHintForColumn" />
<h3 class="fn"><a name="sizeHintForColumn" />int QTableView.sizeHintForColumn (<i>self</i>, int)</h3><p>Reimplemented from <a href="qabstractitemview.html#sizeHintForColumn">QAbstractItemView.sizeHintForColumn</a>().</p>
<p>Returns the size hint for the given <i>column</i>'s width or -1 if there is no model.</p>
<p>If you need to set the width of a given column to a fixed value, call <a href="qheaderview.html#resizeSection">QHeaderView.resizeSection</a>() on the table's horizontal header.</p>
<p>If you reimplement this function in a subclass, note that the value you return will be used when <a href="qtableview.html#resizeColumnToContents">resizeColumnToContents</a>() or <a href="qheaderview.html#resizeSections">QHeaderView.resizeSections</a>() is called. If a larger column width is required by either the horizontal header or the item delegate, the larger width will be used instead.</p>
<p>See also <a href="qwidget.html#sizeHint-prop">QWidget.sizeHint</a> and <a href="qtableview.html#horizontalHeader">horizontalHeader</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/sizeHintForRow" />
<h3 class="fn"><a name="sizeHintForRow" />int QTableView.sizeHintForRow (<i>self</i>, int)</h3><p>Reimplemented from <a href="qabstractitemview.html#sizeHintForRow">QAbstractItemView.sizeHintForRow</a>().</p>
<p>Returns the size hint for the given <i>row</i>'s height or -1 if there is no model.</p>
<p>If you need to set the height of a given row to a fixed value, call <a href="qheaderview.html#resizeSection">QHeaderView.resizeSection</a>() on the table's vertical header.</p>
<p>If you reimplement this function in a subclass, note that the value you return is only used when <a href="qtableview.html#resizeRowToContents">resizeRowToContents</a>() is called. In that case, if a larger row height is required by either the vertical header or the item delegate, that width will be used instead.</p>
<p>See also <a href="qwidget.html#sizeHint-prop">QWidget.sizeHint</a> and <a href="qtableview.html#verticalHeader">verticalHeader</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/sortByColumn" />
<h3 class="fn"><a name="sortByColumn" />QTableView.sortByColumn (<i>self</i>, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void sortByColumn(int)</tt>.</p><p>Sorts the model by the values in the given <i>column</i> in the given <i>order</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtableview.html#sortingEnabled-prop">sortingEnabled</a>.</p>
<a name="//apple_ref/cpp/instm/QTableView/timerEvent" />
<h3 class="fn"><a name="sortByColumn-2" />QTableView.sortByColumn (<i>self</i>, int, <a href="qt.html#SortOrder-enum">Qt.SortOrder</a>)</h3><h3 class="fn"><a name="timerEvent" />QTableView.timerEvent (<i>self</i>, <a href="qtimerevent.html">QTimerEvent</a>)</h3><p>Reimplemented from <a href="qobject.html#timerEvent">QObject.timerEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/updateGeometries" />
<h3 class="fn"><a name="updateGeometries" />QTableView.updateGeometries (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemview.html#updateGeometries">QAbstractItemView.updateGeometries</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/verticalHeader" />
<h3 class="fn"><a name="verticalHeader" /><a href="qheaderview.html">QHeaderView</a> QTableView.verticalHeader (<i>self</i>)</h3><p>Returns the table view's vertical header.</p>
<p>See also <a href="qtableview.html#setVerticalHeader">setVerticalHeader</a>(), <a href="qtableview.html#horizontalHeader">horizontalHeader</a>(), and <a href="qabstractitemmodel.html#headerData">QAbstractItemModel.headerData</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/verticalOffset" />
<h3 class="fn"><a name="verticalOffset" />int QTableView.verticalOffset (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemview.html#verticalOffset">QAbstractItemView.verticalOffset</a>().</p>
<p>Returns the vertical offset of the items in the table view.</p>
<p>Note that the table view uses the vertical header section positions to determine the positions of rows in the view.</p>
<p>See also <a href="qtableview.html#horizontalOffset">horizontalOffset</a>().</p>
<a name="//apple_ref/cpp/instm/QTableView/viewOptions" />
<h3 class="fn"><a name="verticalScrollbarAction" />QTableView.verticalScrollbarAction (<i>self</i>, int)</h3><h3 class="fn"><a name="viewOptions" /><a href="qstyleoptionviewitem.html">QStyleOptionViewItem</a> QTableView.viewOptions (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemview.html#viewOptions">QAbstractItemView.viewOptions</a>().</p>
<p /><h3 class="fn"><a name="visualRect" /><a href="qrect.html">QRect</a> QTableView.visualRect (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>)</h3><h3 class="fn"><a name="visualRegionForSelection" /><a href="qregion.html">QRegion</a> QTableView.visualRegionForSelection (<i>self</i>, <a href="qitemselection.html">QItemSelection</a>)</h3><h3 class="fn"><a name="wordWrap" />bool QTableView.wordWrap (<i>self</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.2</td></tr></table></div></address></body></html>