if (file.open(QIODevice::ReadOnly)) { QByteArray data = file.read(Q_INT64_C(2)); QMessageBox::information(this, tr("message"), data); ... file.close();}
if (file.open(QIODevice::ReadOnly)) { QByteArray data = file.read(Q_INT64_C(2)); QMessageBox::information(this, tr("message"), data); QDataStream stream( &file ); stream.setByteOrder(QDataStream::LittleEndian); // или BigEndian int filesize; stream >> filesize; QMessageBox::information(this, "Debug", tr("file size : %1").arg(filesize) ); file.close(); }