Hello, I am sorry that write in Russian.
There is a problem.
Converts QdateTime (unix) in Hex QString
QString time = QString("%1").arg(QDateTime::currentDateTime().toTime_t(),0,16).toUpper();
To copy to clipboard, switch view to plain text mode
All OK.
After trying to make
QByteArray myHexArray = QByteArray::fromHex(time.toLatin1());
To copy to clipboard, switch view to plain text mode
but leaves some crap.
for example, I got HEX - 57640466
If I manually insert it
QByteArray myHexArray = QByteArray::fromHex("57640466");
To copy to clipboard, switch view to plain text mode
That is the right thing happens at the output see
0x57 0x64 0x04 0x66
0x57 0x64 0x04 0x66
To copy to clipboard, switch view to plain text mode
And if instead of the time value is inserted in the hex output is wrapped again in hex
How so I do not understand.
Even if everything is OK with the values, further reason
if you take a separate index from 0 myHexArray not get 0x57, and
[0] = 0x05, [1] = 0x07
Help me please )
Bookmarks