File: qfilesystemmodel.html

package info (click to toggle)
qt4-x11 4%3A4.8.2%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 701,696 kB
  • sloc: cpp: 2,686,179; ansic: 375,485; python: 25,859; sh: 19,349; xml: 17,091; perl: 14,765; yacc: 5,383; asm: 5,038; makefile: 1,259; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (465 lines) | stat: -rw-r--r-- 48,797 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qfilesystemmodel.cpp -->
  <title>Qt 4.8: QFileSystemModel Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QFileSystemModel</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#example-usage">Example Usage</a></li>
<li class="level2"><a href="#caching-and-performance">Caching and Performance</a></li>
</ul>
</div>
<h1 class="title">QFileSystemModel Class Reference</h1>
<!-- $$$QFileSystemModel-brief -->
<p>The QFileSystemModel class provides a data model for the local filesystem. <a href="#details">More...</a></p>
<!-- @@@QFileSystemModel -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QFileSystemModel&gt;</span></pre><p><b>Inherits: </b><a href="qabstractitemmodel.html">QAbstractItemModel</a>.</p>
<p>This class was introduced in Qt 4.4.</p>
<ul>
<li><a href="qfilesystemmodel-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#Roles-enum">Roles</a></b> { FileIconRole, FilePathRole, FileNameRole, FilePermissions }</td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><a href="qfilesystemmodel.html#nameFilterDisables-prop">nameFilterDisables</a></b> : bool</li>
<li class="fn"><b><a href="qfilesystemmodel.html#readOnly-prop">readOnly</a></b> : bool</li>
<li class="fn"><b><a href="qfilesystemmodel.html#resolveSymlinks-prop">resolveSymlinks</a></b> : bool</li>
</ul>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#QFileSystemModel">QFileSystemModel</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#dtor.QFileSystemModel">~QFileSystemModel</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QIcon </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#fileIcon">fileIcon</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFileInfo </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#fileInfo">fileInfo</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#fileName">fileName</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#filePath">filePath</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDir::Filters </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#filter">filter</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFileIconProvider * </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#iconProvider">iconProvider</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#index-2">index</a></b> ( const QString &amp; <i>path</i>, int <i>column</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#isDir">isDir</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#readOnly-prop">isReadOnly</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#lastModified">lastModified</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#mkdir">mkdir</a></b> ( const QModelIndex &amp; <i>parent</i>, const QString &amp; <i>name</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#myComputer">myComputer</a></b> ( int <i>role</i> = Qt::DisplayRole ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#nameFilterDisables-prop">nameFilterDisables</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#nameFilters">nameFilters</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFile::Permissions </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#permissions">permissions</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#remove">remove</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#resolveSymlinks-prop">resolveSymlinks</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#rmdir">rmdir</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDir </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#rootDirectory">rootDirectory</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#rootPath">rootPath</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#setFilter">setFilter</a></b> ( QDir::Filters <i>filters</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#setIconProvider">setIconProvider</a></b> ( QFileIconProvider * <i>provider</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#nameFilterDisables-prop">setNameFilterDisables</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#setNameFilters">setNameFilters</a></b> ( const QStringList &amp; <i>filters</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#readOnly-prop">setReadOnly</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#resolveSymlinks-prop">setResolveSymlinks</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#setRootPath">setRootPath</a></b> ( const QString &amp; <i>newPath</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#size">size</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#type">type</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
</table>
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#canFetchMore">canFetchMore</a></b> ( const QModelIndex &amp; <i>parent</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#columnCount">columnCount</a></b> ( const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#data">data</a></b> ( const QModelIndex &amp; <i>index</i>, int <i>role</i> = Qt::DisplayRole ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#dropMimeData">dropMimeData</a></b> ( const QMimeData * <i>data</i>, Qt::DropAction <i>action</i>, int <i>row</i>, int <i>column</i>, const QModelIndex &amp; <i>parent</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#fetchMore">fetchMore</a></b> ( const QModelIndex &amp; <i>parent</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual Qt::ItemFlags </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#flags">flags</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#hasChildren">hasChildren</a></b> ( const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#headerData">headerData</a></b> ( int <i>section</i>, Qt::Orientation <i>orientation</i>, int <i>role</i> = Qt::DisplayRole ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#index">index</a></b> ( int <i>row</i>, int <i>column</i>, const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QMimeData * </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#mimeData">mimeData</a></b> ( const QModelIndexList &amp; <i>indexes</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QStringList </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#mimeTypes">mimeTypes</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#parent">parent</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#rowCount">rowCount</a></b> ( const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#setData">setData</a></b> ( const QModelIndex &amp; <i>idx</i>, const QVariant &amp; <i>value</i>, int <i>role</i> = Qt::EditRole )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#sort">sort</a></b> ( int <i>column</i>, Qt::SortOrder <i>order</i> = Qt::AscendingOrder )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual Qt::DropActions </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#supportedDropActions">supportedDropActions</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">35 public functions inherited from <a href="qabstractitemmodel.html#public-functions">QAbstractItemModel</a></li>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#directoryLoaded">directoryLoaded</a></b> ( const QString &amp; <i>path</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#fileRenamed">fileRenamed</a></b> ( const QString &amp; <i>path</i>, const QString &amp; <i>oldName</i>, const QString &amp; <i>newName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#rootPathChanged">rootPathChanged</a></b> ( const QString &amp; <i>newPath</i> )</td></tr>
</table>
<ul>
<li class="fn">18 signals inherited from <a href="qabstractitemmodel.html#signals">QAbstractItemModel</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#event">event</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#timerEvent">timerEvent</a></b> ( QTimerEvent * <i>event</i> )</td></tr>
</table>
<ul>
<li class="fn">21 protected functions inherited from <a href="qabstractitemmodel.html#protected-functions">QAbstractItemModel</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">2 public slots inherited from <a href="qabstractitemmodel.html#public-slots">QAbstractItemModel</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">21 protected functions inherited from <a href="qabstractitemmodel.html#protected-functions">QAbstractItemModel</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected slot inherited from <a href="qabstractitemmodel.html#protected-slots">QAbstractItemModel</a></li>
</ul>
<a name="details"></a>
<!-- $$$QFileSystemModel-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QFileSystemModel 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 filter.</p>
<p>QFileSystemModel 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="qfilesystemmodel.html#fileInfo">fileInfo</a>(), <a href="qfilesystemmodel.html#isDir">isDir</a>(), <a href="qobject-qt3.html#name" class="compat">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="qfilesystemmodel.html#mkdir">mkdir</a>(), <a href="qfilesystemmodel.html#rmdir">rmdir</a>().</p>
<p><b>Note:</b> QFileSystemModel requires an instance of a GUI application.</p>
<a name="example-usage"></a>
<h3>Example Usage</h3>
<p>A directory model that displays the contents of a default directory is usually constructed with a parent object:</p>
<pre class="cpp">     <span class="type">QFileSystemModel</span> <span class="operator">*</span>model <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QFileSystemModel</span>;
     model<span class="operator">-</span><span class="operator">&gt;</span>setRootPath(<span class="type"><a href="qdir.html">QDir</a></span><span class="operator">::</span>currentPath());</pre>
