[Qt-interest] Q_CLASSINFO macro expansion
Thomas Fjellstrom
tfjellstrom at shaw.ca
Sat Jan 23 22:27:25 CET 2010
On Sat January 23 2010, Christian Dähn wrote:
> Hi,
>
> I had the exactly same problem - the reason is, that the moc cannot
> handle defines inside Qt macros - the moc is a little bit "stupid" and
> doesn't really work like a preprocessor.
>
> The only way I got it working was to use simple C-functions which return
> the values of the defines - e.g. like this:
>
> #define APP_VERSION "1.0.0."
>
> QString getVersion() { return APP_VERSION; }
>
> Q_CLASSINFO("Version", getVersion());
If its an odd parsing issue, do you think:
#define APP_VERSION() "1.0.0.0"
Q_CLASSINFO("Version", APP_VERSION());
would work?
> ciao,
> Chris
>
--
Thomas Fjellstrom
tfjellstrom at shaw.ca
More information about the Qt-interest-old
mailing list