[Qt-creator] #ifdef areas always grey

Kris Wong wongk at seapine.com
Tue Jul 28 13:48:31 CEST 2009


> I have a user-defined flag that I'm currently setting in the myproject.pro
> file, with a line like:
>
> DEFINES += MYFLAG
>
> The problem is that in the code, wherever I have:
>
> #ifdef MYFLAG
>   [code]
> #endif
>
> All the '[code]' section is grey-on-white.  This is less than ideal for
> editing, and I've taken to commenting out the first #ifdef while editing,
> then trying to remember to uncomment it again before checking in the code.
> Is there a recommended solution for this for now, and can the general
> situation be fixed for the future?  Thanks!

Creator does not pickup preprocessor definitions from the project file. I
had sent a patch that allowed you to work around this issue by using a
file with a "special" name in the project directory, but it was never
merged.

Kris Wong




More information about the Qt-creator-old mailing list