Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 3f684444755c5ad1181cdd5a97348f3c > files > 1659

PyQt4-devel-4.7.4-2.fc14.i686.rpm

<?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>QTreeView 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">QTreeView Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QTreeView class provides a default model/view implementation of a tree view. <a href="#details">More...</a></p>
<p>Inherits <a href="qabstractitemview.html">QAbstractItemView</a>.</p><p>Inherited by <a href="qhelpcontentwidget.html">QHelpContentWidget</a> and <a href="qtreewidget.html">QTreeWidget</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtreeview.html#QTreeView">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />bool <b><a href="qtreeview.html#allColumnsShowFocus">allColumnsShowFocus</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtreeview.html#autoExpandDelay">autoExpandDelay</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtreeview.html#collapse">collapse</a></b> (<i>self</i>, QModelIndex)</li><li><div class="fn" /><b><a href="qtreeview.html#collapseAll">collapseAll</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtreeview.html#columnAt">columnAt</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtreeview.html#columnCountChanged">columnCountChanged</a></b> (<i>self</i>, int, int)</li><li><div class="fn" /><b><a href="qtreeview.html#columnMoved">columnMoved</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtreeview.html#columnResized">columnResized</a></b> (<i>self</i>, int, int, int)</li><li><div class="fn" />int <b><a href="qtreeview.html#columnViewportPosition">columnViewportPosition</a></b> (<i>self</i>, int)</li><li><div class="fn" />int <b><a href="qtreeview.html#columnWidth">columnWidth</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtreeview.html#currentChanged">currentChanged</a></b> (<i>self</i>, QModelIndex, QModelIndex)</li><li><div class="fn" /><b><a href="qtreeview.html#dataChanged">dataChanged</a></b> (<i>self</i>, QModelIndex, QModelIndex)</li><li><div class="fn" /><b><a href="qtreeview.html#doItemsLayout">doItemsLayout</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtreeview.html#dragMoveEvent">dragMoveEvent</a></b> (<i>self</i>, QDragMoveEvent)</li><li><div class="fn" /><b><a href="qtreeview.html#drawBranches">drawBranches</a></b> (<i>self</i>, QPainter, QRect, QModelIndex)</li><li><div class="fn" /><b><a href="qtreeview.html#drawRow">drawRow</a></b> (<i>self</i>, QPainter, QStyleOptionViewItem, QModelIndex)</li><li><div class="fn" /><b><a href="qtreeview.html#drawTree">drawTree</a></b> (<i>self</i>, QPainter, QRegion)</li><li><div class="fn" /><b><a href="qtreeview.html#expand">expand</a></b> (<i>self</i>, QModelIndex)</li><li><div class="fn" /><b><a href="qtreeview.html#expandAll">expandAll</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtreeview.html#expandsOnDoubleClick">expandsOnDoubleClick</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtreeview.html#expandToDepth">expandToDepth</a></b> (<i>self</i>, int)</li><li><div class="fn" />QHeaderView <b><a href="qtreeview.html#header">header</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtreeview.html#hideColumn">hideColumn</a></b> (<i>self</i>, int)</li><li><div class="fn" />int <b><a href="qtreeview.html#horizontalOffset">horizontalOffset</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtreeview.html#horizontalScrollbarAction">horizontalScrollbarAction</a></b> (<i>self</i>, int)</li><li><div class="fn" />int <b><a href="qtreeview.html#indentation">indentation</a></b> (<i>self</i>)</li><li><div class="fn" />QModelIndex <b><a href="qtreeview.html#indexAbove">indexAbove</a></b> (<i>self</i>, QModelIndex)</li><li><div class="fn" />QModelIndex <b><a href="qtreeview.html#indexAt">indexAt</a></b> (<i>self</i>, QPoint)</li><li><div class="fn" />QModelIndex <b><a href="qtreeview.html#indexBelow">indexBelow</a></b> (<i>self</i>, QModelIndex)</li><li><div class="fn" />int <b><a href="qtreeview.html#indexRowSizeHint">indexRowSizeHint</a></b> (<i>self</i>, QModelIndex)</li><li><div class="fn" />bool <b><a href="qtreeview.html#isAnimated">isAnimated</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtreeview.html#isColumnHidden">isColumnHidden</a></b> (<i>self</i>, int)</li><li><div class="fn" />bool <b><a href="qtreeview.html#isExpanded">isExpanded</a></b> (<i>self</i>, QModelIndex)</li><li><div class="fn" />bool <b><a href="qtreeview.html#isFirstColumnSpanned">isFirstColumnSpanned</a></b> (<i>self</i>, int, QModelIndex)</li><li><div class="fn" />bool <b><a href="qtreeview.html#isHeaderHidden">isHeaderHidden</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtreeview.html#isIndexHidden">isIndexHidden</a></b> (<i>self</i>, QModelIndex)</li><li><div class="fn" />bool <b><a href="qtreeview.html#isRowHidden">isRowHidden</a></b> (<i>self</i>, int, QModelIndex)</li><li><div class="fn" />bool <b><a href="qtreeview.html#isSortingEnabled">isSortingEnabled</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtreeview.html#itemsExpandable">itemsExpandable</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtreeview.html#keyboardSearch">keyboardSearch</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qtreeview.html#keyPressEvent">keyPressEvent</a></b> (<i>self</i>, QKeyEvent)</li><li><div class="fn" /><b><a href="qtreeview.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b> (<i>self</i>, QMouseEvent)</li><li><div class="fn" /><b><a href="qtreeview.html#mouseMoveEvent">mouseMoveEvent</a></b> (<i>self</i>, QMouseEvent)</li><li><div class="fn" /><b><a href="qtreeview.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QMouseEvent)</li><li><div class="fn" /><b><a href="qtreeview.html#mouseReleaseEvent">mouseReleaseEvent</a></b> (<i>self</i>, QMouseEvent)</li><li><div class="fn" />QModelIndex <b><a href="qtreeview.html#moveCursor">moveCursor</a></b> (<i>self</i>, QAbstractItemView.CursorAction, Qt.KeyboardModifiers)</li><li><div class="fn" /><b><a href="qtreeview.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent)</li><li><div class="fn" /><b><a href="qtreeview.html#reexpand">reexpand</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtreeview.html#reset">reset</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtreeview.html#resizeColumnToContents">resizeColumnToContents</a></b> (<i>self</i>, int)</li><li><div class="fn" />bool <b><a href="qtreeview.html#rootIsDecorated">rootIsDecorated</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtreeview.html#rowHeight">rowHeight</a></b> (<i>self</i>, QModelIndex)</li><li><div class="fn" /><b><a href="qtreeview.html#rowsAboutToBeRemoved">rowsAboutToBeRemoved</a></b> (<i>self</i>, QModelIndex, int, int)</li><li><div class="fn" /><b><a href="qtreeview.html#rowsInserted">rowsInserted</a></b> (<i>self</i>, QModelIndex, int, int)</li><li><div class="fn" /><b><a href="qtreeview.html#rowsRemoved">rowsRemoved</a></b> (<i>self</i>, QModelIndex, int, int)</li><li><div class="fn" /><b><a href="qtreeview.html#scrollContentsBy">scrollContentsBy</a></b> (<i>self</i>, int, int)</li><li><div class="fn" /><b><a href="qtreeview.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="qtreeview.html#selectAll">selectAll</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-QModelIndex <b><a href="qtreeview.html#selectedIndexes">selectedIndexes</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtreeview.html#selectionChanged">selectionChanged</a></b> (<i>self</i>, QItemSelection, QItemSelection)</li><li><div class="fn" /><b><a href="qtreeview.html#setAllColumnsShowFocus">setAllColumnsShowFocus</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtreeview.html#setAnimated">setAnimated</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtreeview.html#setAutoExpandDelay">setAutoExpandDelay</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtreeview.html#setColumnHidden">setColumnHidden</a></b> (<i>self</i>, int, bool)</li><li><div class="fn" /><b><a href="qtreeview.html#setColumnWidth">setColumnWidth</a></b> (<i>self</i>, int, int)</li><li><div class="fn" /><b><a href="qtreeview.html#setExpanded">setExpanded</a></b> (<i>self</i>, QModelIndex, bool)</li><li><div class="fn" /><b><a href="qtreeview.html#setExpandsOnDoubleClick">setExpandsOnDoubleClick</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtreeview.html#setFirstColumnSpanned">setFirstColumnSpanned</a></b> (<i>self</i>, int, QModelIndex, bool)</li><li><div class="fn" /><b><a href="qtreeview.html#setHeader">setHeader</a></b> (<i>self</i>, QHeaderView)</li><li><div class="fn" /><b><a href="qtreeview.html#setHeaderHidden">setHeaderHidden</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtreeview.html#setIndentation">setIndentation</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtreeview.html#setItemsExpandable">setItemsExpandable</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtreeview.html#setModel">setModel</a></b> (<i>self</i>, QAbstractItemModel)</li><li><div class="fn" /><b><a href="qtreeview.html#setRootIndex">setRootIndex</a></b> (<i>self</i>, QModelIndex)</li><li><div class="fn" /><b><a href="qtreeview.html#setRootIsDecorated">setRootIsDecorated</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtreeview.html#setRowHidden">setRowHidden</a></b> (<i>self</i>, int, QModelIndex, bool)</li><li><div class="fn" /><b><a href="qtreeview.html#setSelection">setSelection</a></b> (<i>self</i>, QRect, QItemSelectionModel.SelectionFlags)</li><li><div class="fn" /><b><a href="qtreeview.html#setSelectionModel">setSelectionModel</a></b> (<i>self</i>, QItemSelectionModel)</li><li><div class="fn" /><b><a href="qtreeview.html#setSortingEnabled">setSortingEnabled</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtreeview.html#setUniformRowHeights">setUniformRowHeights</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtreeview.html#setWordWrap">setWordWrap</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtreeview.html#showColumn">showColumn</a></b> (<i>self</i>, int)</li><li><div class="fn" />int <b><a href="qtreeview.html#sizeHintForColumn">sizeHintForColumn</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtreeview.html#sortByColumn">sortByColumn</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtreeview.html#sortByColumn-2">sortByColumn</a></b> (<i>self</i>, int, Qt.SortOrder)</li><li><div class="fn" /><b><a href="qtreeview.html#timerEvent">timerEvent</a></b> (<i>self</i>, QTimerEvent)</li><li><div class="fn" />bool <b><a href="qtreeview.html#uniformRowHeights">uniformRowHeights</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtreeview.html#updateGeometries">updateGeometries</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtreeview.html#verticalOffset">verticalOffset</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtreeview.html#viewportEvent">viewportEvent</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" />QRect <b><a href="qtreeview.html#visualRect">visualRect</a></b> (<i>self</i>, QModelIndex)</li><li><div class="fn" />QRegion <b><a href="qtreeview.html#visualRegionForSelection">visualRegionForSelection</a></b> (<i>self</i>, QItemSelection)</li><li><div class="fn" />bool <b><a href="qtreeview.html#wordWrap">wordWrap</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qtreeview.html#collapsed">collapsed</a></b> (const QModelIndex&amp;)</li><li><div class="fn" />void <b><a href="qtreeview.html#expanded">expanded</a></b> (const QModelIndex&amp;)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTreeView class provides a default model/view implementation of a tree view.</p>
<p>A QTreeView implements a tree representation of items from a model. This class is used to provide standard hierarchical lists that were previously provided by the <tt>QListView</tt> class, but using the more flexible approach provided by Qt's model/view architecture.</p>
<p>The QTreeView 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>QTreeView 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>
<p>It is simple to construct a tree view displaying data from a model. In the following example, the contents of a directory are supplied by a <a href="qdirmodel.html">QDirModel</a> and displayed as a tree:</p>
<pre>     QFileSystemModel *model = new QFileSystemModel;
     model-&gt;setRootPath(QDir.currentPath());
     QTreeView *tree = new QTreeView(splitter);
     tree-&gt;setModel(model);</pre>
