- qtgui
- qtdbus
- qtwidgets
- qtcore
- dtkcore
- qsettingbackend_zh
- dobject_zh
- abstractappender_zh
- abstractstringappender_zh
- dfilewatcher_zh
- outputdebugappender_zh
- dsettingsbackend_zh
- drecentmanager_zh
- ddesktopentry_zh
- consoleappender_zh
- gsettingsbackend_zh
- dsettingsgroup_zh
- dlogmanager_zh
- fileappender_zh
- dsettings_zh
- dfilesystemwatcher_zh
- dfilewatchermanager_zh
- dbasefilewatcher_zh
- dtkgui
- dtkwidget
- dviewitemaction_zh
- dstandarditem_zh
- dfiledialog_zh
- dclipeffectwidget_zh
- danchors_zh
- dgraphicsclipeffect_zh
- dstyle_zh
- dcoloredprogressbar_zh
- dbuttonboxbutton_zh
- dlabel_zh
- dtiplabel_zh
- darrowlinedrawer_zh
- daboutdialog_zh
- dsettingswidgetfactory_zh
- dsearchcombobox_zh
- dcrumbedit_zh
- dcommandlinkbutton_zh
- dsettingsdialog_zh
- dwindowoptionbutton_zh
- dspinner_zh
- dsimplelistview_zh
- dwaterprogress_zh
- dmainwindow_zh
- dhidpihelper_zh
- dslider_zh
- dpasswordedit_zh
- danchorinfo_zh
- dmpriscontrol_zh
- darrowbutton_zh
- dbackgroundgroup_zh
- dcircleprogress_zh
- dwarningbutton_zh
- dwindowclosebutton_zh
- dvideowidget_zh
- dfilechooseredit_zh
- dblureffectwidget_zh
- darrowrectangle_zh
- dsearchedit_zh
- dfloatingmessage_zh
- dswitchlineexpand_zh
- dtabbar_zh
- dlineedit_zh
- danchorsbase_zh
- dstylediconengine_zh
- dwindowmaxbutton_zh
- dpageindicator_zh
- dsuggestbutton_zh
- dapplicationsettings_zh
- dtooltip_zh
- dwindowminbutton_zh
- ddrawer_zh
- dtitlebar_zh
- dsimplelistitem_zh
- dpicturesequenceview_zh
dfilesystemwatcher_zh
Class::DFileSystemWatcher
暂无该属性
Detailed Description
The DFileSystemWatcher class provides an interface for monitoring files and directories for modifications. DFileSystemWatcher 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.
DFileSystemWatcher examines each path added to it. Files that have been added to the DFileSystemWatcher can be accessed using the files() function, and directories using the directories() function.
The fileChanged() signal is emitted when a file has been modified, renamed or removed from disk. Similarly, the directoryChanged() signal is emitted when a directory or its contents is modified or removed. Note that DFileSystemWatcher stops monitoring files once they have been renamed or removed from disk, and directories once they have been removed from disk.
Note: On systems running a Linux kernel without inotify support, file systems that contain watched paths cannot be unmounted.
Note: Windows CE does not support directory monitoring by default as this depends on the file system driver installed.
Note: 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 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 addPath() and addPaths() 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. OS X uses a different backend and does not suffer from this issue.
See also QFileQDir
DFileSystemWatcher::metaObject
const QMetaObject * metaObject() const
DFileSystemWatcher::qt_metacast
void * qt_metacast(const char *)
DFileSystemWatcher::qt_metacall
int qt_metacall(QMetaObject::Call , int , void **)
DFileSystemWatcher::tr
QString tr(const char *s, const char *c, int n)
DFileSystemWatcher::trUtf8
QString trUtf8(const char *s, const char *c, int n)
DFileSystemWatcher::qt_static_metacall
void qt_static_metacall(QObject *, QMetaObject::Call , int , void **)
Class::QPrivateSignal
DFileSystemWatcher::QPrivateSignal
Detailed Description
DFileSystemWatcher::d_func
DFileSystemWatcherPrivate * d_func()
DFileSystemWatcher::d_func
const DFileSystemWatcherPrivate * d_func() const
DFileSystemWatcher::DFileSystemWatcher
DFileSystemWatcher(QObject *parent) Constructs a new file system watcher object with the given parent.
DFileSystemWatcher::DFileSystemWatcher
DFileSystemWatcher(const QStringList &paths, QObject *parent) Constructs a new file system watcher object with the given parent which monitors the specified paths list.
DFileSystemWatcher::~DFileSystemWatcher
~DFileSystemWatcher() Destroys the file system watcher.
DFileSystemWatcher::addPath
bool 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, renamed or removed.
If the watch was successful, true is returned.
Reasons for a watch failure are generally system-dependent, but may include the resource not existing, access failures, or the total watch count limit, if the platform has one.
Note: There may be a system dependent limit to the number of files and directories that can be monitored simultaneously. If this limit is been reached, path will not be monitored, and false is returned.
See also addPaths() removePath()
DFileSystemWatcher::addPaths
QStringList 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, renamed, or removed.
The return value is a list of paths that could not be watched.
Reasons for a watch failure are generally system-dependent, but may include the resource not existing, access failures, or the total watch count limit, if the platform has one.
Note: There may be a system dependent limit to the number of files and directories that can be monitored simultaneously. If this limit has been reached, the excess paths will not be monitored, and they will be added to the returned QStringList.
See also addPath() removePaths()
DFileSystemWatcher::removePath
bool removePath(const QString &path) Removes the specified path from the file system watcher.
If the watch is successfully removed, true is returned.
Reasons for watch removal failing are generally system-dependent, but may be due to the path having already been deleted, for example.
See also removePaths() addPath()
DFileSystemWatcher::removePaths
QStringList removePaths(const QStringList &paths) Removes the specified paths from the file system watcher.
The return value is a list of paths which were not able to be unwatched successfully.
Reasons for watch removal failing are generally system-dependent, but may be due to the path having already been deleted, for example.
See also removePath() addPaths()
DFileSystemWatcher::files
QStringList files() const
DFileSystemWatcher::directories
QStringList directories() const
DFileSystemWatcher::fileDeleted
void fileDeleted(const QString &path, const QString &name)
DFileSystemWatcher::fileAttributeChanged
void fileAttributeChanged(const QString &path, const QString &name)
DFileSystemWatcher::fileClosed
void fileClosed(const QString &path, const QString &name)
DFileSystemWatcher::fileMoved
void fileMoved(const QString &fromPath, const QString &fromName, const QString &toPath, const QString &toName)
DFileSystemWatcher::fileCreated
void fileCreated(const QString &path, const QString &name)
DFileSystemWatcher::fileModified
void fileModified(const QString &path, const QString &name)