Results 1 to 2 of 2

Thread: QFileSystemWatcher strange behaviour on Windows7

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default QFileSystemWatcher strange behaviour on Windows7

    Hello,
    I wrote application that uses QFileSystemWatcher. Everything working as expected on Windows XP, Linux, but on Windows 7 I have problem.

    Scenario:

    1. QFileSystemWatcher emits directoryChanged(QString) in the slot connected to this signal I scan directory and add (new) files to the QFileSystemWatcher.

    2. Then (and here is problem) when I change content of the file QFileSystemWatcher should emit signal fileChanged(QString) but signal is not emitted. (Strange) But when I go to the directory with the file (or refresh content in the windows explorer of this directory) then fileChanged(QString) is emited!.

    If I add file path to QFileSystemWatcher outside of the slot connected to the signal directoryChanged(QString) QFileSystemWatcher correctly emits fileChanged(QString).

    I wrote test application and on Windows 7 QFileSystemWatcher works correctly (app does above steps 1 and 2).

    This happens only on Windows 7.

    The question is why is that happening? I know that the problem lies within app, but I don't know where to look for. The QFileSystemWatcher is on the heap (parent is "this" class) within class (also on heap) that parent is hidden QMainWindow.

    Any idea how to track cause of this behaviour is more then welcome.
    In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
    The advance of computerization however, has not yet wiped out nations and ethnic groups.

  2. #2
    Join Date
    Jan 2014
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QFileSystemWatcher strange behaviour on Windows7

    We have the same issue here.

    If a file, monitored by QFileSystemWatcher is changed, the signal is not emitted until we open the directory in the explorer. After the first time, we open the directory, the workaround does not help anymore. Changes are not recognized anymore.

Similar Threads

  1. Strange behaviour with QWidget
    By franco.amato in forum Qt Programming
    Replies: 1
    Last Post: 13th October 2010, 09:32
  2. strange behaviour with Qt key_space
    By franco.amato in forum Qt Programming
    Replies: 0
    Last Post: 9th April 2010, 23:21
  3. Need help: Strange behaviour
    By navi1084 in forum Qt Programming
    Replies: 3
    Last Post: 14th November 2008, 04:03
  4. Strange Painter behaviour
    By cwomeijer in forum Qt Programming
    Replies: 2
    Last Post: 4th September 2006, 20:52
  5. very strange behaviour
    By regix in forum Qt Programming
    Replies: 23
    Last Post: 20th July 2006, 17:38

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.