변경 감지QT 내가 하위 폴더를 uncluding 디렉토리에 어떤 변화를 감지 할 디렉토리 및 하위 폴더
-
: 내가 원하는 \ 드롭 박스 내 응용 프로그램이 표시
- D : \ 보관 \ 폴더 1 \은 File2.txt
- D 삭제 : \ 보관 \ 폴더 1 \ Folder2와는
- D를 생성 : \ 보관 \ 대중이 ...
- 수정
는 몸이 나를 도울 수주십시오 "디렉토리가 변경됩니다"?
#ifndef MYCLASS_H
#define MYCLASS_H
#include <QWidget>
#include <QMessageBox>
class MyClass : public QWidget
{
Q_OBJECT
public:
MyClass(QWidget* parent=0)
:QWidget(parent){}
~MyClass(){}
public slots:
void showModified(const QString& str)
{
Q_UNUSED(str)
QMessageBox::information(this,"Directory Modified", "Your Directory is modified");
}
};
#endif // MYCLASS_H
#include <QApplication>
#include <QFileSystemWatcher>
#include <QDebug>
#include "MyClass.h"
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QFileSystemWatcher watcher;
watcher.addPath("C:/QtTest");
QStringList directoryList = watcher.directories();
Q_FOREACH(QString directory, directoryList)
qDebug() << "Directory name" << directory <<"\n";
MyClass* mc = new MyClass;
QObject::connect(&watcher, SIGNAL(directoryChanged(QString)), mc, SLOT(showModified(QString)));
return app.exec();
}
넌 무엇을 알고 싶니? –
@ MuratŞeker : 게시물의 시작 부분을 읽으십시오. – lpapp
user3711966, 대답이 빠졌습니까? – lpapp