Sophie

Sophie

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

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">
<!-- qfilesystemwatcher.cpp -->
<head>
  <title>Qt 4.6: QFileSystemWatcher Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QFileSystemWatcher"></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">QFileSystemWatcher Class Reference<br /><span class="small-subtitle">[<a href="qtcore.html">QtCore</a> module]</span>
</h1>
<p>The QFileSystemWatcher class provides an interface for monitoring files and directories for modifications. <a href="#details">More...</a></p>
<pre> #include &lt;QFileSystemWatcher&gt;</pre><p>Inherits <a href="qobject.html">QObject</a>.</p>
<p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<p>This class was introduced in Qt 4.2.</p>
<ul>
<li><a href="qfilesystemwatcher-members.html">List of all members, including inherited members</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="qfilesystemwatcher.html#QFileSystemWatcher">QFileSystemWatcher</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="qfilesystemwatcher.html#QFileSystemWatcher-2">QFileSystemWatcher</a></b> ( const QStringList &amp; <i>paths</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="qfilesystemwatcher.html#dtor.QFileSystemWatcher">~QFileSystemWatcher</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qfilesystemwatcher.html#addPath">addPath</a></b> ( const QString &amp; <i>path</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qfilesystemwatcher.html#addPaths">addPaths</a></b> ( const QStringList &amp; <i>paths</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QStringList </td><td class="memItemRight" valign="bottom"><b><a href="qfilesystemwatcher.html#directories">directories</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QStringList </td><td class="memItemRight" valign="bottom"><b><a href="qfilesystemwatcher.html#files">files</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qfilesystemwatcher.html#removePath">removePath</a></b> ( const QString &amp; <i>path</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qfilesystemwatcher.html#removePaths">removePaths</a></b> ( const QStringList &amp; <i>paths</i> )</td></tr>
</table>
<ul>
<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="signals"></a>
<h2>Signals</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="qfilesystemwatcher.html#directoryChanged">directoryChanged</a></b> ( const QString &amp; <i>path</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qfilesystemwatcher.html#fileChanged">fileChanged</a></b> ( const QString &amp; <i>path</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li><div class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">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>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 QFileSystemWatcher class provides an interface for monitoring files and directories for modifications.</p>
<p>QFileSystemWatcher monitors the file system for changes to files and directories by watching a list of specified paths.</p>
<p>Call <a href="qfilesystemwatcher.html#addPath">addPath</a>() to watch a particular file or directory. Multiple paths can be added using the <a href="qfilesystemwatcher.html#addPaths">addPaths</a>() function. Existing paths can be removed by using the <a href="qfilesystemwatcher.html#removePath">removePath</a>() and <a href="qfilesystemwatcher.html#removePaths">removePaths</a>() functions.</p>
<p>QFileSystemWatcher examines each path added to it. Files that have been added to the QFileSystemWatcher can be accessed using the <a href="qfilesystemwatcher.html#files">files</a>() function, and directories using the <a href="qfilesystemwatcher.html#directories">directories</a>() function.</p>
<p>The <a href="qfilesystemwatcher.html#fileChanged">fileChanged</a>() signal is emitted when a file has been modified, renamed or removed from disk. Similarly, the <a href="qfilesystemwatcher.html#directoryChanged">directoryChanged</a>() signal is emitted when a directory or its contents is modified or removed. Note that QFileSystemWatcher stops monitoring files once they have been renamed or removed from disk, and directories once they have been removed from disk.</p>
<p><b>Note:</b> On systems running a Linux kernel without inotify support, file systems that contain watched paths cannot be unmounted.</p>
<p><b>Note:</b> Windows CE does not support directory monitoring by default as this depends on the file system driver installed.</p>
<p><b>Note:</b> The act of monitoring files and directories for modifications consumes system resources. This implies there is a limit to the number of files and directories your process can monitor simultaneously. On Mac OS X 10.4 and all BSD variants, for example, an open file descriptor is required for each monitored file. Some system limits the number of open file descriptors to 256 by default. This means that <a href="qfilesystemwatcher.html#addPath">addPath</a>() and <a href="qfilesystemwatcher.html#addPaths">addPaths</a>() will fail if your process tries to add more than 256 files or directories to the file system monitor. Also note that your process may have other file descriptors open in addition to the ones for files being monitored, and these other open descriptors also count in the total. Mac OS X 10.5 and up use a different backend and do not suffer from this issue.</p>
<p>See also <a href="qfile.html">QFile</a> and <a href="qdir.html">QDir</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QFileSystemWatcher/QFileSystemWatcher"></a>
<h3 class="fn"><a name="QFileSystemWatcher"></a>QFileSystemWatcher::QFileSystemWatcher ( <a href="qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a new file system watcher object with the given <i>parent</i>.</p>
<h3 class="fn"><a name="QFileSystemWatcher-2"></a>QFileSystemWatcher::QFileSystemWatcher ( const <a href="qstringlist.html">QStringList</a> &amp; <i>paths</i>, <a href="qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a new file system watcher object with the given <i>parent</i> which monitors the specified <i>paths</i> list.</p>
<a name="//apple_ref/cpp/instm/QFileSystemWatcher/~QFileSystemWatcher"></a>
<h3 class="fn"><a name="dtor.QFileSystemWatcher"></a>QFileSystemWatcher::~QFileSystemWatcher ()</h3>
<p>Destroys the file system watcher.</p>
<a name="//apple_ref/cpp/instm/QFileSystemWatcher/addPath"></a>
<h3 class="fn"><a name="addPath"></a>void QFileSystemWatcher::addPath ( const <a href="qstring.html">QString</a> &amp; <i>path</i> )</h3>
<p>Adds <i>path</i> to the file system watcher if <i>path</i> exists. The path is not added if it does not exist, or if it is already being monitored by the file system watcher.</p>
<p>If <i>path</i> specifies a directory, the <a href="qfilesystemwatcher.html#directoryChanged">directoryChanged</a>() signal will be emitted when <i>path</i> is modified or removed from disk; otherwise the <a href="qfilesystemwatcher.html#fileChanged">fileChanged</a>() signal is emitted when <i>path</i> is modified, renamed or removed.</p>
<p><b>Note:</b> There is a system dependent limit to the number of files and directories that can be monitored simultaneously. If this limit has been reached, <i>path</i> will not be added to the file system watcher, and a warning message will be printed to <i>stderr</i>.</p>
<p>See also <a href="qfilesystemwatcher.html#addPaths">addPaths</a>() and <a href="qfilesystemwatcher.html#removePath">removePath</a>().</p>
<a name="//apple_ref/cpp/instm/QFileSystemWatcher/addPaths"></a>
<h3 class="fn"><a name="addPaths"></a>void QFileSystemWatcher::addPaths ( const <a href="qstringlist.html">QStringList</a> &amp; <i>paths</i> )</h3>
<p>Adds each path in <i>paths</i> to the file system watcher. Paths are not added if they not exist, or if they are already being monitored by the file system watcher.</p>
<p>If a path specifies a directory, the <a href="qfilesystemwatcher.html#directoryChanged">directoryChanged</a>() signal will be emitted when the path is modified or removed from disk; otherwise the <a href="qfilesystemwatcher.html#fileChanged">fileChanged</a>() signal is emitted when the path is modified, renamed, or removed.</p>
<p><b>Note:</b> There is a system dependent limit to the number of files and directories that can be monitored simultaneously. If this limit has been reached, the excess <i>paths</i> will not be added to the file system watcher, and a warning message will be printed to <i>stderr</i> for each path that could not be added.</p>
<p>See also <a href="qfilesystemwatcher.html#addPath">addPath</a>() and <a href="qfilesystemwatcher.html#removePaths">removePaths</a>().</p>
<a name="//apple_ref/cpp/instm/QFileSystemWatcher/directories"></a>
<h3 class="fn"><a name="directories"></a><a href="qstringlist.html">QStringList</a> QFileSystemWatcher::directories () const</h3>
<p>Returns a list of paths to directories that are being watched.</p>
<p>See also <a href="qfilesystemwatcher.html#files">files</a>().</p>
<a name="//apple_ref/cpp/instm/QFileSystemWatcher/directoryChanged"></a>
<h3 class="fn"><a name="directoryChanged"></a>void QFileSystemWatcher::directoryChanged ( const <a href="qstring.html">QString</a> &amp; <i>path</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when the directory at a specified <i>path</i>, is modified (e.g&#x2e;, when a file is added, modified or deleted) or removed from disk. Note that if there are several changes during a short period of time, some of the changes might not emit this signal. However, the last change in the sequence of changes will always generate this signal.</p>
<p>See also <a href="qfilesystemwatcher.html#fileChanged">fileChanged</a>().</p>
<a name="//apple_ref/cpp/instm/QFileSystemWatcher/fileChanged"></a>
<h3 class="fn"><a name="fileChanged"></a>void QFileSystemWatcher::fileChanged ( const <a href="qstring.html">QString</a> &amp; <i>path</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when the file at the specified <i>path</i> is modified, renamed or removed from disk.</p>
<p>See also <a href="qfilesystemwatcher.html#directoryChanged">directoryChanged</a>().</p>
<a name="//apple_ref/cpp/instm/QFileSystemWatcher/files"></a>
<h3 class="fn"><a name="files"></a><a href="qstringlist.html">QStringList</a> QFileSystemWatcher::files () const</h3>
<p>Returns a list of paths to files that are being watched.</p>
<p>See also <a href="qfilesystemwatcher.html#directories">directories</a>().</p>
<a name="//apple_ref/cpp/instm/QFileSystemWatcher/removePath"></a>
<h3 class="fn"><a name="removePath"></a>void QFileSystemWatcher::removePath ( const <a href="qstring.html">QString</a> &amp; <i>path</i> )</h3>
<p>Removes the specified <i>path</i> from the file system watcher.</p>
<p>See also <a href="qfilesystemwatcher.html#removePaths">removePaths</a>() and <a href="qfilesystemwatcher.html#addPath">addPath</a>().</p>
<a name="//apple_ref/cpp/instm/QFileSystemWatcher/removePaths"></a>
<h3 class="fn"><a name="removePaths"></a>void QFileSystemWatcher::removePaths ( const <a href="qstringlist.html">QStringList</a> &amp; <i>paths</i> )</h3>
<p>Removes the specified <i>paths</i> from the file system watcher.</p>
<p>See also <a href="qfilesystemwatcher.html#removePath">removePath</a>() and <a href="qfilesystemwatcher.html#addPaths">addPaths</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>