Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 3961

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qdirmodel.cpp -->
<head>
  <title>Qt 4.6: QDirModel Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QDirModel"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QDirModel Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
</h1>
<p>The QDirModel class provides a data model for the local filesystem. <a href="#details">More...</a></p>
<pre> #include &lt;QDirModel&gt;</pre><p>Inherits <a href="qabstractitemmodel.html">QAbstractItemModel</a>.</p>
<ul>
<li><a href="qdirmodel-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#Roles-enum">Roles</a></b> { FileIconRole, FilePathRole, FileNameRole }</td></tr>
</table>
<hr />
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li><div class="fn"><b><a href="qdirmodel.html#lazyChildCount-prop">lazyChildCount</a></b> : bool</div></li>
<li><div class="fn"><b><a href="qdirmodel.html#readOnly-prop">readOnly</a></b> : bool</div></li>
<li><div class="fn"><b><a href="qdirmodel.html#resolveSymlinks-prop">resolveSymlinks</a></b> : bool</div></li>
</ul>
<ul>
<li><div bar="2" class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#QDirModel">QDirModel</a></b> ( const QStringList &amp; <i>nameFilters</i>, QDir::Filters <i>filters</i>, QDir::SortFlags <i>sort</i>, QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#QDirModel-2">QDirModel</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#dtor.QDirModel">~QDirModel</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QIcon </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#fileIcon">fileIcon</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QFileInfo </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#fileInfo">fileInfo</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#fileName">fileName</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#filePath">filePath</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QDir::Filters </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#filter">filter</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QFileIconProvider * </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#iconProvider">iconProvider</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QModelIndex </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#index-2">index</a></b> ( const QString &amp; <i>path</i>, int <i>column</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#isDir">isDir</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#readOnly-prop">isReadOnly</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#lazyChildCount-prop">lazyChildCount</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QModelIndex </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#mkdir">mkdir</a></b> ( const QModelIndex &amp; <i>parent</i>, const QString &amp; <i>name</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QStringList </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#nameFilters">nameFilters</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#remove">remove</a></b> ( const QModelIndex &amp; <i>index</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#resolveSymlinks-prop">resolveSymlinks</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#rmdir">rmdir</a></b> ( const QModelIndex &amp; <i>index</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#setFilter">setFilter</a></b> ( QDir::Filters <i>filters</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#setIconProvider">setIconProvider</a></b> ( QFileIconProvider * <i>provider</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#lazyChildCount-prop">setLazyChildCount</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#setNameFilters">setNameFilters</a></b> ( const QStringList &amp; <i>filters</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#readOnly-prop">setReadOnly</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#resolveSymlinks-prop">setResolveSymlinks</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#setSorting">setSorting</a></b> ( QDir::SortFlags <i>sort</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QDir::SortFlags </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#sorting">sorting</a></b> () const</td></tr>
</table>
<hr />
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#columnCount">columnCount</a></b> ( const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QVariant </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#data">data</a></b> ( const QModelIndex &amp; <i>index</i>, int <i>role</i> = Qt::DisplayRole ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.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" align="right" valign="top">virtual Qt::ItemFlags </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#flags">flags</a></b> ( const QModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#hasChildren">hasChildren</a></b> ( const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QVariant </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.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" align="right" valign="top">virtual QModelIndex </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.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" align="right" valign="top">virtual QMimeData * </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#mimeData">mimeData</a></b> ( const QModelIndexList &amp; <i>indexes</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QStringList </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#mimeTypes">mimeTypes</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QModelIndex </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#parent">parent</a></b> ( const QModelIndex &amp; <i>child</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#rowCount">rowCount</a></b> ( const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#setData">setData</a></b> ( const QModelIndex &amp; <i>index</i>, const QVariant &amp; <i>value</i>, int <i>role</i> = Qt::EditRole )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#sort">sort</a></b> ( int <i>column</i>, Qt::SortOrder <i>order</i> = Qt::AscendingOrder )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual Qt::DropActions </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#supportedDropActions">supportedDropActions</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>35 public functions inherited from <a href="qabstractitemmodel.html#public-functions">QAbstractItemModel</a></li>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<hr />
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qdirmodel.html#refresh">refresh</a></b> ( const QModelIndex &amp; <i>parent</i> = QModelIndex() )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>2 public slots inherited from <a href="qabstractitemmodel.html#public-slots">QAbstractItemModel</a></li>
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>18 signals inherited from <a href="qabstractitemmodel.html#signals">QAbstractItemModel</a></li>
<li><div class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"></div>21 protected functions inherited from <a href="qabstractitemmodel.html#protected-functions">QAbstractItemModel</a></li>
<li><div class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QDirModel class provides a data model for the local filesystem.</p>
<p><b>Note:</b> The usage of QDirModel is not recommended anymore. The <a href="qfilesystemmodel.html">QFileSystemModel</a> class is a more performant alternative.</p>
<p>This class provides access to the local filesystem, providing functions for renaming and removing files and directories, and for creating new directories. In the simplest case, it can be used with a suitable display widget as part of a browser or filer.</p>
<p>QDirModel keeps a cache with file information. The cache needs to be updated with <a href="qdirmodel.html#refresh">refresh</a>().</p>
<p>A directory model that displays the contents of a default directory is usually constructed with a parent object:</p>
<pre>     QFileSystemModel *model = new QFileSystemModel;
     model-&gt;setRootPath(QDir::currentPath());</pre>
