File: qdirmodel.html

package info (click to toggle)
python-qt4 4.0.1-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 18,632 kB
  • ctags: 2,639
  • sloc: python: 29,409; sh: 5,646; cpp: 3,168; xml: 149; makefile: 109
file content (113 lines) | stat: -rw-r--r-- 23,662 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
<?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>QDirModel 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">QDirModel Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QDirModel class provides a data model for the local filesystem. <a href="#details">More...</a></p>
<p>Inherits <a href="qabstractitemmodel.html">QAbstractItemModel</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qdirmodel.html#Roles-enum">Roles</a></b> { FileIconRole, FilePathRole, FileNameRole }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdirmodel.html#QDirModel">__init__</a></b> (<i>self</i>, QStringList&#160;<i>nameFilters</i>, QDir.Filters&#160;<i>filters</i>, QDir.SortFlags&#160;<i>sort</i>, QObject&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qdirmodel.html#QDirModel-2">__init__</a></b> (<i>self</i>, QObject&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />int <b><a href="qdirmodel.html#columnCount">columnCount</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>)</li><li><div class="fn" />QVariant <b><a href="qdirmodel.html#data">data</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>, int&#160;<i>role</i>&#160;=&#160;Qt.DisplayRole)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#dropMimeData">dropMimeData</a></b> (<i>self</i>, QMimeData&#160;<i>data</i>, Qt.DropAction&#160;<i>action</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, QModelIndex&#160;<i>parent</i>)</li><li><div class="fn" />QIcon <b><a href="qdirmodel.html#fileIcon">fileIcon</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />QFileInfo <b><a href="qdirmodel.html#fileInfo">fileInfo</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />QString <b><a href="qdirmodel.html#fileName">fileName</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />QString <b><a href="qdirmodel.html#filePath">filePath</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />QDir.Filters <b><a href="qdirmodel.html#filter">filter</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.ItemFlags <b><a href="qdirmodel.html#flags">flags</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#hasChildren">hasChildren</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />QVariant <b><a href="qdirmodel.html#headerData">headerData</a></b> (<i>self</i>, int&#160;<i>section</i>, Qt.Orientation&#160;<i>orientation</i>, int&#160;<i>role</i>)</li><li><div class="fn" />QFileIconProvider <b><a href="qdirmodel.html#iconProvider">iconProvider</a></b> (<i>self</i>)</li><li><div class="fn" />QModelIndex <b><a href="qdirmodel.html#index">index</a></b> (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />QModelIndex <b><a href="qdirmodel.html#index-2">index</a></b> (<i>self</i>, QString&#160;<i>path</i>, int&#160;<i>column</i>&#160;=&#160;0)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#isDir">isDir</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#isReadOnly">isReadOnly</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#lazyChildCount">lazyChildCount</a></b> (<i>self</i>)</li><li><div class="fn" />QMimeData <b><a href="qdirmodel.html#mimeData">mimeData</a></b> (<i>self</i>, QModelIndex-list&#160;<i>indexes</i>)</li><li><div class="fn" />QStringList <b><a href="qdirmodel.html#mimeTypes">mimeTypes</a></b> (<i>self</i>)</li><li><div class="fn" />QModelIndex <b><a href="qdirmodel.html#mkdir">mkdir</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>, QString&#160;<i>name</i>)</li><li><div class="fn" />QStringList <b><a href="qdirmodel.html#nameFilters">nameFilters</a></b> (<i>self</i>)</li><li><div class="fn" />QModelIndex <b><a href="qdirmodel.html#parent">parent</a></b> (<i>self</i>, QModelIndex&#160;<i>child</i>)</li><li><div class="fn" />QObject <b><a href="qdirmodel.html#parent-2">parent</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#refresh">refresh</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />bool <b><a href="qdirmodel.html#remove">remove</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#resolveSymlinks">resolveSymlinks</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#rmdir">rmdir</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />int <b><a href="qdirmodel.html#rowCount">rowCount</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#setData">setData</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>, QVariant&#160;<i>value</i>, int&#160;<i>role</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#setFilter">setFilter</a></b> (<i>self</i>, QDir.Filters&#160;<i>filters</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#setIconProvider">setIconProvider</a></b> (<i>self</i>, QFileIconProvider&#160;<i>provider</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#setLazyChildCount">setLazyChildCount</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#setNameFilters">setNameFilters</a></b> (<i>self</i>, QStringList&#160;<i>filters</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#setReadOnly">setReadOnly</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#setResolveSymlinks">setResolveSymlinks</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#setSorting">setSorting</a></b> (<i>self</i>, QDir.SortFlags&#160;<i>sort</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#sort">sort</a></b> (<i>self</i>, int&#160;<i>column</i>, Qt.SortOrder&#160;<i>order</i>)</li><li><div class="fn" />QDir.SortFlags <b><a href="qdirmodel.html#sorting">sorting</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.DropActions <b><a href="qdirmodel.html#supportedDropActions">supportedDropActions</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDirModel class provides a data model for the local filesystem.</p>
<p>This class provides access to the local filesystem, providing functions for renaming and removing files and directories, and for creating new directories. In the simplest case, it can be used with a suitable display widget as part of a browser or filer.</p>
<p>QDirModel does not store file information internally or cache file data.</p>
<p>A directory model that displays the contents of a default directory is usually constructed with a parent object:</p>
<pre>
        QDirModel *model = new QDirModel;
