Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 3284

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qfilesystemmodel.cpp -->
  <title>QFileSystemModel Class | Qt Widgets 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QFileSystemModel</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<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="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented 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>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QFileSystemModel Class</h1>
<!-- $$$QFileSystemModel-brief -->
<p>The <a href="qfilesystemmodel.html">QFileSystemModel</a> class provides a data model for the local filesystem. <a href="#details">More...</a></p>
<!-- @@@QFileSystemModel -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QFileSystemModel&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.4</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qabstractitemmodel.html">QAbstractItemModel</a></td></tr></table></div><ul>
<li><a href="qfilesystemmodel-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><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></div>
<a name="properties"></a>
<h2 id="properties">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="../qtcore/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><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> = Q_NULLPTR)</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-1">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>)</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>)</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></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><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 QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qfilesystemmodel.html#sibling">sibling</a></b>(int <i>row</i>, int <i>column</i>, const QModelIndex &amp;<i>idx</i>) const</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></div>
<ul>
<li class="fn">39 public functions inherited from <a href="../qtcore/qabstractitemmodel.html#public-functions">QAbstractItemModel</a></li>
<li class="fn">32 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><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></div>
<ul>
<li class="fn">18 signals inherited from <a href="../qtcore/qabstractitemmodel.html#signals">QAbstractItemModel</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><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></div>
<ul>
<li class="fn">19 protected functions inherited from <a href="../qtcore/qabstractitemmodel.html#protected-functions">QAbstractItemModel</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">2 public slots inherited from <a href="../qtcore/qabstractitemmodel.html#public-slots">QAbstractItemModel</a></li>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
<li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li>
<li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
<li class="fn">19 protected functions inherited from <a href="../qtcore/qabstractitemmodel.html#protected-functions">QAbstractItemModel</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected slot inherited from <a href="../qtcore/qabstractitemmodel.html#protected-slots">QAbstractItemModel</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QFileSystemModel-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qfilesystemmodel.html">QFileSystemModel</a> 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><a href="qfilesystemmodel.html">QFileSystemModel</a> can be accessed using the standard interface provided by <a href="../qtcore/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="qfilesystemmodel.html#fileName">fileName</a>() and <a href="qfilesystemmodel.html#filePath">filePath</a>() 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><a href="qfilesystemmodel.html">QFileSystemModel</a> requires an instance of <a href="qapplication.html">QApplication</a>.</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"><a href="qfilesystemmodel.html#QFileSystemModel">QFileSystemModel</a></span> <span class="operator">*</span>model <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qfilesystemmodel.html#QFileSystemModel">QFileSystemModel</a></span>;
      model<span class="operator">-</span><span class="operator">&gt;</span>setRootPath(<span class="type"><a href="../qtcore/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="../qtcore/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="qfilesystemmodel.html">QFileSystemModel</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><a href="qfilesystemmodel.html">QFileSystemModel</a> 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 QDirModel, <a href="qfilesystemmodel.html">QFileSystemModel</a> 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><a href="qfilesystemmodel.html">QFileSystemModel</a> keeps a cache with file information. The cache is automatically kept up to date using the <a href="../qtcore/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" id="Roles-enum"><a name="Roles-enum"></a>enum QFileSystemModel::<span class="name">Roles</span></h3>
<div class="table"><table class="valuelist"><tr><th class="tblConst">Constant</th><th class="tblVal">Value</th></tr>
<tr><td class="topAlign"><code>QFileSystemModel::FileIconRole</code></td><td class="topAlign tblval"><code>Qt::DecorationRole</code></td></tr>
<tr><td class="topAlign"><code>QFileSystemModel::FilePathRole</code></td><td class="topAlign tblval"><code>Qt::UserRole + 1</code></td></tr>
<tr><td class="topAlign"><code>QFileSystemModel::FileNameRole</code></td><td class="topAlign tblval"><code>Qt::UserRole + 2</code></td></tr>
<tr><td class="topAlign"><code>QFileSystemModel::FilePermissions</code></td><td class="topAlign tblval"><code>Qt::UserRole + 3</code></td></tr>
</table></div>
<!-- @@@Roles -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$nameFilterDisables-prop$$$nameFilterDisables$$$setNameFilterDisablesbool -->
<h3 class="fn" id="nameFilterDisables-prop"><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 <code>true</code> by default</p>
<p><b>Access functions:</b></p>
<div class="table"><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></div>
<!-- @@@nameFilterDisables -->
<!-- $$$readOnly-prop$$$isReadOnly$$$setReadOnlybool -->
<h3 class="fn" id="readOnly-prop"><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 <code>true</code> by default</p>
<p><b>Access functions:</b></p>
<div class="table"><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></div>
<!-- @@@readOnly -->
<!-- $$$resolveSymlinks-prop$$$resolveSymlinks$$$setResolveSymlinksbool -->
<h3 class="fn" id="resolveSymlinks-prop"><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 Windows.</p>
<p>By default, this property is <code>true</code>.</p>
<p><b>Access functions:</b></p>
<div class="table"><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></div>
<!-- @@@resolveSymlinks -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QFileSystemModel[overload1]$$$QFileSystemModelQObject* -->
<h3 class="fn" id="QFileSystemModel"><a name="QFileSystemModel"></a>QFileSystemModel::<span class="name">QFileSystemModel</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs a file system model with the given <i>parent</i>.</p>
<!-- @@@QFileSystemModel -->
<!-- $$$~QFileSystemModel[overload1]$$$~QFileSystemModel -->
<h3 class="fn" id="dtor.QFileSystemModel"><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" id="canFetchMore"><a name="canFetchMore"></a><code>[virtual] </code><span class="type">bool</span> QFileSystemModel::<span class="name">canFetchMore</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>parent</i>) const</h3>
<p>Reimplemented from <a href="../qtcore/qabstractitemmodel.html#canFetchMore">QAbstractItemModel::canFetchMore</a>().</p>
<!-- @@@canFetchMore -->
<!-- $$$columnCount[overload1]$$$columnCountconstQModelIndex& -->
<h3 class="fn" id="columnCount"><a name="columnCount"></a><code>[virtual] </code><span class="type">int</span> QFileSystemModel::<span class="name">columnCount</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>parent</i> = QModelIndex()) const</h3>
<p>Reimplemented from <a href="../qtcore/qabstractitemmodel.html#columnCount">QAbstractItemModel::columnCount</a>().</p>
<!-- @@@columnCount -->
<!-- $$$data[overload1]$$$dataconstQModelIndex&int -->
<h3 class="fn" id="data"><a name="data"></a><code>[virtual] </code><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QFileSystemModel::<span class="name">data</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>index</i>, <span class="type">int</span> <i>role</i> = Qt::DisplayRole) const</h3>
<p>Reimplemented from <a href="../qtcore/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" id="directoryLoaded"><a name="directoryLoaded"></a><code>[signal] </code><span class="type">void</span> QFileSystemModel::<span class="name">directoryLoaded</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>path</i>)</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" id="dropMimeData"><a name="dropMimeData"></a><code>[virtual] </code><span class="type">bool</span> QFileSystemModel::<span class="name">dropMimeData</span>(const <span class="type"><a href="../qtcore/qmimedata.html">QMimeData</a></span> *<i>data</i>, <span class="type"><a href="../qtcore/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="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>parent</i>)</h3>
<p>Reimplemented from <a href="../qtcore/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" id="event"><a name="event"></a><code>[virtual protected] </code><span class="type">bool</span> QFileSystemModel::<span class="name">event</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="../qtcore/qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$fetchMore[overload1]$$$fetchMoreconstQModelIndex& -->
<h3 class="fn" id="fetchMore"><a name="fetchMore"></a><code>[virtual] </code><span class="type">void</span> QFileSystemModel::<span class="name">fetchMore</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>parent</i>)</h3>
<p>Reimplemented from <a href="../qtcore/qabstractitemmodel.html#fetchMore">QAbstractItemModel::fetchMore</a>().</p>
<!-- @@@fetchMore -->
<!-- $$$fileIcon[overload1]$$$fileIconconstQModelIndex& -->
<h3 class="fn" id="fileIcon"><a name="fileIcon"></a><span class="type"><a href="../qtgui/qicon.html">QIcon</a></span> QFileSystemModel::<span class="name">fileIcon</span>(const <span class="type"><a href="../qtcore/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" id="fileInfo"><a name="fileInfo"></a><span class="type"><a href="../qtcore/qfileinfo.html">QFileInfo</a></span> QFileSystemModel::<span class="name">fileInfo</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>index</i>) const</h3>
<p>Returns the <a href="../qtcore/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" id="fileName"><a name="fileName"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QFileSystemModel::<span class="name">fileName</span>(const <span class="type"><a href="../qtcore/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" id="filePath"><a name="filePath"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QFileSystemModel::<span class="name">filePath</span>(const <span class="type"><a href="../qtcore/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" id="fileRenamed"><a name="fileRenamed"></a><code>[signal] </code><span class="type">void</span> QFileSystemModel::<span class="name">fileRenamed</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>path</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>oldName</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>newName</i>)</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" id="filter"><a name="filter"></a><span class="type"><a href="../qtcore/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="../qtcore/qdir.html#Filter-enum">QDir::AllEntries</a> | <a href="../qtcore/qdir.html#Filter-enum">QDir::NoDotAndDotDot</a> | <a href="../qtcore/qdir.html#Filter-enum">QDir::AllDirs</a>.</p>
<p><b>See also </b><a href="qfilesystemmodel.html#setFilter">setFilter</a>() and <a href="../qtcore/qdir.html#Filter-enum">QDir::Filters</a>.</p>
<!-- @@@filter -->
<!-- $$$flags[overload1]$$$flagsconstQModelIndex& -->
<h3 class="fn" id="flags"><a name="flags"></a><code>[virtual] </code><span class="type"><a href="../qtcore/qt.html#ItemFlag-enum">Qt::ItemFlags</a></span> QFileSystemModel::<span class="name">flags</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>index</i>) const</h3>
<p>Reimplemented from <a href="../qtcore/qabstractitemmodel.html#flags">QAbstractItemModel::flags</a>().</p>
<!-- @@@flags -->
<!-- $$$hasChildren[overload1]$$$hasChildrenconstQModelIndex& -->
<h3 class="fn" id="hasChildren"><a name="hasChildren"></a><code>[virtual] </code><span class="type">bool</span> QFileSystemModel::<span class="name">hasChildren</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>parent</i> = QModelIndex()) const</h3>
<p>Reimplemented from <a href="../qtcore/qabstractitemmodel.html#hasChildren">QAbstractItemModel::hasChildren</a>().</p>
<!-- @@@hasChildren -->
<!-- $$$headerData[overload1]$$$headerDataintQt::Orientationint -->
<h3 class="fn" id="headerData"><a name="headerData"></a><code>[virtual] </code><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QFileSystemModel::<span class="name">headerData</span>(<span class="type">int</span> <i>section</i>, <span class="type"><a href="../qtcore/qt.html#Orientation-enum">Qt::Orientation</a></span> <i>orientation</i>, <span class="type">int</span> <i>role</i> = Qt::DisplayRole) const</h3>
<p>Reimplemented from <a href="../qtcore/qabstractitemmodel.html#headerData">QAbstractItemModel::headerData</a>().</p>
<!-- @@@headerData -->
<!-- $$$iconProvider[overload1]$$$iconProvider -->
<h3 class="fn" id="iconProvider"><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" id="index"><a name="index"></a><code>[virtual] </code><span class="type"><a href="../qtcore/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="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>parent</i> = QModelIndex()) const</h3>
<p>Reimplemented from <a href="../qtcore/qabstractitemmodel.html#index">QAbstractItemModel::index</a>().</p>
<!-- @@@index -->
<!-- $$$index$$$indexconstQString&int -->
<h3 class="fn" id="index-1"><a name="index-1"></a><span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> QFileSystemModel::<span class="name">index</span>(const <span class="type"><a href="../qtcore/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" id="isDir"><a name="isDir"></a><span class="type">bool</span> QFileSystemModel::<span class="name">isDir</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>index</i>) const</h3>
<p>Returns <code>true</code> if the model item <i>index</i> represents a directory; otherwise returns <code>false</code>.</p>
<!-- @@@isDir -->
<!-- $$$lastModified[overload1]$$$lastModifiedconstQModelIndex& -->
<h3 class="fn" id="lastModified"><a name="lastModified"></a><span class="type"><a href="../qtcore/qdatetime.html">QDateTime</a></span> QFileSystemModel::<span class="name">lastModified</span>(const <span class="type"><a href="../qtcore/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" id="mimeData"><a name="mimeData"></a><code>[virtual] </code><span class="type"><a href="../qtcore/qmimedata.html">QMimeData</a></span> *QFileSystemModel::<span class="name">mimeData</span>(const <span class="type"><a href="../qtcore/qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a></span> &amp;<i>indexes</i>) const</h3>
<p>Reimplemented from <a href="../qtcore/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" id="mimeTypes"><a name="mimeTypes"></a><code>[virtual] </code><span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> QFileSystemModel::<span class="name">mimeTypes</span>() const</h3>
<p>Reimplemented from <a href="../qtcore/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" id="mkdir"><a name="mkdir"></a><span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> QFileSystemModel::<span class="name">mkdir</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>parent</i>, const <span class="type"><a href="../qtcore/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" id="myComputer"><a name="myComputer"></a><span class="type"><a href="../qtcore/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="../qtcore/qt.html#ItemDataRole-enum">Qt::ItemDataRole</a>.</p>
<!-- @@@myComputer -->
<!-- $$$nameFilters[overload1]$$$nameFilters -->
<h3 class="fn" id="nameFilters"><a name="nameFilters"></a><span class="type"><a href="../qtcore/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" id="parent"><a name="parent"></a><code>[virtual] </code><span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> QFileSystemModel::<span class="name">parent</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>index</i>) const</h3>
<p>Reimplemented from <a href="../qtcore/qabstractitemmodel.html#parent">QAbstractItemModel::parent</a>().</p>
<!-- @@@parent -->
<!-- $$$permissions[overload1]$$$permissionsconstQModelIndex& -->
<h3 class="fn" id="permissions"><a name="permissions"></a><span class="type"><a href="../qtcore/qfiledevice.html#Permission-enum">QFile::Permissions</a></span> QFileSystemModel::<span class="name">permissions</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>index</i>) const</h3>
<p>Returns the complete OR-ed together combination of <a href="../qtcore/qfiledevice.html#Permission-enum">QFile::Permission</a> for the <i>index</i>.</p>
<!-- @@@permissions -->
<!-- $$$remove[overload1]$$$removeconstQModelIndex& -->
<h3 class="fn" id="remove"><a name="remove"></a><span class="type">bool</span> QFileSystemModel::<span class="name">remove</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>index</i>)</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" id="rmdir"><a name="rmdir"></a><span class="type">bool</span> QFileSystemModel::<span class="name">rmdir</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>index</i>)</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" id="rootDirectory"><a name="rootDirectory"></a><span class="type"><a href="../qtcore/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" id="rootPath"><a name="rootPath"></a><span class="type"><a href="../qtcore/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" id="rootPathChanged"><a name="rootPathChanged"></a><code>[signal] </code><span class="type">void</span> QFileSystemModel::<span class="name">rootPathChanged</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>newPath</i>)</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" id="rowCount"><a name="rowCount"></a><code>[virtual] </code><span class="type">int</span> QFileSystemModel::<span class="name">rowCount</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>parent</i> = QModelIndex()) const</h3>
<p>Reimplemented from <a href="../qtcore/qabstractitemmodel.html#rowCount">QAbstractItemModel::rowCount</a>().</p>
<!-- @@@rowCount -->
<!-- $$$setData[overload1]$$$setDataconstQModelIndex&constQVariant&int -->
<h3 class="fn" id="setData"><a name="setData"></a><code>[virtual] </code><span class="type">bool</span> QFileSystemModel::<span class="name">setData</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>idx</i>, const <span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> &amp;<i>value</i>, <span class="type">int</span> <i>role</i> = Qt::EditRole)</h3>
<p>Reimplemented from <a href="../qtcore/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" id="setFilter"><a name="setFilter"></a><span class="type">void</span> QFileSystemModel::<span class="name">setFilter</span>(<span class="type"><a href="../qtcore/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="../qtcore/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="../qtcore/qdir.html#Filter-enum">QDir::Filters</a>.</p>
<!-- @@@setFilter -->
<!-- $$$setIconProvider[overload1]$$$setIconProviderQFileIconProvider* -->
<h3 class="fn" id="setIconProvider"><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" id="setNameFilters"><a name="setNameFilters"></a><span class="type">void</span> QFileSystemModel::<span class="name">setNameFilters</span>(const <span class="type"><a href="../qtcore/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" id="setRootPath"><a name="setRootPath"></a><span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> QFileSystemModel::<span class="name">setRootPath</span>(const <span class="type"><a href="../qtcore/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="../qtcore/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 -->
<!-- $$$sibling[overload1]$$$siblingintintconstQModelIndex& -->
<h3 class="fn" id="sibling"><a name="sibling"></a><code>[virtual] </code><span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> QFileSystemModel::<span class="name">sibling</span>(<span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>column</i>, const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>idx</i>) const</h3>
<p>Reimplemented from <a href="../qtcore/qabstractitemmodel.html#sibling">QAbstractItemModel::sibling</a>().</p>
<!-- @@@sibling -->
<!-- $$$size[overload1]$$$sizeconstQModelIndex& -->
<h3 class="fn" id="size"><a name="size"></a><span class="type"><a href="../qtcore/qtglobal.html#qint64-typedef">qint64</a></span> QFileSystemModel::<span class="name">size</span>(const <span class="type"><a href="../qtcore/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" id="sort"><a name="sort"></a><code>[virtual] </code><span class="type">void</span> QFileSystemModel::<span class="name">sort</span>(<span class="type">int</span> <i>column</i>, <span class="type"><a href="../qtcore/qt.html#SortOrder-enum">Qt::SortOrder</a></span> <i>order</i> = Qt::AscendingOrder)</h3>
<p>Reimplemented from <a href="../qtcore/qabstractitemmodel.html#sort">QAbstractItemModel::sort</a>().</p>
<!-- @@@sort -->
<!-- $$$supportedDropActions[overload1]$$$supportedDropActions -->
<h3 class="fn" id="supportedDropActions"><a name="supportedDropActions"></a><code>[virtual] </code><span class="type"><a href="../qtcore/qt.html#DropAction-enum">Qt::DropActions</a></span> QFileSystemModel::<span class="name">supportedDropActions</span>() const</h3>
<p>Reimplemented from <a href="../qtcore/qabstractitemmodel.html#supportedDropActions">QAbstractItemModel::supportedDropActions</a>().</p>
<!-- @@@supportedDropActions -->
<!-- $$$timerEvent[overload1]$$$timerEventQTimerEvent* -->
<h3 class="fn" id="timerEvent"><a name="timerEvent"></a><code>[virtual protected] </code><span class="type">void</span> QFileSystemModel::<span class="name">timerEvent</span>(<span class="type"><a href="../qtcore/qtimerevent.html">QTimerEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="../qtcore/qobject.html#timerEvent">QObject::timerEvent</a>().</p>
<!-- @@@timerEvent -->
<!-- $$$type[overload1]$$$typeconstQModelIndex& -->
<h3 class="fn" id="type"><a name="type"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QFileSystemModel::<span class="name">type</span>(const <span class="type"><a href="../qtcore/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>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    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.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>