Quote Originally Posted by Mikhail86 View Post
I have a binary file.
OK.

I do like this.
Qt Code:
  1. QFile * file = new QFile("file1.bin");
  2. if(file->open(QIODevice::ReadOnly | QIODevice::Text))
  3. {
  4. QByteArray ba = file->readAll();
  5. qDebug() << ba;
  6. }
To copy to clipboard, switch view to plain text mode 
You almost certainly do not want QFile to do line ending translations: depending on platform this may change the data. That is, you do not want QIODevice::Text in the options.