Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-72227

QFileSystemWatcher reacts only once on file change

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 5.12
    • 5.11.2
    • None
    • Linux/X11

    Description

      Catching file change in following way:

          QFileSystemWatcher watcher;
          QFileInfo file(url.toLocalFile());
          watcher.addPath(file.absoluteFilePath());
          connect(&watcher, &QFileSystemWatcher::fileChanged, this, &MyClass::mySlot);
      

      slot receives signal only once, then QFileSystemWatcher does not react on any file change. To catch file changes use following workaround - added following lines:

          qmlWatcher.addPath(file.absolutePath());
          connect(&watcher, &QFileSystemWatcher::directoryChanged, this, &MyClass::mySlot);
      

      In this case able to catch all further file modifications.

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              jirauser39314 user-45b5b (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes