So what does QFileInfo return when you ask for the file size? Zero? Non-zero? If it returns zero at first, then the actual file size only after the copy operation is complete, then you could start a QTimer when the files first appears (QFileSystemWatcher::directoryChanged()) and check every second or so to look for a non-zero size.
What happens if in your QFileSystemWatcher::directoryChanged() slot you add a connection to the fileChanged() slot? Does that get called when the file copy is finished?
I don't know what this means. How does it fail? What is the "unexpected result"?It also fails. loading non zero size image file gives unexpected result.
If it fails because of unfinished copy, you will have to try again later.
Alternatively you can try to let the file system watcher only start/restart a timer and read the file when the timer runs out.
That of course depends on whether the file system watcher will signal file changes during the copy.
There is no ideal solution because you can't fix the program that is doing the copying.
Cheers,
_
Bookmarks