[Interest] Re: question about translations and QT_NO_CAST_FROM_ASCII

Jan Kundrát jkt at flaska.net
Thu Jan 31 15:24:23 CET 2013


On Wednesday, 30 January 2013 16:27:24 CEST, franki wrote:
> I have found:
> #undef QT_NO_CAST_FROM_ASCII
> #define QT_NO_CAST_FROM_ASCII
> but it appears that this does not work in my code, I mean there are still 
> errors that:
> QString::QString(const char*)' is private
> between undef and define

That's because of how the C++ preprocessor (the thing which you control via #define) works. The #define takes effect at the time you include the class definition (the <QString> header); when the QT_NO_CAST_FROM_ASCII is defined, the appropriate constructors which take C++ string literals are declared private. Flipping the #define after the class has been defined has no effect.

With kind regards,
Jan

-- 
Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/



More information about the Interest mailing list