Thanks,

I removed the QTextStream and also I had to change this line to work:

Qt Code:
  1. if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
  2. return;
To copy to clipboard, switch view to plain text mode 

To this:

Qt Code:
  1. if (!file.open(QIODevice::ReadOnly))
  2. return;
To copy to clipboard, switch view to plain text mode 


Thanks a lot!