[Interest] QString to QByteArray conversion

David Ching dc at dcsoft.com
Wed Mar 7 18:02:01 CET 2012


From: Thiago Macieira <thiago at kde.org>
Subject: Re: [Interest] QString to QByteArray conversion
To: interest at qt-project.org
Message-ID: <1359916.pguQgTLvcx at tjmaciei-mobl2>
Content-Type: text/plain; charset="iso-8859-1"

>> 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());

LOL, so easy!  And to think that some people blame Qt for being "bloated"!
I say, "Bring on the bloat!"  :-)

-- David





More information about the Interest mailing list