Here is some strace output while using a file watcher.
First, I touch the file.
Then I use an editor (vi, gedit, probably most others) to save the file.
The same thing happens when I do "mv file tst.cpp". This is the 'atomic rename' pattern used in most editors when saving file contents.
It seems QFileSystemWatcher stops watching the file in this case. It does fire it's signal one last time so a workaround is to continuously re-add the file:
Shouldn't QFileSystemWatcher just detect the 'atomic rename' case and continue to watch the file? If not, shouldn't the documentation warn users of the class about this problem?