Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, March 2002
constructing a QString from a char * and length


Message 1 in thread


<<< text/html: EXCLUDED >>>


Message 2 in thread

Try using QByteArray....

On Mon, 4 Mar 2002, Mark Wilson wrote:

> I need to convert an array of char (may not be null terminated) into a QString. There does not appear to be a constructor QString(char *, int) that permits this. I could use QCString(char *, int), then QString(QCString), but the trolls warn that QCString is not a well written class.
>
> Am I missing something obvious?
> Mark
>


Message 3 in thread

Dear Mark,

  You're perfectly write, only the constructor of QCString does, what you 
are expecting. I think the trolls just warn about the fact, that QCString 
is not highly optimized concerning the avoidance of deep copies of the 
contents. Nevertheless QCString is functioning and free of bugs.

   Wolfgang

--
 [ signature omitted ]