Hi,

I have a QtConcurrent::run method that copies a pdf file from one directory to the next. This copying is in a separate thread because the pdf files can be quite large and to prevent the main GUI thread from being blocked from doing other tasks.

Qt Code:
  1. void MainWindow::CopyPDFsToDestDir()
  2. {
  3. //setup srcFile and destFile
  4. ...
  5. QFile::copy(srcFile, destFile);
  6. }
  7.  
  8. QFuture<void> result = QtConcurrent::run(this, &MainWindow::CopyPDFsToDestDir);
To copy to clipboard, switch view to plain text mode 

The QtConcurrent::run call is in a loop for x number of files depending on user selections.

It works great on my linux machine (RedHat) and files are copied one by one, but a customer states that on his linux machine (RedHat), the directory only contains 1-2 pdf files. Only after he closes the GUI, suddenly there are 20+ pdf files.

It is as if, the copying of pdf files are being buffered and only flushed upon closing of the GUI. Does this make any sense? ....isn't QFile::copy immediate? or perhaps the QtConcurrent::run threading the cause?