<p>The model/view architecture ensures that the contents of the tree view are updated as the model changes.</p>
<p>Items that have children can be in an expanded (children are visible) or collapsed (children are hidden) state. When this state changes a <a href="qtreeview.html#collapsed">collapsed</a>() or <a href="qtreeview.html#expanded">expanded</a>() signal is emitted with the model index of the relevant item.</p>
<p>The amount of indentation used to indicate levels of hierarchy is controlled by the <a href="qtreeview.html#indentation-prop">indentation</a> property.</p>
<p>Headers in tree views are constructed using the <a href="qheaderview.html">QHeaderView</a> class and can be hidden using <tt>header()-&gt;hide()</tt>. Note that each header is configured with its <a href="qheaderview.html#stretchLastSection-prop">stretchLastSection</a> property set to true, ensuring that the view does not waste any of the space assigned to it for its header. If this value is set to true, this property will override the resize mode set on the last section in the header.</p>
<a name="key-bindings" />
<h3>Key Bindings</h3>
<p>QTreeView supports a set of key bindings that enable the user to navigate in the view and interact with the contents of items:</p>
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic">
<thead><tr class="qt-style" valign="top"><th>Key</th><th>Action</th></tr></thead>
<tr class="odd" valign="top"><td>Up</td><td>Moves the cursor to the item in the same column on the previous row. If the parent of the current item has no more rows to navigate to, the cursor moves to the relevant item in the last row of the sibling that precedes the parent.</td></tr>
<tr class="even" valign="top"><td>Down</td><td>Moves the cursor to the item in the same column on the next row. If the parent of the current item has no more rows to navigate to, the cursor moves to the relevant item in the first row of the sibling that follows the parent.</td></tr>
<tr class="odd" valign="top"><td>Left</td><td>Hides the children of the current item (if present) by collapsing a branch.</td></tr>
<tr class="even" valign="top"><td>Minus</td><td>Same as LeftArrow.</td></tr>
<tr class="odd" valign="top"><td>Right</td><td>Reveals the children of the current item (if present) by expanding a branch.</td></tr>
<tr class="even" valign="top"><td>Plus</td><td>Same as RightArrow.</td></tr>
<tr class="odd" valign="top"><td>Asterisk</td><td>Expands all children of the current item (if present).</td></tr>
<tr class="even" valign="top"><td>PageUp</td><td>Moves the cursor up one page.</td></tr>
<tr class="odd" valign="top"><td>PageDown</td><td>Moves the cursor down one page.</td></tr>
<tr class="even" valign="top"><td>Home</td><td>Moves the cursor to an item in the same column of the first row of the first top-level item in the model.</td></tr>
<tr class="odd" valign="top"><td>End</td><td>Moves the cursor to an item in the same column of the last row of the last top-level item in the model.</td></tr>
<tr class="even" valign="top"><td>F2</td><td>In editable models, this opens the current item for editing. The Escape key can be used to cancel the editing process and revert any changes to the data displayed.</td></tr>
</table></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 tree view" src="images/windowsxp-treeview.png" /></td><td><img alt="Screenshot of a Macintosh style tree view" src="images/macintosh-treeview.png" /></td><td><img alt="Screenshot of a Plastique style tree view" src="images/plastique-treeview.png" /></td></tr>
<tr class="even" valign="top"><td>A <a href="gallery-windowsxp.html">Windows XP style</a> tree view.</td><td>A <a href="gallery-macintosh.html">Macintosh style</a> tree view.</td><td>A <a href="gallery-plastique.html">Plastique style</a> tree view.</td></tr>
</table></p>
<a name="improving-performance" />
<h3>Improving Performance</h3>
<p>It is possible to give the view hints about the data it is handling in order to improve its performance when displaying large numbers of items. One approach that can be taken for views that are intended to display items with equal heights is to set the <a href="qtreeview.html#uniformRowHeights-prop">uniformRowHeights</a> property to true.</p>
<p>See also <a href="qlistview.html">QListView</a>, <a href="qtreewidget.html">QTreeWidget</a>, <a href="model-view-view.html">View Classes</a>, <a href="qabstractitemmodel.html">QAbstractItemModel</a>, <a href="qabstractitemview.html">QAbstractItemView</a>, and <a href="itemviews-dirview.html">Dir View Example</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTreeView" />QTreeView.__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 tree view with a <i>parent</i> to represent a model's data. Use <a href="qtreeview.html#setModel">setModel</a>() to set the model.</p>
<p>See also <a href="qabstractitemmodel.html">QAbstractItemModel</a>.</p>
<a name="//apple_ref/cpp/instm/QTreeView/~QTreeView" />
<h3 class="fn"><a name="allColumnsShowFocus" />bool QTreeView.allColumnsShowFocus (<i>self</i>)</h3><h3 class="fn"><a name="autoExpandDelay" />int QTreeView.autoExpandDelay (<i>self</i>)</h3><h3 class="fn"><a name="collapse" />QTreeView.collapse (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void collapse(const QModelIndex&amp;)</tt>.</p><p>Collapses the model item specified by the <i>index</i>.</p>
<p>See also <a href="qtreeview.html#collapsed">collapsed</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/collapseAll" />
<h3 class="fn"><a name="collapseAll" />QTreeView.collapseAll (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void collapseAll()</tt>.</p><p>Collapses all expanded items.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtreeview.html#expandAll">expandAll</a>(), <a href="qtreeview.html#expand">expand</a>(), <a href="qtreeview.html#collapse">collapse</a>(), and <a href="qtreeview.html#setExpanded">setExpanded</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/collapsed" />
<h3 class="fn"><a name="columnAt" />int QTreeView.columnAt (<i>self</i>, int)</h3><p>Returns the column in the tree view whose header covers the <i>x</i> coordinate given.</p>
<a name="//apple_ref/cpp/instm/QTreeView/columnCountChanged" />
<h3 class="fn"><a name="columnCountChanged" />QTreeView.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>Informs the tree view that the number of columns in the tree view has changed from <i>oldCount</i> to <i>newCount</i>.</p>
<a name="//apple_ref/cpp/instm/QTreeView/columnMoved" />
<h3 class="fn"><a name="columnMoved" />QTreeView.columnMoved (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void columnMoved()</tt>.</p><p>This slot is called whenever a column has been moved.</p>
<a name="//apple_ref/cpp/instm/QTreeView/columnResized" />
<h3 class="fn"><a name="columnResized" />QTreeView.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 function is called whenever <i>column</i>'s size is changed in the header. <i>oldSize</i> and <i>newSize</i> give the previous size and the new size in pixels.</p>
<p>See also <a href="qtreeview.html#setColumnWidth">setColumnWidth</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/columnViewportPosition" />
<h3 class="fn"><a name="columnViewportPosition" />int QTreeView.columnViewportPosition (<i>self</i>, int)</h3><p>Returns the horizontal position of the <i>column</i> in the viewport.</p>
<a name="//apple_ref/cpp/instm/QTreeView/columnWidth" />
<h3 class="fn"><a name="columnWidth" />int QTreeView.columnWidth (<i>self</i>, int)</h3><p>Returns the width of the <i>column</i>.</p>
<p>See also <a href="qtreeview.html#resizeColumnToContents">resizeColumnToContents</a>() and <a href="qtreeview.html#setColumnWidth">setColumnWidth</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/currentChanged" />
<h3 class="fn"><a name="currentChanged" />QTreeView.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/QTreeView/dataChanged" />
<h3 class="fn"><a name="dataChanged" />QTreeView.dataChanged (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void dataChanged(const QModelIndex&amp;,const QModelIndex&amp;)</tt>.</p><p>Reimplemented from <a href="qabstractitemview.html#dataChanged">QAbstractItemView.dataChanged</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/dragMoveEvent" />
<h3 class="fn"><a name="doItemsLayout" />QTreeView.doItemsLayout (<i>self</i>)</h3><h3 class="fn"><a name="dragMoveEvent" />QTreeView.dragMoveEvent (<i>self</i>, <a href="qdragmoveevent.html">QDragMoveEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#dragMoveEvent">QWidget.dragMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/drawBranches" />
<h3 class="fn"><a name="drawBranches" />QTreeView.drawBranches (<i>self</i>, <a href="qpainter.html">QPainter</a>, <a href="qrect.html">QRect</a>, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>Draws the branches in the tree view on the same row as the model item <i>index</i>, using the <i>painter</i> given. The branches are drawn in the rectangle specified by <i>rect</i>.</p>
<a name="//apple_ref/cpp/instm/QTreeView/drawRow" />
<h3 class="fn"><a name="drawRow" />QTreeView.drawRow (<i>self</i>, <a href="qpainter.html">QPainter</a>, <a href="qstyleoptionviewitem.html">QStyleOptionViewItem</a>, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>Draws the row in the tree view that contains the model item <i>index</i>, using the <i>painter</i> given. The <i>option</i> control how the item is displayed.</p>
<p>See also <a href="qabstractitemview.html#alternatingRowColors-prop">setAlternatingRowColors</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/drawTree" />
<h3 class="fn"><a name="drawTree" />QTreeView.drawTree (<i>self</i>, <a href="qpainter.html">QPainter</a>, <a href="qregion.html">QRegion</a>)</h3><p>Draws the part of the tree intersecting the given <i>region</i> using the specified <i>painter</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtreeview.html#paintEvent">paintEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/expand" />
<h3 class="fn"><a name="expand" />QTreeView.expand (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void expand(const QModelIndex&amp;)</tt>.</p><p>Expands the model item specified by the <i>index</i>.</p>
<p>See also <a href="qtreeview.html#expanded">expanded</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/expandAll" />
<h3 class="fn"><a name="expandAll" />QTreeView.expandAll (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void expandAll()</tt>.</p><p>Expands all expandable items.</p>
<p>Warning: if the model contains a large number of items, this function will take some time to execute.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtreeview.html#collapseAll">collapseAll</a>(), <a href="qtreeview.html#expand">expand</a>(), <a href="qtreeview.html#collapse">collapse</a>(), and <a href="qtreeview.html#setExpanded">setExpanded</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/expandToDepth" />
<h3 class="fn"><a name="expandsOnDoubleClick" />bool QTreeView.expandsOnDoubleClick (<i>self</i>)</h3><h3 class="fn"><a name="expandToDepth" />QTreeView.expandToDepth (<i>self</i>, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void expandToDepth(int)</tt>.</p><p>Expands all expandable items to the given <i>depth</i>.</p>
<p>This function was introduced in Qt 4.3.</p>
<p>See also <a href="qtreeview.html#expandAll">expandAll</a>(), <a href="qtreeview.html#collapseAll">collapseAll</a>(), <a href="qtreeview.html#expand">expand</a>(), <a href="qtreeview.html#collapse">collapse</a>(), and <a href="qtreeview.html#setExpanded">setExpanded</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/expanded" />
<h3 class="fn"><a name="header" /><a href="qheaderview.html">QHeaderView</a> QTreeView.header (<i>self</i>)</h3><p>Returns the header for the tree view.</p>
<p>See also <a href="qtreeview.html#setHeader">setHeader</a>() and <a href="qabstractitemmodel.html#headerData">QAbstractItemModel.headerData</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/hideColumn" />
<h3 class="fn"><a name="hideColumn" />QTreeView.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>Hides the <i>column</i> given.</p>
<p><b>Note:</b> This function should only be called after the model has been initialized, as the view needs to know the number of columns in order to hide <i>column</i>.</p>
<p>See also <a href="qtreeview.html#showColumn">showColumn</a>() and <a href="qtreeview.html#setColumnHidden">setColumnHidden</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/horizontalOffset" />
<h3 class="fn"><a name="horizontalOffset" />int QTreeView.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 treeview.</p>
<p>Note that the tree view uses the horizontal header section positions to determine the positions of columns in the view.</p>
<p>See also <a href="qtreeview.html#verticalOffset">verticalOffset</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/indexAbove" />
<h3 class="fn"><a name="horizontalScrollbarAction" />QTreeView.horizontalScrollbarAction (<i>self</i>, int)</h3><h3 class="fn"><a name="indentation" />int QTreeView.indentation (<i>self</i>)</h3><h3 class="fn"><a name="indexAbove" /><a href="qmodelindex.html">QModelIndex</a> QTreeView.indexAbove (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>Returns the model index of the item above <i>index</i>.</p>
<a name="//apple_ref/cpp/instm/QTreeView/indexAt" />
<h3 class="fn"><a name="indexAt" /><a href="qmodelindex.html">QModelIndex</a> QTreeView.indexAt (<i>self</i>, <a href="qpoint.html">QPoint</a>)</h3><p>Reimplemented from <a href="qabstractitemview.html#indexAt">QAbstractItemView.indexAt</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/indexBelow" />
<h3 class="fn"><a name="indexBelow" /><a href="qmodelindex.html">QModelIndex</a> QTreeView.indexBelow (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>Returns the model index of the item below <i>index</i>.</p>
<a name="//apple_ref/cpp/instm/QTreeView/indexRowSizeHint" />
<h3 class="fn"><a name="indexRowSizeHint" />int QTreeView.indexRowSizeHint (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>Returns the size hint for the row indicated by <i>index</i>.</p>
<p>See also <a href="qtreeview.html#sizeHintForColumn">sizeHintForColumn</a>() and <a href="qtreeview.html#uniformRowHeights-prop">uniformRowHeights</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/isColumnHidden" />
<h3 class="fn"><a name="isAnimated" />bool QTreeView.isAnimated (<i>self</i>)</h3><h3 class="fn"><a name="isColumnHidden" />bool QTreeView.isColumnHidden (<i>self</i>, int)</h3><p>Returns true if the <i>column</i> is hidden; otherwise returns false.</p>
<p>See also <a href="qtreeview.html#hideColumn">hideColumn</a>() and <a href="qtreeview.html#isRowHidden">isRowHidden</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/isExpanded" />
<h3 class="fn"><a name="isExpanded" />bool QTreeView.isExpanded (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>Returns true if the model item <i>index</i> is expanded; otherwise returns false.</p>
<p>See also <a href="qtreeview.html#expand">expand</a>(), <a href="qtreeview.html#expanded">expanded</a>(), and <a href="qtreeview.html#setExpanded">setExpanded</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/isFirstColumnSpanned" />
<h3 class="fn"><a name="isFirstColumnSpanned" />bool QTreeView.isFirstColumnSpanned (<i>self</i>, int, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>Returns true if the item in first column in the given <i>row</i> of the <i>parent</i> is spanning all the columns; otherwise returns false.</p>
<p>This function was introduced in Qt 4.3.</p>
<p>See also <a href="qtreeview.html#setFirstColumnSpanned">setFirstColumnSpanned</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/isIndexHidden" />
<h3 class="fn"><a name="isHeaderHidden" />bool QTreeView.isHeaderHidden (<i>self</i>)</h3><h3 class="fn"><a name="isIndexHidden" />bool QTreeView.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/QTreeView/isRowHidden" />
<h3 class="fn"><a name="isRowHidden" />bool QTreeView.isRowHidden (<i>self</i>, int, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>Returns true if the item in the given <i>row</i> of the <i>parent</i> is hidden; otherwise returns false.</p>
<p>See also <a href="qtreeview.html#setRowHidden">setRowHidden</a>() and <a href="qtreeview.html#isColumnHidden">isColumnHidden</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/keyPressEvent" />
<h3 class="fn"><a name="isSortingEnabled" />bool QTreeView.isSortingEnabled (<i>self</i>)</h3><h3 class="fn"><a name="itemsExpandable" />bool QTreeView.itemsExpandable (<i>self</i>)</h3><h3 class="fn"><a name="keyboardSearch" />QTreeView.keyboardSearch (<i>self</i>, QString)</h3><p>Reimplemented from <a href="qabstractitemview.html#keyboardSearch">QAbstractItemView.keyboardSearch</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/mouseDoubleClickEvent" />
<h3 class="fn"><a name="keyPressEvent" />QTreeView.keyPressEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget.keyPressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/keyboardSearch" />
<h3 class="fn"><a name="mouseDoubleClickEvent" />QTreeView.mouseDoubleClickEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#mouseDoubleClickEvent">QWidget.mouseDoubleClickEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/mouseMoveEvent" />
<h3 class="fn"><a name="mouseMoveEvent" />QTreeView.mouseMoveEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget.mouseMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/mousePressEvent" />
<h3 class="fn"><a name="mousePressEvent" />QTreeView.mousePressEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget.mousePressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/mouseReleaseEvent" />
<h3 class="fn"><a name="mouseReleaseEvent" />QTreeView.mouseReleaseEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget.mouseReleaseEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/moveCursor" />
<h3 class="fn"><a name="moveCursor" /><a href="qmodelindex.html">QModelIndex</a> QTreeView.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>Move the cursor in the way described by <i>cursorAction</i>, using the information provided by the button <i>modifiers</i>.</p>
<a name="//apple_ref/cpp/instm/QTreeView/paintEvent" />
<h3 class="fn"><a name="paintEvent" />QTreeView.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget.paintEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/reset" />
<h3 class="fn"><a name="reexpand" />QTreeView.reexpand (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void reexpand()</tt>.</p><h3 class="fn"><a name="reset" />QTreeView.reset (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemview.html#reset">QAbstractItemView.reset</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/resizeColumnToContents" />
<h3 class="fn"><a name="resizeColumnToContents" />QTreeView.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 <i>column</i> given to the size of its contents.</p>
<p>See also <a href="qtreeview.html#columnWidth">columnWidth</a>() and <a href="qtreeview.html#setColumnWidth">setColumnWidth</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/rowHeight" />
<h3 class="fn"><a name="rootIsDecorated" />bool QTreeView.rootIsDecorated (<i>self</i>)</h3><h3 class="fn"><a name="rowHeight" />int QTreeView.rowHeight (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>Returns the height of the row indicated by the given <i>index</i>.</p>
<p>This function was introduced in Qt 4.3.</p>
<p>See also <a href="qtreeview.html#indexRowSizeHint">indexRowSizeHint</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/rowsAboutToBeRemoved" />
<h3 class="fn"><a name="rowsAboutToBeRemoved" />QTreeView.rowsAboutToBeRemoved (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>, int, int)</h3><p>Reimplemented from <a href="qabstractitemview.html#rowsAboutToBeRemoved">QAbstractItemView.rowsAboutToBeRemoved</a>().</p>
<p>Informs the view that the rows from the <i>start</i> row to the <i>end</i> row inclusive are about to removed from the given <i>parent</i> model item.</p>
<a name="//apple_ref/cpp/instm/QTreeView/rowsInserted" />
<h3 class="fn"><a name="rowsInserted" />QTreeView.rowsInserted (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>, int, int)</h3><p>Reimplemented from <a href="qabstractitemview.html#rowsInserted">QAbstractItemView.rowsInserted</a>().</p>
<p>Informs the view that the rows from the <i>start</i> row to the <i>end</i> row inclusive have been inserted into the <i>parent</i> model item.</p>
<a name="//apple_ref/cpp/instm/QTreeView/rowsRemoved" />
<h3 class="fn"><a name="rowsRemoved" />QTreeView.rowsRemoved (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>, int, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void rowsRemoved(const QModelIndex&amp;,int,int)</tt>.</p><p>Informs the view that the rows from the <i>start</i> row to the <i>end</i> row inclusive have been removed from the given <i>parent</i> model item.</p>
<p>This function was introduced in Qt 4.1.</p>
<a name="//apple_ref/cpp/instm/QTreeView/scrollContentsBy" />
<h3 class="fn"><a name="scrollContentsBy" />QTreeView.scrollContentsBy (<i>self</i>, int, int)</h3><p>Reimplemented from <a href="qabstractscrollarea.html#scrollContentsBy">QAbstractScrollArea.scrollContentsBy</a>().</p>
<p>Scrolls the contents of the tree view by (<i>dx</i>, <i>dy</i>).</p>
<a name="//apple_ref/cpp/instm/QTreeView/scrollTo" />
<h3 class="fn"><a name="scrollTo" />QTreeView.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><p>Reimplemented from <a href="qabstractitemview.html#scrollTo">QAbstractItemView.scrollTo</a>().</p>
<p>Scroll the contents of the tree view until the given model item <i>index</i> is visible. The <i>hint</i> parameter specifies more precisely where the item should be located after the operation. If any of the parents of the model item are collapsed, they will be expanded to ensure that the model item is visible.</p>
<a name="//apple_ref/cpp/instm/QTreeView/selectAll" />
<h3 class="fn"><a name="selectAll" />QTreeView.selectAll (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void selectAll()</tt>.</p><p>Reimplemented from <a href="qabstractitemview.html#selectAll">QAbstractItemView.selectAll</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/selectedIndexes" />
<h3 class="fn"><a name="selectedIndexes" />list-of-QModelIndex QTreeView.selectedIndexes (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemview.html#selectedIndexes">QAbstractItemView.selectedIndexes</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/selectionChanged" />
<h3 class="fn"><a name="selectionChanged" />QTreeView.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/QTreeView/setColumnHidden" />
<h3 class="fn"><a name="setAllColumnsShowFocus" />QTreeView.setAllColumnsShowFocus (<i>self</i>, bool)</h3><h3 class="fn"><a name="setAnimated" />QTreeView.setAnimated (<i>self</i>, bool)</h3><h3 class="fn"><a name="setAutoExpandDelay" />QTreeView.setAutoExpandDelay (<i>self</i>, int)</h3><h3 class="fn"><a name="setColumnHidden" />QTreeView.setColumnHidden (<i>self</i>, int, bool)</h3><p>If <i>hide</i> is true the <i>column</i> is hidden, otherwise the <i>column</i> is shown.</p>
<p>See also <a href="qtreeview.html#isColumnHidden">isColumnHidden</a>(), <a href="qtreeview.html#hideColumn">hideColumn</a>(), and <a href="qtreeview.html#setRowHidden">setRowHidden</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/setColumnWidth" />
<h3 class="fn"><a name="setColumnWidth" />QTreeView.setColumnWidth (<i>self</i>, int, int)</h3><p>Sets the width of the given <i>column</i> to the <i>width</i> specified.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtreeview.html#columnWidth">columnWidth</a>() and <a href="qtreeview.html#resizeColumnToContents">resizeColumnToContents</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/setExpanded" />
<h3 class="fn"><a name="setExpanded" />QTreeView.setExpanded (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>, bool)</h3><p>Sets the item referred to by <i>index</i> to either collapse or expanded, depending on the value of <i>expanded</i>.</p>
<p>See also <a href="qtreeview.html#expanded">expanded</a>(), <a href="qtreeview.html#expand">expand</a>(), and <a href="qtreeview.html#isExpanded">isExpanded</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/setFirstColumnSpanned" />
<h3 class="fn"><a name="setExpandsOnDoubleClick" />QTreeView.setExpandsOnDoubleClick (<i>self</i>, bool)</h3><h3 class="fn"><a name="setFirstColumnSpanned" />QTreeView.setFirstColumnSpanned (<i>self</i>, int, <a href="qmodelindex.html">QModelIndex</a>, bool)</h3><p>If <i>span</i> is true the item in the first column in the <i>row</i> with the given <i>parent</i> is set to span all columns, otherwise all items on the <i>row</i> are shown.</p>
<p>This function was introduced in Qt 4.3.</p>
<p>See also <a href="qtreeview.html#isFirstColumnSpanned">isFirstColumnSpanned</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/setHeader" />
<h3 class="fn"><a name="setHeader" />QTreeView.setHeader (<i>self</i>, <a href="qheaderview.html">QHeaderView</a>)</h3><p>Sets the header for the tree view, to the given <i>header</i>.</p>
<p>The view takes ownership over the given <i>header</i> and deletes it when a new header is set.</p>
<p>See also <a href="qabstractitemmodel.html#headerData">QAbstractItemModel.headerData</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/setModel" />
<h3 class="fn"><a name="setHeaderHidden" />QTreeView.setHeaderHidden (<i>self</i>, bool)</h3><h3 class="fn"><a name="setIndentation" />QTreeView.setIndentation (<i>self</i>, int)</h3><h3 class="fn"><a name="setItemsExpandable" />QTreeView.setItemsExpandable (<i>self</i>, bool)</h3><h3 class="fn"><a name="setModel" />QTreeView.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/QTreeView/setRootIndex" />
<h3 class="fn"><a name="setRootIndex" />QTreeView.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/QTreeView/setRowHidden" />
<h3 class="fn"><a name="setRootIsDecorated" />QTreeView.setRootIsDecorated (<i>self</i>, bool)</h3><h3 class="fn"><a name="setRowHidden" />QTreeView.setRowHidden (<i>self</i>, int, <a href="qmodelindex.html">QModelIndex</a>, bool)</h3><p>If <i>hide</i> is true the <i>row</i> with the given <i>parent</i> is hidden, otherwise the <i>row</i> is shown.</p>
<p>See also <a href="qtreeview.html#isRowHidden">isRowHidden</a>() and <a href="qtreeview.html#setColumnHidden">setColumnHidden</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/setSelection" />
<h3 class="fn"><a name="setSelection" />QTreeView.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>Applies the selection <i>command</i> to the items in or touched by the rectangle, <i>rect</i>.</p>
<p>See also <a href="qabstractitemview.html#selectionCommand">selectionCommand</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/setSelectionModel" />
<h3 class="fn"><a name="setSelectionModel" />QTreeView.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/QTreeView/showColumn" />
<h3 class="fn"><a name="setSortingEnabled" />QTreeView.setSortingEnabled (<i>self</i>, bool)</h3><h3 class="fn"><a name="setUniformRowHeights" />QTreeView.setUniformRowHeights (<i>self</i>, bool)</h3><h3 class="fn"><a name="setWordWrap" />QTreeView.setWordWrap (<i>self</i>, bool)</h3><h3 class="fn"><a name="showColumn" />QTreeView.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>Shows the given <i>column</i> in the tree view.</p>
<p>See also <a href="qtreeview.html#hideColumn">hideColumn</a>() and <a href="qtreeview.html#setColumnHidden">setColumnHidden</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/sizeHintForColumn" />
<h3 class="fn"><a name="sizeHintForColumn" />int QTreeView.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 <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 view's header.</p>
<p>If you reimplement this function in a subclass, note that the value you return is only used when <a href="qtreeview.html#resizeColumnToContents">resizeColumnToContents</a>() is called. In that case, if a larger column width is required by either the view's 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="qtreeview.html#header">header</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/sortByColumn" />
<h3 class="fn"><a name="sortByColumn" />QTreeView.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>Sets the model up for sorting by the values in the given <i>column</i> and <i>order</i>.</p>
<p><i>column</i> may be -1, in which case no sort indicator will be shown and the model will return to its natural, unsorted order. Note that not all models support this and may even crash in this case.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtreeview.html#sortingEnabled-prop">sortingEnabled</a>.</p>
<a name="//apple_ref/cpp/instm/QTreeView/timerEvent" />
<h3 class="fn"><a name="sortByColumn-2" />QTreeView.sortByColumn (<i>self</i>, int, <a href="qt.html#SortOrder-enum">Qt.SortOrder</a>)</h3><h3 class="fn"><a name="timerEvent" />QTreeView.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/QTreeView/updateGeometries" />
<h3 class="fn"><a name="uniformRowHeights" />bool QTreeView.uniformRowHeights (<i>self</i>)</h3><h3 class="fn"><a name="updateGeometries" />QTreeView.updateGeometries (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemview.html#updateGeometries">QAbstractItemView.updateGeometries</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/verticalOffset" />
<h3 class="fn"><a name="verticalOffset" />int QTreeView.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 tree view.</p>
<p>See also <a href="qtreeview.html#horizontalOffset">horizontalOffset</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/viewportEvent" />
<h3 class="fn"><a name="viewportEvent" />bool QTreeView.viewportEvent (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qabstractscrollarea.html#viewportEvent">QAbstractScrollArea.viewportEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/visualRect" />
<h3 class="fn"><a name="visualRect" /><a href="qrect.html">QRect</a> QTreeView.visualRect (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>)</h3><p>Reimplemented from <a href="qabstractitemview.html#visualRect">QAbstractItemView.visualRect</a>().</p>
<p>Returns the rectangle on the viewport occupied by the item at <i>index</i>. If the index is not visible or explicitly hidden, the returned rectangle is invalid.</p>
<a name="//apple_ref/cpp/instm/QTreeView/visualRegionForSelection" />
<h3 class="fn"><a name="visualRegionForSelection" /><a href="qregion.html">QRegion</a> QTreeView.visualRegionForSelection (<i>self</i>, <a href="qitemselection.html">QItemSelection</a>)</h3><p>Reimplemented from <a href="qabstractitemview.html#visualRegionForSelection">QAbstractItemView.visualRegionForSelection</a>().</p>
<p>Returns the rectangle from the viewport of the items in the given <i>selection</i>.</p>
<p /><h3 class="fn"><a name="wordWrap" />bool QTreeView.wordWrap (<i>self</i>)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="collapsed" />void collapsed (const QModelIndex&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the item specified by <i>index</i> is collapsed.</p>
<a name="//apple_ref/cpp/instm/QTreeView/columnAt" />
<h3 class="fn"><a name="expanded" />void expanded (const QModelIndex&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the item specified by <i>index</i> is expanded.</p>
<p>See also <a href="qtreeview.html#setExpanded">setExpanded</a>().</p>
<a name="//apple_ref/cpp/instm/QTreeView/header" />
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.4 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.3</td></tr></table></div></address></body></html>