As you can tell from the name, I am having problems converting QByteArray to an integer.
QByteArray buffer = server->read(8192); QByteArray q_size = buffer.mid(0, 2); int size = q_size.toInt();
However, size is 0. buffer does not receive any ASCII character, and I believe that the toInt() function will not work if it is not an ASCII character. int size should be 37 (0x25), but, as I said, this is 0.
q_size is 0x2500 (or another order order is 0x0025 ).
What is the problem? I am sure q_size contains the data I need.
qt bytearray
Ahmed
source share