Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QFileSystemWatcher Class Reference
[QtCore module]

The QFileSystemWatcher class provides an interface for monitoring files and directories for modifications. More...

 #include <QFileSystemWatcher>

Inherits QObject.

Note: All the functions in this class are reentrant.

This class was introduced in Qt 4.2.

Public Functions

  • 29 public functions inherited from QObject

Signals

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 5 static public members inherited from QObject
  • 7 protected functions inherited from QObject

Detailed Description

The QFileSystemWatcher class provides an interface for monitoring files and directories for modifications.

QFileSystemWatcher monitors the file system for changes to files and directories by watching a list of specified paths.

Call addPath() to watch a particular file or directory. Multiple paths can be added using the addPaths() function. Existing paths can be removed by using the removePath() and removePaths() functions.

QFileSystemWatcher examines each path added to it. Files that have been added to the QFileSystemWatcher can be accessed using the files() function, and directories using the directories() function.

The fileChanged() signal is emitted when a file has been modified or removed from disk. Similarly, the directoryChanged() signal is emitted when a directory is modified or removed. Note that QFileSystemWatcher stops monitoring files and directories once they have been removed from disk.

See also QFile and QDir.


Member Function Documentation

QFileSystemWatcher::QFileSystemWatcher ( QObject * parent = 0 )

Constructs a new file system watcher object with the given parent.

QFileSystemWatcher::QFileSystemWatcher ( const QStringList & paths, QObject * parent = 0 )

Constructs a new file system watcher object with the given parent which monitors the specified paths list.

QFileSystemWatcher::~QFileSystemWatcher ()

Destroys the file system watcher.

void QFileSystemWatcher::addPath ( const QString & path )

Adds path to the file system watcher if path exists. The path is not added if it does not exist, or if it is already being monitored by the file system watcher.

If path specifies a directory, the directoryChanged() signal will be emitted when path is modified or removed from disk; otherwise the fileChanged() signal is emitted when path is modified or removed.

See also addPaths() and removePath().

void QFileSystemWatcher::addPaths ( const QStringList & paths )

Adds each path in paths 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.

If a path specifies a directory, the directoryChanged() signal will be emitted when the path is modified or removed from disk; otherwise the fileChanged() signal is emitted when the path is modified or removed.

See also addPath() and removePaths().

QStringList QFileSystemWatcher::directories () const

Returns a list of paths to directories that are being watched.

See also files().

void QFileSystemWatcher::directoryChanged ( const QString & path )   [signal]

This signal is emitted when the directory at the specified path is modified or removed from disk.

See also fileChanged().

void QFileSystemWatcher::fileChanged ( const QString & path )   [signal]

This signal is emitted when the file at the specified path is modified or removed from disk.

See also directoryChanged().

QStringList QFileSystemWatcher::files () const

Returns a list of paths to files that are being watched.

See also directories().

void QFileSystemWatcher::removePath ( const QString & path )

Removes the specified path from the file system watcher.

See also removePaths() and addPath().

void QFileSystemWatcher::removePaths ( const QStringList & paths )

Removes the specified paths from the file system watcher.

See also removePath() and addPaths().

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Labs au hasard

Logo

Utiliser OpenCL avec Qt

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.2
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web