c++ - How to obtain the changed file names from the QFileSystemWatcher `directoryChanged` event -
how can 1 obtain changed file names qfilesystemwatcher directorychanged
event?
you need connect slot filechanged()
signal instead of directorychanged()
if more interested in file names.
connect(&myfilesystemwatcher, signal(filechanged(const qstring&)), slot(handlefilechanged(const qstring&)));
then, can use slot argument desired. here, printing out stdout:
void handlefilechanged(const qstring &path) { qdebug() << path; }
please see documentation further details:
void qfilesystemwatcher::filechanged(const qstring & path) [signal]
this signal emitted when file @ specified path modified, renamed or removed disk.
not sure how familiar qt signal/slot system, if not enough, please go through this, too:
Comments
Post a Comment