[Qt-creator] Cannot access private member declared in class 'QString'

Thomas Meyer public at meyer-thomas.com
Tue Jun 18 13:59:46 CEST 2013


Hi,
I get very often this error, if I write a plugin:
error: C2248: 'QString::QString' : cannot access private member declared 
in class 'QString'

For example:
...
returnQVariant(QString("%1").arg(m_firstRow+section+1));
...

I correct it with:
...
returnQVariant(QString(QLatin1String("%1")).arg(m_firstRow+section+1));
...

So, I correct every 'QString' with 'QLatin1String'.
Is there a better solution or is it the only one?

Thanks,
     Thomas Meyer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20130618/125d04e2/attachment.html>


More information about the Qt-creator mailing list