5#ifndef DBASEFILEWATCHER_H
6#define DBASEFILEWATCHER_H
8#include "dtkcore_global.h"
15class DBaseFileWatcherPrivate;
33 static bool ghostSignal(
const QUrl &targetUrl, SignalType1 signal,
const QUrl &arg1);
34 static bool ghostSignal(
const QUrl &targetUrl, SignalType2 signal,
const QUrl &arg1,
const QUrl &arg2);
37 void fileDeleted(
const QUrl &url);
38 void fileAttributeChanged(
const QUrl &url);
39 void fileMoved(
const QUrl &fromUrl,
const QUrl &toUrl);
40 void subfileCreated(
const QUrl &url);
41 void fileModified(
const QUrl &url);
42 void fileClosed(
const QUrl &url);
45 explicit DBaseFileWatcher(DBaseFileWatcherPrivate &dd,
const QUrl &url, QObject *parent = 0);
DBaseFileWatcher 类提供了一系列接口可供监视文件和目录的变动。
Definition: dbasefilewatcher.h:17
bool stopWatcher()
停止监视文件变动
static bool ghostSignal(const QUrl &targetUrl, SignalType1 signal, const QUrl &arg1)
发送一个信号表示目标目录targetUrl得到了一个signal信号,包含参数arg1 使用方式如下:
bool restartWatcher()
重启监视文件变动
bool startWatcher()
开始监视文件变动
QUrl fileUrl() const
返回文件的统一资源定位符
virtual void setEnabledSubfileWatcher(const QUrl &subfileUrl, bool enabled=true)
设置是否对subfileUrl目录启用文件监视
static bool ghostSignal(const QUrl &targetUrl, SignalType2 signal, const QUrl &arg1, const QUrl &arg2)
发送一个信号表示目标目录targetUrl得到了一个signal信号,包含参数arg1和arg2