Hi,

I have the following code:

Qt Code:
  1. quint64 input251 = Q_UINT64_C(2161727824133970762);
  2. QByteArray in251 = QByteArray::fromRawData((char *)&input251, sizeof(input251));
To copy to clipboard, switch view to plain text mode 

the first 4 bytes are a time value (to be processed later)
the next 4 are an id value.

in251 holds the value: "J[²

This piece of code:
Qt Code:
  1. bool ok;
  2. msgTime = in251.left(4).toUInt(&ok);
  3. if (!ok) printf ("Conversion ERROR!\r\n" );
To copy to clipboard, switch view to plain text mode 

always returns "Conversion error" and msgTime, of course, is set to zero.

Why can't .toUint() convert those bytes to an int?

Already thankful for any thoughts,
Pedro Doria Meunier