PDA

View Full Version : Need help with QFileSystemWatcher



L.Marvell
17th August 2006, 11:45
Qt 4.2.0-tp1, Linux, Windows

It seems I missed something but I can't get what.

What I do
In .h:


#include <QFileSystemWatcher>
...
QString destDir;
QFileSystemWatcher *watcher;
...


In .cpp:


...
destDir = QFileDialog::getExistingDirectory( this, "Select directory", QFileDialog::ShowDirsOnly);
if (!destDir.isEmpty()){
watcher->addPath(destDir);
}


There are also slot connected to watcher's signal directoryChanged(const QString&). When I tried to do something with selected dir (remove for example) nothing happened. So I've decided to check what is going on with the next addition code:


...
destDir = QFileDialog::getExistingDirectory( this, "Select directory", QFileDialog::ShowDirsOnly);
if (!destDir.isEmpty()){
watcher->addPath(destDir);
QString dirs;
for(int i = 0; i < watcher->directories().count(); ++i){
dirs.append(watcher->directories().at(i)).append("\n");
}
QMessageBoxEx::information(this, "debug", dirs);
}


And what I get
under Linux:


undefined reference to `QFileSystemWatcher::directories() const'

and under Windows:

undefined reference to `_imp___ZNK18QFileSystemWatcher11directoriesEv'

L.Marvell
18th August 2006, 13:19
Accordingly to qfilesystem.cpp it seems fileChanged(), directoryChange(), files() and directories() is not implemented yet in 4.2.0-tp1.