PyQT4 Text editor - final changes
Some advanced PyQT4 featuresHere I'll describe few final changes to the text editor. The first one is the usage of QFileSystemWatcher to watch if the open file didn't changed while open in our editor. Next one is the option to save a new file (when we enter some text without opening any file). So here is the start.py: A new method file_changed(self, path) showed up. It is called by signal fileChanged(const QString&) from QFileSystemWatcher, which passes as the first argument the path to the file which changed: We use QMessageBox to show the message in a window and allow user to save current file under different name or reload the file. To save a file we use QFileDialog with getSaveFileName. Using QFileSystemWatcher we have to remember about adding and removing files from the watch list.