<p>A tree view can be used to display the contents of the model</p>
<pre>     QTreeView *tree = new QTreeView(splitter);
     tree-&gt;setModel(model);</pre>
<p>and the contents of a particular directory can be displayed by setting the tree view's root index:</p>
<pre>     tree-&gt;setRootIndex(model-&gt;index(QDir::currentPath()));</pre>
<p>The view's root index can be used to control how much of a hierarchical model is displayed. QDirModel provides a convenience function that returns a suitable model index for a path to a directory within the model.</p>
<p>QDirModel can be accessed using the standard interface provided by <a href="qabstractitemmodel.html">QAbstractItemModel</a>, but it also provides some convenience functions that are specific to a directory model. The <a href="qdirmodel.html#fileInfo">fileInfo</a>() and <a href="qdirmodel.html#isDir">isDir</a>() functions provide information about the underlying files and directories related to items in the model.</p>
<p>Directories can be created and removed using <a href="qdirmodel.html#mkdir">mkdir</a>(), <a href="qdirmodel.html#rmdir">rmdir</a>(), and the model will be automatically updated to take the changes into account.</p>
<p><b>Note:</b> QDirModel requires an instance of a GUI application.</p>
<p>See also <a href="qdirmodel.html#nameFilters">nameFilters</a>(), <a href="qdirmodel.html#setFilter">setFilter</a>(), <a href="qdirmodel.html#filter">filter</a>(), <a href="qlistview.html">QListView</a>, <a href="qtreeview.html">QTreeView</a>, <a href="qfilesystemmodel.html">QFileSystemModel</a>, <a href="itemviews-dirview.html">Dir View Example</a>, and <a href="model-view-model.html">Model Classes</a>.</p>
<hr />
<h2>Member Type Documentation</h2>
<a name="//apple_ref/cpp/tag/QDirModel/Roles"></a>
<a name="//apple_ref/cpp/econst/QDirModel/FileIconRole"></a>
<a name="//apple_ref/cpp/econst/QDirModel/FilePathRole"></a>
<a name="//apple_ref/cpp/econst/QDirModel/FileNameRole"></a>
<h3 class="fn"><a name="Roles-enum"></a>enum QDirModel::Roles</h3>
<p><table  class="valuelist" border="1" cellpadding="2" cellspacing="1" width="40%">
<tr><th width="60%">Constant</th><th width="40%">Value</th></tr>
<tr><td valign="top"><tt>QDirModel::FileIconRole</tt></td><td align="center" valign="top"><tt>Qt::DecorationRole</tt></td></tr>
<tr><td valign="top"><tt>QDirModel::FilePathRole</tt></td><td align="center" valign="top"><tt>Qt::UserRole + 1</tt></td></tr>
<tr><td valign="top"><tt>QDirModel::FileNameRole</tt></td><td align="center" valign="top">?</td></tr>
</table></p>
<hr />
<h2>Property Documentation</h2>
<a name="//apple_ref/cpp/instm/QDirModel/lazyChildCount"></a>
<a name="//apple_ref/cpp/instm/QDirModel/setLazyChildCount"></a>
<h3 class="fn"><a name="lazyChildCount-prop"></a>lazyChildCount : bool</h3>
<p>This property holds whether the directory model optimizes the hasChildren function to only check if the item is a directory.</p>
<p>If this property is set to false, the directory model will make sure that a directory actually containes any files before reporting that it has children. Otherwise the directory model will report that an item has children if the item is a directory.</p>
<p>This property is false by default</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>lazyChildCount</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setLazyChildCount</b> ( bool <i>enable</i> )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/QDirModel/isReadOnly"></a>
<a name="//apple_ref/cpp/instm/QDirModel/setReadOnly"></a>
<h3 class="fn"><a name="readOnly-prop"></a>readOnly : bool</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" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>isReadOnly</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setReadOnly</b> ( bool <i>enable</i> )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/QDirModel/resolveSymlinks"></a>
<a name="//apple_ref/cpp/instm/QDirModel/setResolveSymlinks"></a>
<h3 class="fn"><a name="resolveSymlinks-prop"></a>resolveSymlinks : bool</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><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>resolveSymlinks</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setResolveSymlinks</b> ( bool <i>enable</i> )</td></tr>
</table>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QDirModel/QDirModel"></a>
<h3 class="fn"><a name="QDirModel"></a>QDirModel::QDirModel ( const <a href="qstringlist.html">QStringList</a> &amp; <i>nameFilters</i>, <a href="qdir.html#Filter-enum">QDir::Filters</a> <i>filters</i>, <a href="qdir.html#SortFlag-enum">QDir::SortFlags</a> <i>sort</i>, <a href="qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a new directory model with the given <i>parent</i>. Only those files matching the <i>nameFilters</i> and the <i>filters</i> are included in the model. The sort order is given by the <i>sort</i> flags.</p>
<h3 class="fn"><a name="QDirModel-2"></a>QDirModel::QDirModel ( <a href="qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a directory model with the given <i>parent</i>.</p>
<a name="//apple_ref/cpp/instm/QDirModel/~QDirModel"></a>
<h3 class="fn"><a name="dtor.QDirModel"></a>QDirModel::~QDirModel ()</h3>
<p>Destroys this directory model.</p>
<a name="//apple_ref/cpp/instm/QDirModel/columnCount"></a>
<h3 class="fn"><a name="columnCount"></a>int QDirModel::columnCount ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>parent</i> = QModelIndex() ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#columnCount">QAbstractItemModel::columnCount</a>().</p>
<p>Returns the number of columns in the <i>parent</i> model item.</p>
<a name="//apple_ref/cpp/instm/QDirModel/data"></a>
<h3 class="fn"><a name="data"></a><a href="qvariant.html">QVariant</a> QDirModel::data ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i>, int <i>role</i> = Qt::DisplayRole ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#data">QAbstractItemModel::data</a>().</p>
<p>Returns the data for the model item <i>index</i> with the given <i>role</i>.</p>
<p>See also <a href="qdirmodel.html#setData">setData</a>().</p>
<a name="//apple_ref/cpp/instm/QDirModel/dropMimeData"></a>
<h3 class="fn"><a name="dropMimeData"></a>bool QDirModel::dropMimeData ( const <a href="qmimedata.html">QMimeData</a> * <i>data</i>, <a href="qt.html#DropAction-enum">Qt::DropAction</a> <i>action</i>, int <i>row</i>, int <i>column</i>, const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>parent</i> )&nbsp;&nbsp;<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>See also <a href="qdirmodel.html#supportedDropActions">supportedDropActions</a>().</p>
<a name="//apple_ref/cpp/instm/QDirModel/fileIcon"></a>
<h3 class="fn"><a name="fileIcon"></a><a href="qicon.html">QIcon</a> QDirModel::fileIcon ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> ) const</h3>
<p>Returns the icons for the item stored in the model under the given <i>index</i>.</p>
<a name="//apple_ref/cpp/instm/QDirModel/fileInfo"></a>
<h3 class="fn"><a name="fileInfo"></a><a href="qfileinfo.html">QFileInfo</a> QDirModel::fileInfo ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> ) const</h3>
<p>Returns the file information for the specified model <i>index</i>.</p>
<p><b>Note:</b> If the model index represents a symbolic link in the underlying filing system, the file information returned will contain information about the symbolic link itself, regardless of whether <a href="qdirmodel.html#resolveSymlinks-prop">resolveSymlinks</a> is enabled or not.</p>
<p>See also <a href="qfileinfo.html#symLinkTarget">QFileInfo::symLinkTarget</a>().</p>
<a name="//apple_ref/cpp/instm/QDirModel/fileName"></a>
<h3 class="fn"><a name="fileName"></a><a href="qstring.html">QString</a> QDirModel::fileName ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> ) const</h3>
<p>Returns the name of the item stored in the model under the <i>index</i> given.</p>
<a name="//apple_ref/cpp/instm/QDirModel/filePath"></a>
<h3 class="fn"><a name="filePath"></a><a href="qstring.html">QString</a> QDirModel::filePath ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> ) const</h3>
<p>Returns the path of the item stored in the model under the <i>index</i> given.</p>
<a name="//apple_ref/cpp/instm/QDirModel/filter"></a>
<h3 class="fn"><a name="filter"></a><a href="qdir.html#Filter-enum">QDir::Filters</a> QDirModel::filter () const</h3>
<p>Returns the filter specification for the directory model.</p>
<p>See also <a href="qdirmodel.html#setFilter">setFilter</a>() and <a href="qdir.html#Filter-enum">QDir::Filters</a>.</p>
<a name="//apple_ref/cpp/instm/QDirModel/flags"></a>
<h3 class="fn"><a name="flags"></a><a href="qt.html#ItemFlag-enum">Qt::ItemFlags</a> QDirModel::flags ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#flags">QAbstractItemModel::flags</a>().</p>
<p>Returns the item flags for the given <i>index</i> in the model.</p>
<p>See also <a href="qt.html#ItemFlag-enum">Qt::ItemFlags</a>.</p>
<a name="//apple_ref/cpp/instm/QDirModel/hasChildren"></a>
<h3 class="fn"><a name="hasChildren"></a>bool QDirModel::hasChildren ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>parent</i> = QModelIndex() ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#hasChildren">QAbstractItemModel::hasChildren</a>().</p>
<p>Returns true if the <i>parent</i> model item has children; otherwise returns false.</p>
<a name="//apple_ref/cpp/instm/QDirModel/headerData"></a>
<h3 class="fn"><a name="headerData"></a><a href="qvariant.html">QVariant</a> QDirModel::headerData ( int <i>section</i>, <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>orientation</i>, int <i>role</i> = Qt::DisplayRole ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#headerData">QAbstractItemModel::headerData</a>().</p>
<p>Returns the data stored under the given <i>role</i> for the specified <i>section</i> of the header with the given <i>orientation</i>.</p>
<a name="//apple_ref/cpp/instm/QDirModel/iconProvider"></a>
<h3 class="fn"><a name="iconProvider"></a><a href="qfileiconprovider.html">QFileIconProvider</a> * QDirModel::iconProvider () const</h3>
<p>Returns the file icon provider for this directory model.</p>
<p>See also <a href="qdirmodel.html#setIconProvider">setIconProvider</a>().</p>
<a name="//apple_ref/cpp/instm/QDirModel/index"></a>
<h3 class="fn"><a name="index"></a><a href="qmodelindex.html">QModelIndex</a> QDirModel::index ( int <i>row</i>, int <i>column</i>, const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>parent</i> = QModelIndex() ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#index">QAbstractItemModel::index</a>().</p>
<p>Returns the model item index for the item in the <i>parent</i> with the given <i>row</i> and <i>column</i>.</p>
<h3 class="fn"><a name="index-2"></a><a href="qmodelindex.html">QModelIndex</a> QDirModel::index ( const <a href="qstring.html">QString</a> &amp; <i>path</i>, int <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>.</p>
<a name="//apple_ref/cpp/instm/QDirModel/isDir"></a>
<h3 class="fn"><a name="isDir"></a>bool QDirModel::isDir ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> ) const</h3>
<p>Returns true if the model item <i>index</i> represents a directory; otherwise returns false.</p>
<a name="//apple_ref/cpp/instm/QDirModel/mimeData"></a>
<h3 class="fn"><a name="mimeData"></a><a href="qmimedata.html">QMimeData</a> * QDirModel::mimeData ( const <a href="qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a> &amp; <i>indexes</i> ) const&nbsp;&nbsp;<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="qdirmodel.html#mimeTypes">mimeTypes</a>() function.</p>
<p>If the list of indexes is empty, 0 is returned rather than a serialized empty list.</p>
<a name="//apple_ref/cpp/instm/QDirModel/mimeTypes"></a>
<h3 class="fn"><a name="mimeTypes"></a><a href="qstringlist.html">QStringList</a> QDirModel::mimeTypes () const&nbsp;&nbsp;<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>
<a name="//apple_ref/cpp/instm/QDirModel/mkdir"></a>
<h3 class="fn"><a name="mkdir"></a><a href="qmodelindex.html">QModelIndex</a> QDirModel::mkdir ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>parent</i>, const <a href="qstring.html">QString</a> &amp; <i>name</i> )</h3>
<p>Create a directory with the <i>name</i> in the <i>parent</i> model item.</p>
<a name="//apple_ref/cpp/instm/QDirModel/nameFilters"></a>
<h3 class="fn"><a name="nameFilters"></a><a href="qstringlist.html">QStringList</a> QDirModel::nameFilters () const</h3>
<p>Returns a list of filters applied to the names in the model.</p>
<p>See also <a href="qdirmodel.html#setNameFilters">setNameFilters</a>().</p>
<a name="//apple_ref/cpp/instm/QDirModel/parent"></a>
<h3 class="fn"><a name="parent"></a><a href="qmodelindex.html">QModelIndex</a> QDirModel::parent ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>child</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#parent">QAbstractItemModel::parent</a>().</p>
<p>Return the parent of the given <i>child</i> model item.</p>
<a name="//apple_ref/cpp/instm/QDirModel/refresh"></a>
<h3 class="fn"><a name="refresh"></a>void QDirModel::refresh ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>parent</i> = QModelIndex() )&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p><a href="qdirmodel.html">QDirModel</a> caches file information. This function updates the cache. The <i>parent</i> parameter is the directory from which the model is updated; the default value will update the model from root directory of the file system (the entire model).</p>
<a name="//apple_ref/cpp/instm/QDirModel/remove"></a>
<h3 class="fn"><a name="remove"></a>bool QDirModel::remove ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> )</h3>
<p>Removes the model item <i>index</i> from the directory 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>See also <a href="qdirmodel.html#rmdir">rmdir</a>().</p>
<a name="//apple_ref/cpp/instm/QDirModel/rmdir"></a>
<h3 class="fn"><a name="rmdir"></a>bool QDirModel::rmdir ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> )</h3>
<p>Removes the directory corresponding to the model item <i>index</i> in the directory 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>See also <a href="qdirmodel.html#remove">remove</a>().</p>
<a name="//apple_ref/cpp/instm/QDirModel/rowCount"></a>
<h3 class="fn"><a name="rowCount"></a>int QDirModel::rowCount ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>parent</i> = QModelIndex() ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#rowCount">QAbstractItemModel::rowCount</a>().</p>
<p>Returns the number of rows in the <i>parent</i> model item.</p>
<a name="//apple_ref/cpp/instm/QDirModel/setData"></a>
<h3 class="fn"><a name="setData"></a>bool QDirModel::setData ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i>, const <a href="qvariant.html">QVariant</a> &amp; <i>value</i>, int <i>role</i> = Qt::EditRole )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#setData">QAbstractItemModel::setData</a>().</p>
<p>Sets the data for the model item <i>index</i> with the given <i>role</i> to the data referenced by the <i>value</i>. Returns true if successful; otherwise returns false.</p>
<p>See also <a href="qdirmodel.html#data">data</a>() and <a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a>.</p>
<a name="//apple_ref/cpp/instm/QDirModel/setFilter"></a>
<h3 class="fn"><a name="setFilter"></a>void QDirModel::setFilter ( <a href="qdir.html#Filter-enum">QDir::Filters</a> <i>filters</i> )</h3>
<p>Sets the directory model's filter to that specified by <i>filters</i>.</p>
<p>Note that the filter you set should always include the <a href="qdir.html#Filter-enum">QDir::AllDirs</a> enum value, otherwise <a href="qdirmodel.html">QDirModel</a> won't be able to read the directory structure.</p>
<p>See also <a href="qdirmodel.html#filter">filter</a>() and <a href="qdir.html#Filter-enum">QDir::Filters</a>.</p>
<a name="//apple_ref/cpp/instm/QDirModel/setIconProvider"></a>
<h3 class="fn"><a name="setIconProvider"></a>void QDirModel::setIconProvider ( <a href="qfileiconprovider.html">QFileIconProvider</a> * <i>provider</i> )</h3>
<p>Sets the <i>provider</i> of file icons for the directory model.</p>
<p>See also <a href="qdirmodel.html#iconProvider">iconProvider</a>().</p>
<a name="//apple_ref/cpp/instm/QDirModel/setNameFilters"></a>
<h3 class="fn"><a name="setNameFilters"></a>void QDirModel::setNameFilters ( const <a href="qstringlist.html">QStringList</a> &amp; <i>filters</i> )</h3>
<p>Sets the name <i>filters</i> for the directory model.</p>
<p>See also <a href="qdirmodel.html#nameFilters">nameFilters</a>().</p>
<a name="//apple_ref/cpp/instm/QDirModel/setSorting"></a>
<h3 class="fn"><a name="setSorting"></a>void QDirModel::setSorting ( <a href="qdir.html#SortFlag-enum">QDir::SortFlags</a> <i>sort</i> )</h3>
<p>Sets the directory model's sorting order to that specified by <i>sort</i>.</p>
<p>See also <a href="qdirmodel.html#sorting">sorting</a>() and <a href="qdir.html#SortFlag-enum">QDir::SortFlags</a>.</p>
<a name="//apple_ref/cpp/instm/QDirModel/sort"></a>
<h3 class="fn"><a name="sort"></a>void QDirModel::sort ( int <i>column</i>, <a href="qt.html#SortOrder-enum">Qt::SortOrder</a> <i>order</i> = Qt::AscendingOrder )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#sort">QAbstractItemModel::sort</a>().</p>
<p>Sort the model items in the <i>column</i> using the <i>order</i> given. The order is a value defined in <a href="qt.html#SortOrder-enum">Qt::SortOrder</a>.</p>
<a name="//apple_ref/cpp/instm/QDirModel/sorting"></a>
<h3 class="fn"><a name="sorting"></a><a href="qdir.html#SortFlag-enum">QDir::SortFlags</a> QDirModel::sorting () const</h3>
<p>Returns the sorting method used for the directory model.</p>
<p>See also <a href="qdirmodel.html#setSorting">setSorting</a>() and <a href="qdir.html#SortFlag-enum">QDir::SortFlags</a>.</p>
<a name="//apple_ref/cpp/instm/QDirModel/supportedDropActions"></a>
<h3 class="fn"><a name="supportedDropActions"></a><a href="qt.html#DropAction-enum">Qt::DropActions</a> QDirModel::supportedDropActions () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qabstractitemmodel.html#supportedDropActions">QAbstractItemModel::supportedDropActions</a>().</p>
<p>Returns the drop actions supported by this model.</p>
<p>See also <a href="qt.html#DropAction-enum">Qt::DropActions</a>.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>