if (!newFile.isEmpty() && !deleteFile.isEmpty())
{
// 文件/目录重命名
if ((newFile.count() == 1) && (deleteFile.count() == 1))
{
qDebug() << QString("File Renamed from %1 to %2").arg(deleteFile.first()).arg(newFile.first());
}
}
else
{
// 添加新文件/目录至Dir
if (!newFile.isEmpty())
{
qDebug() << "New Files/Dirs added: " << newFile;
foreach (QString file, newFile)
{
// 处理操作每个新文件....
//QMessageBox::warning(NULL, "警告弹窗", "数据存储故障", QMessageBox::Yes, QMessageBox::Yes);
}
}
else
{
QMessageBox::warning(NULL, "警告弹窗", "数据存储故障", QMessageBox::Yes, QMessageBox::Yes);
}
// 从Dir中删除文件/目录
if (!deleteFile.isEmpty())
{
qDebug() << "File
Qt 之 QFileSystemWatcher
最新推荐文章于 2024-08-24 00:55:48 发布
这篇博客探讨了使用Qt库中的QFileSystemWatcher组件监控文件系统时遇到的问题。作者遇到的情况是,在目录下文件未发生改变时,预期的‘数据存储故障对话框’未能正确弹出。作者寻求社区中经验丰富的开发者提供帮助和解决方案。
摘要由CSDN通过智能技术生成