Results 1 to 2 of 2

Thread: QFileSystemWatcher and getting updated timestamps

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2017
    Posts
    1
    Qt products
    Platforms
    Unix/X11 Windows

    Default QFileSystemWatcher and getting updated timestamps

    Hi,
    So I started contributing to uPyLoader on github, and I have been fighting with a silly problem for days now. The application has a "compile" button to compile .py files to bytecode .mpy, and a QTreeView using a standard file system model (I think?).

    Well, long story short, I've tried lots of different things like repaint, QApplication.processEvents(), and os.remove or os.unlink to remove the file.mpy before the new one is created. I have had certain configurations work, to get the timestamp updated in the QTreeView, but when it works, other things don't work such as selecting the rows in the QTreeView of the .mpy files.

    Any ideas on how to get QFileSystemWatcher to just recognize that a file's timestamp has updated and so update the QTreeView.

    Justin

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QFileSystemWatcher and getting updated timestamps

    and I have been fighting with a silly problem for days now
    I could not find in your text what is the actual problem you are having??
    To "compile" only the changed files?

    Any ideas on how to get QFileSystemWatcher to just recognize that a file's timestamp has updated and so update the QTreeView.
    The previous text has nothing to do with this concrete question as far as I can see.
    When a file changes ( when a file has been modified, renamed or removed from disk) its time stamp change as well and QFileSystemWatcher does notify you about any of these changes so implicitly, even though it is not notifying you about the change of the timestamp it notifies you about the events that trigger a timestamp change.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 2
    Last Post: 5th April 2013, 04:58
  2. Replies: 1
    Last Post: 2nd August 2011, 18:01
  3. QFIleSystemWatcher
    By jayreddy in forum Qt Programming
    Replies: 1
    Last Post: 15th December 2009, 08:21
  4. QFileSystemWatcher
    By Kumosan in forum Qt Programming
    Replies: 2
    Last Post: 18th March 2008, 20:52
  5. QFileSystemWatcher
    By minty in forum Qt Programming
    Replies: 13
    Last Post: 22nd May 2007, 15:39

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.