<p>A tree view can be used to display the contents of the model</p>
<pre class="cpp">     <span class="type"><a href="qtreeview.html">QTreeView</a></span> <span class="operator">*</span>tree <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qtreeview.html">QTreeView</a></span>(splitter);
     tree<span class="operator">-</span><span class="operator">&gt;</span>setModel(model);</pre>
<p>and the contents of a particular directory can be displayed by setting the tree view's root index:</p>
<pre class="cpp">     tree<span class="operator">-</span><span class="operator">&gt;</span>setRootIndex(model<span class="operator">-</span><span class="operator">&gt;</span>index(<span class="type"><a href="qdir.html">QDir</a></span><span class="operator">::</span>currentPath()));</pre>
<p>The view's root index can be used to control how much of a hierarchical model is displayed. <a href="qdirmodel.html" class="obsolete">QDirModel<sup>(obsolete)</sup></a> provides a convenience function that returns a suitable model index for a path to a directory within the model.</p>
<a name="caching-and-performance"></a>
<h3>Caching and Performance</h3>
<p>QFileSystemModel will not fetch any files or directories until <a href="qfilesystemmodel.html#setRootPath">setRootPath</a>() is called. This will prevent any unnecessary querying on the file system until that point such as listing the drives on Windows.</p>
<p>Unlike <a href="qdirmodel.html" class="obsolete">QDirModel<sup>(obsolete)</sup></a>, QFileSystemModel uses a separate thread to populate itself so it will not cause the main thread to hang as the file system is being queried. Calls to <a href="qfilesystemmodel.html#rowCount">rowCount</a>() will return 0 until the model populates a directory.</p>
<p>QFileSystemModel keeps a cache with file information. The cache is automatically kept up to date using the <a href="qfilesystemwatcher.html">QFileSystemWatcher</a>.</p>
</div>
<p><b>See also </b><a href="model-view-programming.html#model-classes">Model Classes</a>.</p>
<!-- @@@QFileSystemModel -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Roles$$$FileIconRole$$$FilePathRole$$$FileNameRole$$$FilePermissions -->
<h3 class="fn"><a name="Roles-enum"></a>enum QFileSystemModel::<span class="name">Roles</span></h3>
<table class="valuelist"><tr><th class="tblConst">Constant</th><th class="tblVal">Value</th></tr>
<tr><td class="topAlign"><tt>QFileSystemModel::FileIconRole</tt></td><td class="topAlign"><tt>Qt::DecorationRole</tt></td></tr>
<tr><td class="topAlign"><tt>QFileSystemModel::FilePathRole</tt></td><td class="topAlign"><tt>Qt::UserRole + 1</tt></td></tr>
<tr><td class="topAlign"><tt>QFileSystemModel::FileNameRole</tt></td><td class="topAlign"><tt>Qt::UserRole + 2</tt></td></tr>
<tr><td class="topAlign"><tt>QFileSystemModel::FilePermissions</tt></td><td class="topAlign"><tt>Qt::UserRole + 3</tt></td></tr>
</table>
<!-- @@@Roles -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$nameFilterDisables-prop$$$nameFilterDisables$$$setNameFilterDisablesbool -->
<h3 class="fn"><a name="nameFilterDisables-prop"></a><span class="name">nameFilterDisables</span> : <span class="type">bool</span></h3>
<p>This property holds whether files that don't pass the name filter are hidden or disabled.</p>
<p>This property is true by default</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>nameFilterDisables</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setNameFilterDisables</b></span> ( bool <i>enable</i> )</td></tr>
</table>
<!-- @@@nameFilterDisables -->
<!-- $$$readOnly-prop$$$isReadOnly$$$setReadOnlybool -->
<h3 class="fn"><a name="readOnly-prop"></a><span class="name">readOnly</span> : <span class="type">bool</span></h3>
<p>This property holds whether the directory model allows writing to the file system.</p>
<p>If this property is set to false, the directory model will allow renaming, copying and deleting of files and directories.</p>
<p>This property is true by default</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isReadOnly</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setReadOnly</b></span> ( bool <i>enable</i> )</td></tr>
</table>
<!-- @@@readOnly -->
<!-- $$$resolveSymlinks-prop$$$resolveSymlinks$$$setResolveSymlinksbool -->
<h3 class="fn"><a name="resolveSymlinks-prop"></a><span class="name">resolveSymlinks</span> : <span class="type">bool</span></h3>
<p>This property holds whether the directory model should resolve symbolic links.</p>
<p>This is only relevant on operating systems that support symbolic links.</p>
<p>By default, this property is false.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>resolveSymlinks</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setResolveSymlinks</b></span> ( bool <i>enable</i> )</td></tr>
</table>
<!-- @@@resolveSymlinks -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QFileSystemModel[overload1]$$$QFileSystemModelQObject* -->
<h3 class="fn"><a name="QFileSystemModel"></a>QFileSystemModel::<span class="name">QFileSystemModel</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a file system model with the given <i>parent</i>.</p>
<!-- @@@QFileSystemModel -->
<!-- $$$~QFileSystemModel[overload1]$$$~QFileSystemModel -->
<h3 class="fn"><a name="dtor.QFileSystemModel"></a>QFileSystemModel::<span class="name">~QFileSystemModel</span> ()</h3>
<p>Destroys this file system model.</p>
<!-- @@@~QFileSystemModel -->
<!-- $$$canFetchMore[overload1]$$$canFetchMoreconstQModelIndex& -->
<h3 class="fn"><a name="canFetchMore"></a><span class="type">bool</span> QFileSystemModel::<span class="name">canFetchMore</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#canFetchMore">QAbstractItemModel::canFetchMore</a>().</p>
<!-- @@@canFetchMore -->
<!-- $$$columnCount[overload1]$$$columnCountconstQModelIndex& -->
<h3 class="fn"><a name="columnCount"></a><span class="type">int</span> QFileSystemModel::<span class="name">columnCount</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#columnCount">QAbstractItemModel::columnCount</a>().</p>
<!-- @@@columnCount -->
<!-- $$$data[overload1]$$$dataconstQModelIndex&int -->
<h3 class="fn"><a name="data"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QFileSystemModel::<span class="name">data</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i>, <span class="type">int</span> <i>role</i> = Qt::DisplayRole ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#data">QAbstractItemModel::data</a>().</p>
<p><b>See also </b><a href="qfilesystemmodel.html#setData">setData</a>().</p>
<!-- @@@data -->
<!-- $$$directoryLoaded[overload1]$$$directoryLoadedconstQString& -->
<h3 class="fn"><a name="directoryLoaded"></a><span class="type">void</span> QFileSystemModel::<span class="name">directoryLoaded</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>path</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the gatherer thread has finished to load the <i>path</i>.</p>
<p>This function was introduced in Qt 4.7.</p>
<!-- @@@directoryLoaded -->
<!-- $$$dropMimeData[overload1]$$$dropMimeDataconstQMimeData*Qt::DropActionintintconstQModelIndex& -->
<h3 class="fn"><a name="dropMimeData"></a><span class="type">bool</span> QFileSystemModel::<span class="name">dropMimeData</span> ( const <span class="type"><a href="qmimedata.html">QMimeData</a></span> * <i>data</i>, <span class="type"><a href="qt.html#DropAction-enum">Qt::DropAction</a></span> <i>action</i>, <span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>column</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> )<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#dropMimeData">QAbstractItemModel::dropMimeData</a>().</p>
<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><b>See also </b><a href="qfilesystemmodel.html#supportedDropActions">supportedDropActions</a>().</p>
<!-- @@@dropMimeData -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn"><a name="event"></a><span class="type">bool</span> QFileSystemModel::<span class="name">event</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$fetchMore[overload1]$$$fetchMoreconstQModelIndex& -->
<h3 class="fn"><a name="fetchMore"></a><span class="type">void</span> QFileSystemModel::<span class="name">fetchMore</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> )<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#fetchMore">QAbstractItemModel::fetchMore</a>().</p>
<!-- @@@fetchMore -->
<!-- $$$fileIcon[overload1]$$$fileIconconstQModelIndex& -->
<h3 class="fn"><a name="fileIcon"></a><span class="type"><a href="qicon.html">QIcon</a></span> QFileSystemModel::<span class="name">fileIcon</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const</h3>
<p>Returns the icon for the item stored in the model under the given <i>index</i>.</p>
<!-- @@@fileIcon -->
<!-- $$$fileInfo[overload1]$$$fileInfoconstQModelIndex& -->
<h3 class="fn"><a name="fileInfo"></a><span class="type"><a href="qfileinfo.html">QFileInfo</a></span> QFileSystemModel::<span class="name">fileInfo</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const</h3>
<p>Returns the <a href="qfileinfo.html">QFileInfo</a> for the item stored in the model under the given <i>index</i>.</p>
<!-- @@@fileInfo -->
<!-- $$$fileName[overload1]$$$fileNameconstQModelIndex& -->
<h3 class="fn"><a name="fileName"></a><span class="type"><a href="qstring.html">QString</a></span> QFileSystemModel::<span class="name">fileName</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const</h3>
<p>Returns the file name for the item stored in the model under the given <i>index</i>.</p>
<!-- @@@fileName -->
<!-- $$$filePath[overload1]$$$filePathconstQModelIndex& -->
<h3 class="fn"><a name="filePath"></a><span class="type"><a href="qstring.html">QString</a></span> QFileSystemModel::<span class="name">filePath</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const</h3>
<p>Returns the path of the item stored in the model under the <i>index</i> given.</p>
<!-- @@@filePath -->
<!-- $$$fileRenamed[overload1]$$$fileRenamedconstQString&constQString&constQString& -->
<h3 class="fn"><a name="fileRenamed"></a><span class="type">void</span> QFileSystemModel::<span class="name">fileRenamed</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>path</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>oldName</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>newName</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted whenever a file with the <i>oldName</i> is successfully renamed to <i>newName</i>. The file is located in in the directory <i>path</i>.</p>
<!-- @@@fileRenamed -->
<!-- $$$filter[overload1]$$$filter -->
<h3 class="fn"><a name="filter"></a><span class="type"><a href="qdir.html#Filter-enum">QDir::Filters</a></span> QFileSystemModel::<span class="name">filter</span> () const</h3>
<p>Returns the filter specified for the directory model.</p>
<p>If a filter has not been set, the default filter is <a href="qdir.html#Filter-enum">QDir::AllEntries</a> | <a href="qdir.html#Filter-enum">QDir::NoDotAndDotDot</a> | <a href="qdir.html#Filter-enum">QDir::AllDirs</a>.</p>
<p><b>See also </b><a href="qfilesystemmodel.html#setFilter">setFilter</a>() and <a href="qdir.html#Filter-enum">QDir::Filters</a>.</p>
<!-- @@@filter -->
<!-- $$$flags[overload1]$$$flagsconstQModelIndex& -->
<h3 class="fn"><a name="flags"></a><span class="type"><a href="qt.html#ItemFlag-enum">Qt::ItemFlags</a></span> QFileSystemModel::<span class="name">flags</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#flags">QAbstractItemModel::flags</a>().</p>
<!-- @@@flags -->
<!-- $$$hasChildren[overload1]$$$hasChildrenconstQModelIndex& -->
<h3 class="fn"><a name="hasChildren"></a><span class="type">bool</span> QFileSystemModel::<span class="name">hasChildren</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#hasChildren">QAbstractItemModel::hasChildren</a>().</p>
<!-- @@@hasChildren -->
<!-- $$$headerData[overload1]$$$headerDataintQt::Orientationint -->
<h3 class="fn"><a name="headerData"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QFileSystemModel::<span class="name">headerData</span> ( <span class="type">int</span> <i>section</i>, <span class="type"><a href="qt.html#Orientation-enum">Qt::Orientation</a></span> <i>orientation</i>, <span class="type">int</span> <i>role</i> = Qt::DisplayRole ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#headerData">QAbstractItemModel::headerData</a>().</p>
<!-- @@@headerData -->
<!-- $$$iconProvider[overload1]$$$iconProvider -->
<h3 class="fn"><a name="iconProvider"></a><span class="type"><a href="qfileiconprovider.html">QFileIconProvider</a></span> * QFileSystemModel::<span class="name">iconProvider</span> () const</h3>
<p>Returns the file icon provider for this directory model.</p>
<p><b>See also </b><a href="qfilesystemmodel.html#setIconProvider">setIconProvider</a>().</p>
<!-- @@@iconProvider -->
<!-- $$$index[overload1]$$$indexintintconstQModelIndex& -->
<h3 class="fn"><a name="index"></a><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QFileSystemModel::<span class="name">index</span> ( <span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>column</i>, const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#index">QAbstractItemModel::index</a>().</p>
<!-- @@@index -->
<!-- $$$index$$$indexconstQString&int -->
<h3 class="fn"><a name="index-2"></a><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QFileSystemModel::<span class="name">index</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>path</i>, <span class="type">int</span> <i>column</i> = 0 ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the model item index for the given <i>path</i> and <i>column</i>.</p>
<!-- @@@index -->
<!-- $$$isDir[overload1]$$$isDirconstQModelIndex& -->
<h3 class="fn"><a name="isDir"></a><span class="type">bool</span> QFileSystemModel::<span class="name">isDir</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const</h3>
<p>Returns true if the model item <i>index</i> represents a directory; otherwise returns false.</p>
<!-- @@@isDir -->
<!-- $$$lastModified[overload1]$$$lastModifiedconstQModelIndex& -->
<h3 class="fn"><a name="lastModified"></a><span class="type"><a href="qdatetime.html">QDateTime</a></span> QFileSystemModel::<span class="name">lastModified</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const</h3>
<p>Returns the date and time when <i>index</i> was last modified.</p>
<!-- @@@lastModified -->
<!-- $$$mimeData[overload1]$$$mimeDataconstQModelIndexList& -->
<h3 class="fn"><a name="mimeData"></a><span class="type"><a href="qmimedata.html">QMimeData</a></span> * QFileSystemModel::<span class="name">mimeData</span> ( const <span class="type"><a href="qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a></span> &amp; <i>indexes</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#mimeData">QAbstractItemModel::mimeData</a>().</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="qfilesystemmodel.html#mimeTypes">mimeTypes</a>() function.</p>
<p>If the list of indexes is empty, 0 is returned rather than a serialized empty list.</p>
<!-- @@@mimeData -->
<!-- $$$mimeTypes[overload1]$$$mimeTypes -->
<h3 class="fn"><a name="mimeTypes"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QFileSystemModel::<span class="name">mimeTypes</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#mimeTypes">QAbstractItemModel::mimeTypes</a>().</p>
<p>Returns a list of MIME types that can be used to describe a list of items in the model.</p>
<!-- @@@mimeTypes -->
<!-- $$$mkdir[overload1]$$$mkdirconstQModelIndex&constQString& -->
<h3 class="fn"><a name="mkdir"></a><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QFileSystemModel::<span class="name">mkdir</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>name</i> )</h3>
<p>Create a directory with the <i>name</i> in the <i>parent</i> model index.</p>
<!-- @@@mkdir -->
<!-- $$$myComputer[overload1]$$$myComputerint -->
<h3 class="fn"><a name="myComputer"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QFileSystemModel::<span class="name">myComputer</span> ( <span class="type">int</span> <i>role</i> = Qt::DisplayRole ) const</h3>
<p>Returns the data stored under the given <i>role</i> for the item &quot;My Computer&quot;.</p>
<p><b>See also </b><a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a>.</p>
<!-- @@@myComputer -->
<!-- $$$nameFilters[overload1]$$$nameFilters -->
<h3 class="fn"><a name="nameFilters"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QFileSystemModel::<span class="name">nameFilters</span> () const</h3>
<p>Returns a list of filters applied to the names in the model.</p>
<p><b>See also </b><a href="qfilesystemmodel.html#setNameFilters">setNameFilters</a>().</p>
<!-- @@@nameFilters -->
<!-- $$$parent[overload1]$$$parentconstQModelIndex& -->
<h3 class="fn"><a name="parent"></a><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QFileSystemModel::<span class="name">parent</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#parent">QAbstractItemModel::parent</a>().</p>
<!-- @@@parent -->
<!-- $$$permissions[overload1]$$$permissionsconstQModelIndex& -->
<h3 class="fn"><a name="permissions"></a><span class="type"><a href="qfile.html#Permission-enum">QFile::Permissions</a></span> QFileSystemModel::<span class="name">permissions</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const</h3>
<p>Returns the complete OR-ed together combination of <a href="qfile.html#Permission-enum">QFile::Permission</a> for the <i>index</i>.</p>
<!-- @@@permissions -->
<!-- $$$remove[overload1]$$$removeconstQModelIndex& -->
<h3 class="fn"><a name="remove"></a><span class="type">bool</span> QFileSystemModel::<span class="name">remove</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const</h3>
<p>Removes the model item <i>index</i> from the file system model and <b>deletes the corresponding file from the file system</b>, returning true if successful. If the item cannot be removed, false is returned.</p>
<p><b>Warning:</b> This function deletes files from the file system; it does <b>not</b> move them to a location where they can be recovered.</p>
<p><b>See also </b><a href="qfilesystemmodel.html#rmdir">rmdir</a>().</p>
<!-- @@@remove -->
<!-- $$$rmdir[overload1]$$$rmdirconstQModelIndex& -->
<h3 class="fn"><a name="rmdir"></a><span class="type">bool</span> QFileSystemModel::<span class="name">rmdir</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const</h3>
<p>Removes the directory corresponding to the model item <i>index</i> in the file system model and <b>deletes the corresponding directory from the file system</b>, returning true if successful. If the directory cannot be removed, false is returned.</p>
<p><b>Warning:</b> This function deletes directories from the file system; it does <b>not</b> move them to a location where they can be recovered.</p>
<p><b>See also </b><a href="qfilesystemmodel.html#remove">remove</a>().</p>
<!-- @@@rmdir -->
<!-- $$$rootDirectory[overload1]$$$rootDirectory -->
<h3 class="fn"><a name="rootDirectory"></a><span class="type"><a href="qdir.html">QDir</a></span> QFileSystemModel::<span class="name">rootDirectory</span> () const</h3>
<p>The currently set directory</p>
<p><b>See also </b><a href="qfilesystemmodel.html#rootPath">rootPath</a>().</p>
<!-- @@@rootDirectory -->
<!-- $$$rootPath[overload1]$$$rootPath -->
<h3 class="fn"><a name="rootPath"></a><span class="type"><a href="qstring.html">QString</a></span> QFileSystemModel::<span class="name">rootPath</span> () const</h3>
<p>The currently set root path</p>
<p><b>See also </b><a href="qfilesystemmodel.html#setRootPath">setRootPath</a>() and <a href="qfilesystemmodel.html#rootDirectory">rootDirectory</a>().</p>
<!-- @@@rootPath -->
<!-- $$$rootPathChanged[overload1]$$$rootPathChangedconstQString& -->
<h3 class="fn"><a name="rootPathChanged"></a><span class="type">void</span> QFileSystemModel::<span class="name">rootPathChanged</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>newPath</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the root path has been changed to a <i>newPath</i>.</p>
<!-- @@@rootPathChanged -->
<!-- $$$rowCount[overload1]$$$rowCountconstQModelIndex& -->
<h3 class="fn"><a name="rowCount"></a><span class="type">int</span> QFileSystemModel::<span class="name">rowCount</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>parent</i> = QModelIndex() ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#rowCount">QAbstractItemModel::rowCount</a>().</p>
<!-- @@@rowCount -->
<!-- $$$setData[overload1]$$$setDataconstQModelIndex&constQVariant&int -->
<h3 class="fn"><a name="setData"></a><span class="type">bool</span> QFileSystemModel::<span class="name">setData</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>idx</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>value</i>, <span class="type">int</span> <i>role</i> = Qt::EditRole )<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#setData">QAbstractItemModel::setData</a>().</p>
<p><b>See also </b><a href="qfilesystemmodel.html#data">data</a>().</p>
<!-- @@@setData -->
<!-- $$$setFilter[overload1]$$$setFilterQDir::Filters -->
<h3 class="fn"><a name="setFilter"></a><span class="type">void</span> QFileSystemModel::<span class="name">setFilter</span> ( <span class="type"><a href="qdir.html#Filter-enum">QDir::Filters</a></span> <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="qfilesystemmodel.html">QFileSystemModel</a> won't be able to read the directory structure.</p>
<p><b>See also </b><a href="qfilesystemmodel.html#filter">filter</a>() and <a href="qdir.html#Filter-enum">QDir::Filters</a>.</p>
<!-- @@@setFilter -->
<!-- $$$setIconProvider[overload1]$$$setIconProviderQFileIconProvider* -->
<h3 class="fn"><a name="setIconProvider"></a><span class="type">void</span> QFileSystemModel::<span class="name">setIconProvider</span> ( <span class="type"><a href="qfileiconprovider.html">QFileIconProvider</a></span> * <i>provider</i> )</h3>
<p>Sets the <i>provider</i> of file icons for the directory model.</p>
<p><b>See also </b><a href="qfilesystemmodel.html#iconProvider">iconProvider</a>().</p>
<!-- @@@setIconProvider -->
<!-- $$$setNameFilters[overload1]$$$setNameFiltersconstQStringList& -->
<h3 class="fn"><a name="setNameFilters"></a><span class="type">void</span> QFileSystemModel::<span class="name">setNameFilters</span> ( const <span class="type"><a href="qstringlist.html">QStringList</a></span> &amp; <i>filters</i> )</h3>
<p>Sets the name <i>filters</i> to apply against the existing files.</p>
<p><b>See also </b><a href="qfilesystemmodel.html#nameFilters">nameFilters</a>().</p>
<!-- @@@setNameFilters -->
<!-- $$$setRootPath[overload1]$$$setRootPathconstQString& -->
<h3 class="fn"><a name="setRootPath"></a><span class="type"><a href="qmodelindex.html">QModelIndex</a></span> QFileSystemModel::<span class="name">setRootPath</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>newPath</i> )</h3>
<p>Sets the directory that is being watched by the model to <i>newPath</i> by installing a <a href="qfilesystemwatcher.html">file system watcher</a> on it. Any changes to files and directories within this directory will be reflected in the model.</p>
<p>If the path is changed, the <a href="qfilesystemmodel.html#rootPathChanged">rootPathChanged</a>() signal will be emitted.</p>
<p><b>Note:</b> This function does not change the structure of the model or modify the data available to views. In other words, the &quot;root&quot; of the model is <i>not</i> changed to include only files and directories within the directory specified by <i>newPath</i> in the file system.</p>
<p><b>See also </b><a href="qfilesystemmodel.html#rootPath">rootPath</a>().</p>
<!-- @@@setRootPath -->
<!-- $$$size[overload1]$$$sizeconstQModelIndex& -->
<h3 class="fn"><a name="size"></a><span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> QFileSystemModel::<span class="name">size</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const</h3>
<p>Returns the size in bytes of <i>index</i>. If the file does not exist, 0 is returned.</p>
<!-- @@@size -->
<!-- $$$sort[overload1]$$$sortintQt::SortOrder -->
<h3 class="fn"><a name="sort"></a><span class="type">void</span> QFileSystemModel::<span class="name">sort</span> ( <span class="type">int</span> <i>column</i>, <span class="type"><a href="qt.html#SortOrder-enum">Qt::SortOrder</a></span> <i>order</i> = Qt::AscendingOrder )<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#sort">QAbstractItemModel::sort</a>().</p>
<!-- @@@sort -->
<!-- $$$supportedDropActions[overload1]$$$supportedDropActions -->
<h3 class="fn"><a name="supportedDropActions"></a><span class="type"><a href="qt.html#DropAction-enum">Qt::DropActions</a></span> QFileSystemModel::<span class="name">supportedDropActions</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#supportedDropActions">QAbstractItemModel::supportedDropActions</a>().</p>
<!-- @@@supportedDropActions -->
<!-- $$$timerEvent[overload1]$$$timerEventQTimerEvent* -->
<h3 class="fn"><a name="timerEvent"></a><span class="type">void</span> QFileSystemModel::<span class="name">timerEvent</span> ( <span class="type"><a href="qtimerevent.html">QTimerEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#timerEvent">QObject::timerEvent</a>().</p>
<!-- @@@timerEvent -->
<!-- $$$type[overload1]$$$typeconstQModelIndex& -->
<h3 class="fn"><a name="type"></a><span class="type"><a href="qstring.html">QString</a></span> QFileSystemModel::<span class="name">type</span> ( const <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> &amp; <i>index</i> ) const</h3>
<p>Returns the type of file <i>index</i> such as &quot;Directory&quot; or &quot;JPEG file&quot;.</p>
<!-- @@@type -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2012 Nokia Corporation and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>