[Qt-interest] application version and DRY principle

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Fri Feb 18 13:52:27 CET 2011


> You'll get right makefile. But you'll get  syntax error in source code
> because when you type something like this:
>
> QApplication::setApplicationVersion(MYAPPVERSION);

I think you can stringify the define...

http://stackoverflow.com/questions/3419332/c-preprocessor-stringify-the-result-of-a-macro
http://gcc.gnu.org/onlinedocs/cpp/Stringification.html

Haven't tired, so don't know if it'll work.

HTH,
-mandeep

>
> Compliler will get:
>
> QApplication::setApplicationVersion(1.2.3 beta build 234);
>
> and will complain. And he would be right.
>
>
>> You probably meant QCoreApplication::setApplicationVersion(QString) - right?
>
> Yes, you are right. Thanks.
>
>
> --
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing in e-mail?
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>



More information about the Qt-interest-old mailing list