Qt 6.11 is out! See what's new in the release
blog
Am I misunderstanding or misusing QByteArray::toHex()?
-
I have a
char[32] data;populated with some data and its bytes increment from 0x00 to 0xff one after another over the course of the algorithm. When I call
auto hex = QByteArray(data).toHex();every time hex contains an empty array regardless of the increments of data bytes.
What's the trick?
-
If first element in
datais0x00thenQByteArray(data)will be empty (it assumes a null terminated string). Pass the size as a second parameter.