[Qt-interest] Weird compiler error with QString(QChar(value))

Nikos Chantziaras realnc at arcor.de
Wed May 5 20:51:00 CEST 2010


Not sure I understand why this won't compile:

   int unicodeValue = func_that_returns_a_unicode_value();
   QString s(QChar(unicodeValue));
   const QByteArray& utf8 = s.toUtf8();  // <-- error happens here

I get:

error: request for member 'toUtf8' in 's', which is of non-class type 
'QString(QChar)'

I'm confused as hell :P



More information about the Qt-interest-old mailing list