[Interest] question about string to C array/struct in Qt

Konstantin Tokarev annulen at yandex.ru
Sat Feb 2 13:19:40 CET 2013



> Dear,
> 
> I have a log file which contains logged data and report.
> In Qt project, I need to parse the log file and collect the data and report.
> The collected data will then be assigned to an C array and structure.
> This seems to be complicated for me due to lack experience on Qt String class.
> Could anybody guide me some reference code or document?

If you use QByteArray instead of QString, it will give you almost the same
behavior as plain old char *, e.g. you can pass it to APIs accepting char*
and initialize it from char * without any encoding conversion.

 -- 
Regards,
Konstantin



More information about the Interest mailing list