[Qt-creator] Strange behavior of Utils::FileSystemWatcher

Konstantin Tokarev annulen at yandex.ru
Wed Apr 4 16:14:31 CEST 2012


Hi all,

I was using QFileSystemWatcher in my plugin, but than discovered Utils::FileSystemWatcher.

"Constructing/Destructing a QFileSystemWatcher is expensive. This can be worked around
by using a centralized watcher..."

So I've decided I should use it instead of QFileSystemWatcher for the great justice. However,
when I switched I've discovered very strange behavior: I get signal fileChanged for certain
file only once. When it's modified second time I get no signal for this file (if I modify ither fiiles
I get signal first time but only once for each file). If I switch back to QFSW everything works fine
again.

I've tried to debug this issue. I've checked that FileSystemWatcher::watchesFile() still returns
true after first file modification. I've also found that FileSystemWatcher::slotFileChanged is not
executed after first file modification.

Does anybody have a clue?

-- 
Regards,
Konstantin



More information about the Qt-creator mailing list