</pre>
<p>A tree view can be used to display the contents of the model</p>
<pre>
        QTreeView *tree = new QTreeView(splitter);
        tree-&gt;setModel(model);
</pre>
<p>and the contents of a particular directory can be displayed by setting the tree view's root index:</p>
<pre>
        tree-&gt;setRootIndex(model-&gt;index(QDir.currentPath()));
</pre>
<p>The view's root index can be used to control how much of a hierarchical model is displayed. QDirModel provides a convenience function that returns a suitable model index for a path to a directory within the model.</p>
<p>QDirModel can be accessed using the standard interface provided by <a href="qabstractitemmodel.html">QAbstractItemModel</a>, but it also provides some convenience functions that are specific to a directory model. The <a href="qdirmodel.html#fileInfo">fileInfo</a>(), <a href="qdirmodel.html#isDir">isDir</a>(), <a href="qobject-qt3.html#name">name</a>(), and path() functions provide information about the underlying files and directories related to items in the model. Directories can be created and removed using <a href="qdirmodel.html#mkdir">mkdir</a>(), <a href="qdirmodel.html#rmdir">rmdir</a>(), and the model will be automatically updated to take the changes into account.</p>
<p>See also <a href="qdirmodel.html#nameFilters">nameFilters</a>(), <a href="qdirmodel.html#setFilter">setFilter</a>(), <a href="qdirmodel.html#filter">filter</a>(), <a href="model-view-programming.html">Model/View Programming</a>, <a href="qlistview.html">QListView</a>, and <a href="qtreeview.html">QTreeView</a>.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Roles-enum" />QDirModel.Roles</h3><table border="1" cellpadding="2" cellspacing="1" width="40%">
<tr>
<th width="60%">Constant</th>
<th width="40%">Value</th>
</tr>
<tr>
<td valign="top"><tt>QDirModel.FileIconRole</tt></td>
<td align="center" valign="top"><tt>Qt.DecorationRole</tt></td>
</tr>
<tr>
<td valign="top"><tt>QDirModel.FilePathRole</tt></td>
<td align="center" valign="top"><tt>Qt.UserRole + 1</tt></td>
</tr>
<tr>
<td valign="top"><tt>QDirModel.FileNameRole</tt></td>
<td align="center" valign="top"> </td>
</tr>
</table>
<br />
<br />
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDirModel" />QDirModel.__init__ (<i>self</i>, <a href="qstringlist.html">QStringList</a>&#160;<i>nameFilters</i>, <a href="qdir-filters.html">QDir.Filters</a>&#160;<i>filters</i>, <a href="qdir-sortflags.html">QDir.SortFlags</a>&#160;<i>sort</i>, <a href="qobject.html">QObject</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 new directory model with the given <i>parent</i>. Only those files matching the <i>nameFilters</i> and the <i>filters</i> are included in the model. The sort order is given by the <i>sort</i> flags.</p>
<h3 class="fn"><a name="QDirModel-2" />QDirModel.__init__ (<i>self</i>, <a href="qobject.html">QObject</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 directory model with the given <i>parent</i>.</p>
<h3 class="fn"><a name="columnCount" />int QDirModel.columnCount (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>)</h3><p>Returns the number of columns in the <i>parent</i> model item.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#columnCount">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="data" /><a href="qvariant.html">QVariant</a> QDirModel.data (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>, int&#160;<i>role</i>&#160;=&#160;Qt.DisplayRole)</h3><p>Returns the data for the model item <i>index</i> with the given <i>role</i>.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#data">QAbstractItemModel</a>.</p>
<p>See also <a href="qdirmodel.html#setData">setData</a>().</p>
<h3 class="fn"><a name="dropMimeData" />bool QDirModel.dropMimeData (<i>self</i>, <a href="qmimedata.html">QMimeData</a>&#160;<i>data</i>, <a href="qt.html#DropAction-enum">Qt.DropAction</a>&#160;<i>action</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>)</h3><p>Handles the <i>data</i> supplied by a drag and drop operation that ended with the given <i>action</i> over the row in the model specified by the <i>row</i> and <i>column</i> and by the <i>parent</i> index.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#dropMimeData">QAbstractItemModel</a>.</p>
<p>See also <a href="qdirmodel.html#supportedDropActions">supportedDropActions</a>().</p>
<h3 class="fn"><a name="fileIcon" /><a href="qicon.html">QIcon</a> QDirModel.fileIcon (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns the icons for the item stored in the model under the given <i>index</i>.</p>
<h3 class="fn"><a name="fileInfo" /><a href="qfileinfo.html">QFileInfo</a> QDirModel.fileInfo (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns the file information for the model item <i>index</i>.</p>
<h3 class="fn"><a name="fileName" /><a href="qstring.html">QString</a> QDirModel.fileName (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns the name of the item stored in the model under the <i>index</i> given.</p>
<h3 class="fn"><a name="filePath" /><a href="qstring.html">QString</a> QDirModel.filePath (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns the path of the item stored in the model under the <i>index</i> given.</p>
<h3 class="fn"><a name="filter" /><a href="qdir-filters.html">QDir.Filters</a> QDirModel.filter (<i>self</i>)</h3><p>Returns the filter specification for the directory model.</p>
<p>See also <a href="qdirmodel.html#setFilter">setFilter</a>() and <a href="qdir.html#Filter-enum">QDir.Filters</a>.</p>
<h3 class="fn"><a name="flags" /><a href="qt-itemflags.html">Qt.ItemFlags</a> QDirModel.flags (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns the item flags for the given <i>index</i> in the model.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#flags">QAbstractItemModel</a>.</p>
<p>See also <a href="qt.html#ItemFlag-enum">Qt.ItemFlags</a>.</p>
<h3 class="fn"><a name="hasChildren" />bool QDirModel.hasChildren (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns true if the <i>parent</i> model item has children; otherwise returns false.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#hasChildren">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="headerData" /><a href="qvariant.html">QVariant</a> QDirModel.headerData (<i>self</i>, int&#160;<i>section</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>&#160;<i>orientation</i>, int&#160;<i>role</i>)</h3><p>Returns the data stored under the given <i>role</i> for the specified <i>section</i> of the header with the given <i>orientation</i>.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#headerData">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="iconProvider" /><a href="qfileiconprovider.html">QFileIconProvider</a> QDirModel.iconProvider (<i>self</i>)</h3><p>Returns the file icon provider for this directory model.</p>
<p>See also <a href="qdirmodel.html#setIconProvider">setIconProvider</a>().</p>
<h3 class="fn"><a name="index" /><a href="qmodelindex.html">QModelIndex</a> QDirModel.index (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>Returns the model item index for the item in the <i>parent</i> with the given <i>row</i> and <i>column</i>.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#index">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="index-2" /><a href="qmodelindex.html">QModelIndex</a> QDirModel.index (<i>self</i>, <a href="qstring.html">QString</a>&#160;<i>path</i>, int&#160;<i>column</i>&#160;=&#160;0)</h3><p>This is an overloaded member function, provided for convenience.</p>
<p>Returns the model item index for the given <i>path</i>.</p>
<h3 class="fn"><a name="isDir" />bool QDirModel.isDir (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns true if the model item <i>index</i> represents a directory; otherwise returns false.</p>
<h3 class="fn"><a name="isReadOnly" />bool QDirModel.isReadOnly (<i>self</i>)</h3><h3 class="fn"><a name="lazyChildCount" />bool QDirModel.lazyChildCount (<i>self</i>)</h3><h3 class="fn"><a name="mimeData" /><a href="qmimedata.html">QMimeData</a> QDirModel.mimeData (<i>self</i>, QModelIndex-list&#160;<i>indexes</i>)</h3><p>The <i>QMimeData</i> result</p><p>Returns an object that contains a serialized description of the specified <i>indexes</i>. The format used to describe the items corresponding to the indexes is obtained from the <a href="qdirmodel.html#mimeTypes">mimeTypes</a>() function.</p>
<p>If the list of indexes is empty, 0 is returned rather than a serialized empty list.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#mimeData">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="mimeTypes" /><a href="qstringlist.html">QStringList</a> QDirModel.mimeTypes (<i>self</i>)</h3><p>Returns a list of MIME types that can be used to describe a list of items in the model.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#mimeTypes">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="mkdir" /><a href="qmodelindex.html">QModelIndex</a> QDirModel.mkdir (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>, <a href="qstring.html">QString</a>&#160;<i>name</i>)</h3><p>Create a directory with the <i>name</i> in the <i>parent</i> model item.</p>
<h3 class="fn"><a name="nameFilters" /><a href="qstringlist.html">QStringList</a> QDirModel.nameFilters (<i>self</i>)</h3><p>Returns a list of filters applied to the names in the model.</p>
<p>See also <a href="qdirmodel.html#setNameFilters">setNameFilters</a>().</p>
<h3 class="fn"><a name="parent" /><a href="qmodelindex.html">QModelIndex</a> QDirModel.parent (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>child</i>)</h3><p>Return the parent of the given <i>child</i> model item.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#parent">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="parent-2" /><a href="qobject.html">QObject</a> QDirModel.parent (<i>self</i>)</h3><h3 class="fn"><a name="refresh" />QDirModel.refresh (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>Refreshes (rereads) the children of <i>parent</i>.</p>
<h3 class="fn"><a name="remove" />bool QDirModel.remove (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Removes the model item <i>index</i> from the directory model, returning true if successful. If the item cannot be removed, false is returned.</p>
<h3 class="fn"><a name="resolveSymlinks" />bool QDirModel.resolveSymlinks (<i>self</i>)</h3><h3 class="fn"><a name="rmdir" />bool QDirModel.rmdir (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Removes the directory corresponding to the model item <i>index</i> in the directory model, returning true if successful. If the directory cannot be removed, false is returned.</p>
<h3 class="fn"><a name="rowCount" />int QDirModel.rowCount (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>)</h3><p>Returns the number of rows in the <i>parent</i> model item.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#rowCount">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="setData" />bool QDirModel.setData (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>, <a href="qvariant.html">QVariant</a>&#160;<i>value</i>, int&#160;<i>role</i>)</h3><p>Sets the data for the model item <i>index</i> with the given <i>role</i> to the data referenced by the <i>value</i>. Returns true if successful; otherwise returns false.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#setData">QAbstractItemModel</a>.</p>
<p>See also <a href="qdirmodel.html#data">data</a>() and <a href="qt.html#ItemDataRole-enum">Qt.ItemDataRole</a>.</p>
<h3 class="fn"><a name="setFilter" />QDirModel.setFilter (<i>self</i>, <a href="qdir-filters.html">QDir.Filters</a>&#160;<i>filters</i>)</h3><p>Sets the directory model's filter to that specified by <i>filters</i>.</p>
<p>Note that the filter you set should always include the <a href="qdir.html#Filter-enum">QDir.AllDirs</a> enum value, otherwise <a href="qdirmodel.html">QDirModel</a> won't be able to read the directory structure.</p>
<p>See also <a href="qdirmodel.html#filter">filter</a>() and <a href="qdir.html#Filter-enum">QDir.Filters</a>.</p>
<h3 class="fn"><a name="setIconProvider" />QDirModel.setIconProvider (<i>self</i>, <a href="qfileiconprovider.html">QFileIconProvider</a>&#160;<i>provider</i>)</h3><p>Sets the <i>provider</i> of file icons for the directory model.</p>
<p>See also <a href="qdirmodel.html#iconProvider">iconProvider</a>().</p>
<h3 class="fn"><a name="setLazyChildCount" />QDirModel.setLazyChildCount (<i>self</i>, bool&#160;<i>enable</i>)</h3><h3 class="fn"><a name="setNameFilters" />QDirModel.setNameFilters (<i>self</i>, <a href="qstringlist.html">QStringList</a>&#160;<i>filters</i>)</h3><p>Sets the name <i>filters</i> for the directory model.</p>
<p>See also <a href="qdirmodel.html#nameFilters">nameFilters</a>().</p>
<h3 class="fn"><a name="setReadOnly" />QDirModel.setReadOnly (<i>self</i>, bool&#160;<i>enable</i>)</h3><h3 class="fn"><a name="setResolveSymlinks" />QDirModel.setResolveSymlinks (<i>self</i>, bool&#160;<i>enable</i>)</h3><h3 class="fn"><a name="setSorting" />QDirModel.setSorting (<i>self</i>, <a href="qdir-sortflags.html">QDir.SortFlags</a>&#160;<i>sort</i>)</h3><p>Sets the directory model's sorting order to that specified by <i>sort</i>.</p>
<p>See also <a href="qdirmodel.html#sorting">sorting</a>() and <a href="qdir.html#SortFlag-enum">QDir.SortFlags</a>.</p>
<h3 class="fn"><a name="sort" />QDirModel.sort (<i>self</i>, int&#160;<i>column</i>, <a href="qt.html#SortOrder-enum">Qt.SortOrder</a>&#160;<i>order</i>)</h3><p>Sort the model items in the <i>column</i> using the <i>order</i> given. The order is a value defined in <a href="qt.html#SortOrder-enum">Qt.SortOrder</a>.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#sort">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="sorting" /><a href="qdir-sortflags.html">QDir.SortFlags</a> QDirModel.sorting (<i>self</i>)</h3><p>Returns the sorting method used for the directory model.</p>
<p>See also <a href="qdirmodel.html#setSorting">setSorting</a>() and <a href="qdir.html#SortFlag-enum">QDir.SortFlags</a>.</p>
<h3 class="fn"><a name="supportedDropActions" /><a href="qt-dropactions.html">Qt.DropActions</a> QDirModel.supportedDropActions (<i>self</i>)</h3><p>Returns the drop actions supported by this model.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#supportedDropActions">QAbstractItemModel</a>.</p>
<p>See also <a href="qt.html#DropAction-enum">Qt.DropActions</a>.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td width="25%">PyQt&#160;4.0.1 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.trolltech.com">Trolltech&#160;AS</a> 2006</td><td align="right" width="25%">Qt&#160;4.1.4</td></tr></table></div></address></body></html>