I would suggest to even avoid using a checkbox for this, and just fully automate the process by using QFileSystemWatcher.
You would need to add the desired path for watching first:
bool QFileSystemWatcher::addPath(const QString & path)
Adds path to the file system watcher if path exists. The path is not added if it does not exist, or if it is already being monitored by the file system watcher.
If path specifies a directory, the directoryChanged() signal will be emitted when path is modified or removed from disk; otherwise the fileChanged() signal is emitted when path is modified, renamed or removed.
If the watch was successful, true is returned.
Reasons for a watch failure are generally system-dependent, but may include the resource not existing, access failures, or the total watch count limit, if the platform has one.
Note: There may be a system dependent limit to the number of files and directories that can be monitored simultaneously. If this limit is been reached, path will not be monitored, and false is returned.
You would be connected to the following signal:
void QFileSystemWatcher::fileChanged(const QString & path) [signal]
This signal is emitted when the file at the specified path is modified, renamed or removed from disk.
The handler slot could then just bring up some notification to the user automatically, even without an explicit checkbox.
Putting all this into practice, I would write something like this:
MyClass::MyClass(QObject *parent) : QObject(parent)
{
connect(myFileSystemWatcherPointer, SIGNAL(fileChanged(const QString &)), SLOT(handleFileChanged(const QString &)));
myFileSystemWatcherPoiner->addPath(myFilePath);
}
MyClass::handleFileChanged(const QString &file)
{
if (file == desiredFile)
showUpdatePopUp();
}