If the stored byte order is the same as you machine architecture.
Qt Code:
  1. Q_ASSERT(sizeof(double)==8);
  2. QFile binary("filepath.bin");
  3. if( binary.open(QIODevice::ReadOnly) ) {
  4. double values[8];
  5. qint64 bytes = binary.read(static_cast<char *>(values), 64);
  6. if (bytes == 64) {
  7. for (int i = 0; i < 8; ++i)
  8. qDebug() << values[i];
  9. }
  10. }
To copy to clipboard, switch view to plain text mode 
If the byte order is different then you have a byte swapping exercise to do.

With a primitive type (i.e. Known size) you might be able to use QDatastream but you still need to know the byte order and set the stream accordingly. That is not really QDataStream's purpose though.