Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-8945 QFileSystemWatcher should notify when files are modified in a watched directory
  3. QTBUG-3576

Unix/Linux: QFileSystemWatcher with Inotify doesn't detect modified files

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Invalid
    • Icon: P3: Somewhat important P3: Somewhat important
    • Some future release
    • Core: I/O
    • None
    • Linux

      With the following example below, echo "foobar" > 1 into the directory does not cause QFileSystemWatcher to emit directoryChanged.

      #include <QtGui>
      
      class Object : public QObject
      {
          Q_OBJECT
      public:
          Object() : QObject()
          {
              QFileSystemWatcher *watcher = new QFileSystemWatcher(this);
              watcher->addPath(QDir::current().absolutePath());
              connect(watcher, SIGNAL(directoryChanged(const QString &)), this,
                      SLOT(onDirModified(const QString &)));
          }
      
      public slots:
          void onDirModified(const QString &path)
          {
              qDebug() << path;
          }
      };
      
      #include "main.moc"
      
      int main(int argc, char **argv)
      {
          QCoreApplication a(argc, argv);
          Object o;
          return a.exec();
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            w00t Robin Burchell
            mch Jervey Kong
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes