[Qt-creator] Minimizing compile-time conditionals in Qt Creator

Linos info at linos.es
Tue Aug 28 10:09:00 CEST 2012


On 28/08/12 10:05, Konstantin Tokarev wrote:
> 
> 
> 28.08.2012, 11:56, "Christian Kandeler" <christian.kandeler at nokia.com>:
>> However, most of the time that is not the case, such as in
>> this example:
>>      QStringList rc(QLatin1String(".svn"));
>>      #ifdef Q_OS_WIN
>>          rc.push_back(QLatin1String("_svn"));
>>      #endif
>>      return rc;
>> The code would compile on any platform, but we hide it from the compiler
>> and Qt Creator's code model on all of them except Windows. This means
>> that if, for instance, you are developing on Linux and you are using
>> Creator's refactoring support to rename the rc variable in the above
>> example, Creator will miss the occurrence inside the #ifdef'ed block, as
>> that one is not part of the code model. 
> 
> I think this issues is a fault of Qt Creator. While I understand that it may be
> impossible to parse disabled block completely in some cases (not in this one
> btw), it would be very desirable to support basic things like code navigation and
> variable renaming for disabled blocks too. Otherwise maintaining cross-platform
> code (not only for desktop platforms!) is sometimes painful.
> 

+1

Regards,
Miguel Angel.



More information about the Qt-creator mailing list