eradicatore
4th July 2017, 23:51
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
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