[Interest] QString to QByteArray conversion

Thiago Macieira thiago at kde.org
Wed Mar 7 09:24:41 CET 2012

On quarta-feira, 7 de março de 2012 09.18.24, Riccardo Roasio wrote:
> Hi
> i have a QString like "81FF25" and i want to convert it into a
> QByteArrya containing bytes 81 FF 25.
> I can i do that?

QByteArray data = QByteArray::fromHex(string.toLatin1());

Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120307/575381e6/attachment.sig>

More information about the Interest mailing list