DBaseFileWatcher 类提供了一系列接口可供监视文件和目录的变动。
更多...
|
using | SignalType1 = void(DBaseFileWatcher::*)(const QUrl &) |
|
using | SignalType2 = void(DBaseFileWatcher::*)(const QUrl &, const QUrl &) |
|
|
void | fileDeleted (const QUrl &url) |
| 文件被删除的信号
|
|
void | fileAttributeChanged (const QUrl &url) |
| 文件属性被改变的信号
|
|
void | fileMoved (const QUrl &fromUrl, const QUrl &toUrl) |
| 文件被移动的信号
|
|
void | subfileCreated (const QUrl &url) |
| 子文件被创建的信号
|
|
void | fileModified (const QUrl &url) |
| 文件被修改的信号
|
|
void | fileClosed (const QUrl &url) |
| 文件被关闭的信号
|
|
|
static bool | ghostSignal (const QUrl &targetUrl, SignalType1 signal, const QUrl &arg1) |
| 发送一个信号表示目标目录targetUrl 得到了一个signal 信号,包含参数arg1
使用方式如下:
|
|
static bool | ghostSignal (const QUrl &targetUrl, SignalType2 signal, const QUrl &arg1, const QUrl &arg2) |
| 发送一个信号表示目标目录targetUrl 得到了一个signal 信号,包含参数arg1 和arg2
|
|
|
| DBaseFileWatcher (DBaseFileWatcherPrivate &dd, const QUrl &url, QObject *parent=0) |
|
| DObject (DObject *parent=nullptr) |
|
| DObject (DObjectPrivate &dd, DObject *parent=nullptr) |
|
DBaseFileWatcher 类提供了一系列接口可供监视文件和目录的变动。
- 注解
- 建议使用 DFileWatcher 类,该类是 DBaseFileWatcher 的子类,提供了更多的功能。或者使用DFileWatcherManager类,该类提供了对文件和目录的监视功能。
- 警告
- 该类是一个虚类,不应该被直接使用,而应该使用 DFileWatcher 类或者 DFileWatcherManager 类。
◆ fileUrl()
QUrl Dtk::Core::DBaseFileWatcher::fileUrl |
( |
| ) |
const |
◆ ghostSignal() [1/2]
static bool Dtk::Core::DBaseFileWatcher::ghostSignal |
( |
const QUrl & |
targetUrl, |
|
|
SignalType1 |
signal, |
|
|
const QUrl & |
arg1 |
|
) |
| |
|
static |
发送一个信号表示目标目录targetUrl
得到了一个signal
信号,包含参数arg1
使用方式如下:
static bool ghostSignal(const QUrl &targetUrl, SignalType1 signal, const QUrl &arg1)
发送一个信号表示目标目录targetUrl得到了一个signal信号,包含参数arg1 使用方式如下:
void fileDeleted(const QUrl &url)
文件被删除的信号
- 返回
- 成功发送返回 true,否则返回 false
◆ ghostSignal() [2/2]
static bool Dtk::Core::DBaseFileWatcher::ghostSignal |
( |
const QUrl & |
targetUrl, |
|
|
DBaseFileWatcher::SignalType2 |
signal, |
|
|
const QUrl & |
arg1, |
|
|
const QUrl & |
arg2 |
|
) |
| |
|
static |
发送一个信号表示目标目录targetUrl
得到了一个signal
信号,包含参数arg1
和arg2
示例用法:
void fileMoved(const QUrl &fromUrl, const QUrl &toUrl)
文件被移动的信号
◆ restartWatcher()
bool Dtk::Core::DBaseFileWatcher::restartWatcher |
( |
| ) |
|
◆ setEnabledSubfileWatcher()
void Dtk::Core::DBaseFileWatcher::setEnabledSubfileWatcher |
( |
const QUrl & |
subfileUrl, |
|
|
bool |
enabled = true |
|
) |
| |
|
virtual |
设置是否对subfileUrl
目录启用文件监视
- 参数
-
[in] | subfileUrl | 设置所针对的 Url |
[in] | enabled | 是否启用文件变动监视 |
◆ startWatcher()
bool Dtk::Core::DBaseFileWatcher::startWatcher |
( |
| ) |
|
◆ stopWatcher()
bool Dtk::Core::DBaseFileWatcher::stopWatcher |
( |
| ) |
|
该类的文档由以下文件生成: