[Qt-creator] indent preprocessor directives

Atlant Schmidt aschmidt at dekaresearch.com
Fri May 11 19:21:37 CEST 2012


  We just ran into an interesting situation that's
  apropos to this discussion.

  We're still running Qt 4.6.2 and we just discovered
  that the Qt moc only handles #ifdef directives if
  they appear in column 1! One of our engineers indented
  his #ifdef directive to line up with the prevailing
  code indent level and the meta-object compiler blithely
  included in the produced moc references to code that
  the C++ compiler was correctly excluding everywhere
  else. The result, of course, was a failure to link.

  I wonder if this has been fixed in the current moc?


-----Original Message-----
From: qt-creator-bounces+aschmidt=dekaresearch.com at qt-project.org [mailto:qt-creator-bounces+aschmidt=dekaresearch.com at qt-project.org] On Behalf Of qt.dantec at free.fr
Sent: Tuesday, May 08, 2012 16:23
To: qt-creator at qt-project.org
Subject: Re: [Qt-creator] indent preprocessor directives

On Fri, 20 Apr 2012 16:44:30 +0200, Erik Verbruggen
<erik.verbruggen at me.com>  wrote:

>Is there a way to tell QtCreator to indent directives appropriately?

There is no such thing as an "appropriate" way to indent directives :
It is sometimes a matter of style or context, but more importantly,
for many projects, it is defined in the project's guidelines for

As a consequence, there is one and one only good solution for Creator
: Let developers pick what they prefer, or whatever it is that they
are ordered to do.

Ideally, let developers define their preferences, within the C++ code
style options, on a project per project basis.

Qt-creator mailing list
Qt-creator at qt-project.org

 Click https://www.mailcontrol.com/sr/b2sWIEIBbcbTndxI!oX7UjaeDmea67kXF0USi!ip87Ihs+FYkM0qVQ7EuxmfksU1rEhty3NkVVtUlvAsdlYHAg==  to report this email as spam.

This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.

More information about the Qt-creator mailing list