[Qt-creator] indent preprocessor directives

Nikos Chantziaras realnc at gmail.com
Fri May 4 17:31:17 CEST 2012


On 20/04/12 17:44, Erik Verbruggen wrote:
>
> On Apr 20, 2012, at 2:41, Mohammad Mirzadeh wrote:
>
>> Hey guys,
>>
>> Is there a way to tell QtCreator to indent directives appropriately? I don't seem to find an option under the code style ...
>
> No, there are no options for the preprocessor directives. Qt Creator will put a # at the start of the line, which is what the C(++) standard(s) require.

The standards don't require such a thing:

The C standard says:

   A preprocessing directive consists of a sequence of preprocessing
   tokens that begins with a # preprocessing token that (at the start
   of translation phase 4) is either the first character in the source
   file (optionally after white space containing no new-line characters)
   or that follows white space containing at least one new-line
   character, and is ended by the next new-line character.

Indenting preprocessor directives is perfectly acceptable by the standard.




More information about the Qt-creator mailing list