Answer the question
In order to leave comments, you need to log in
Why are the first 4 bytes of QString taken?
Hello
Reading the line "hello" I wrote in the QLineEdit widget:
QByteArray arrBlock;
QDataStream bufferOut(&arrBlock, QIODevice::WriteOnly);
bufferOut.setVersion(QDataStream::Qt_5_3);
bufferOut << pLineEdit->text();
0x00 0x00 0x00 0x0C - непонятная мне структура
0x04 0x3f 0x04 0x40 0x04 0x38 0x04 0x32 0x04 0x35 0x04 0x42 - "привет" в UNICODE
QString str(byteArray);
pTextEdit->append(str);
Answer the question
In order to leave comments, you need to log in
It looks like the first 32 bits are allocated as a value indicating the length of the string
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question