[Qt-interest] QString from char array

Donal donaloconnor at gmail.com
Wed Jan 21 23:05:15 CET 2009


Have you a null terminating character at the end '\0' at the end of the
array?

On Wed, Jan 21, 2009 at 10:02 PM, RZ <rz at razfazz.at> wrote:

> Hi,
>
> i'm banging my head against the wall cause the solution should be
> simple. Over some network connection i receive an array of uint8 which i
> want to convert into a QString.
> So e.g. in the array there are the values for "test" (116 65 115 116)
> but i can't get a string out of it. I tried
> QString::fromAscii/Local8Bit/....((const char*)array) but I always get
> garbage.
> It can't be that complicated but i just can't find the right way.
>
> Thx for any help,
>
> RZ
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090121/12400000/attachment.html 


More information about the Qt-interest-old mailing list