[Qt-creator] Cannot access private member declared in class 'QString'
public at meyer-thomas.com
Wed Jun 19 12:02:10 CEST 2013
thanks (to all answers)!
So, I have to type more. :-)
Am 19.06.2013 09:47, schrieb Joerg Bornemann:
> On 18/06/2013 13:59, Thomas Meyer wrote:
>> I get very often this error, if I write a plugin:
>> error: C2248: 'QString::QString' : cannot access private member declared
>> in class 'QString'
> This is due to the definition of QT_NO_CAST_FROM_ASCII in the qtcreator.pri.
I only found it in 'lldbengineguest.cpp' (and with the definition in
qtcreator.pri it is not
necessary, I think).
>> So, I correct every 'QString' with 'QLatin1String'.
>> Is there a better solution or is it the only one?
> For non-translatable strings use QLatin1String("...").
> Use tr("...") for translatable strings.
> P.S. It's possible to remove that define from your plugin but that's
> considered bad style.
Meanwhile I found this:
and I think I can use QStringLiteral too.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Qt-creator