Results 1 to 2 of 2

Thread: Need help with QFileSystemWatcher

  1. #1
    Join Date
    Jan 2006
    Location
    Ukraine, L'viv
    Posts
    57
    Thanks
    3
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Need help with QFileSystemWatcher

    Qt 4.2.0-tp1, Linux, Windows

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

    What I do
    In .h:
    Qt Code:
    1. #include <QFileSystemWatcher>
    2. ...
    3. QString destDir;
    4. ...
    To copy to clipboard, switch view to plain text mode 

    In .cpp:
    Qt Code:
    1. ...
    2. destDir = QFileDialog::getExistingDirectory( this, "Select directory", QFileDialog::ShowDirsOnly);
    3. if (!destDir.isEmpty()){
    4. watcher->addPath(destDir);
    5. }
    To copy to clipboard, switch view to plain text mode 

    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:
    Qt Code:
    1. ...
    2. destDir = QFileDialog::getExistingDirectory( this, "Select directory", QFileDialog::ShowDirsOnly);
    3. if (!destDir.isEmpty()){
    4. watcher->addPath(destDir);
    5. QString dirs;
    6. for(int i = 0; i < watcher->directories().count(); ++i){
    7. dirs.append(watcher->directories().at(i)).append("\n");
    8. }
    9. QMessageBoxEx::information(this, "debug", dirs);
    10. }
    To copy to clipboard, switch view to plain text mode 

    And what I get
    under Linux:
    undefined reference to `QFileSystemWatcher::directories() const'
    and under Windows:
    undefined reference to `_imp___ZNK18QFileSystemWatcher11directoriesEv'

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine, L'viv
    Posts
    57
    Thanks
    3
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Need help with QFileSystemWatcher

    Accordingly to qfilesystem.cpp it seems fileChanged(), directoryChange(), files() and directories() is not implemented yet in 4.2.0-tp1.

Similar Threads

  1. QFileSystemWatcher Question (Qt 4.1.2tp)
    By momesana in forum Qt Programming
    Replies: 8
    Last Post: 25th July 2006, 14:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.