Qt Code:
  1. //Pseodu
  2. int i=0;
  3. while(!eof(fptr){
  4. ReadBuff(fptr,Buff,SIZE);
  5. WriteToPrintf(Buff,SIZE);
  6. ProgressBarUpdate(i);
  7. qApp->processEvents(); // This will make your app responcive
  8. i+=IncrementValue;
  9. }
To copy to clipboard, switch view to plain text mode 
Kepp SIZE small.
But moving it to a new thread is the best solution.