[Qt-creator] Sometimes indentation should be done with spaces even if user wants tabs

Nikos Chantziaras realnc at arcor.de
Thu Mar 18 22:07:14 CET 2010


There's a small detail in Qt Creator's indentation logic that can break 
the layout of code.  Consider this:

   int foo( int arg1, int arg2, int arg3
            int arg4, int arg5 )

The problem here is the second line.  Currently, the editor will use 
tabs to indent it if that's what I chose in the preferences.  However, 
using tabs in this case is wrong; the beginning of the second line 
should always align itself with the first argument of the first line. 
That means it must be done with spaces, since if someone opens the file 
in an editor configured to use, say, 8 spaces instead of 4 for each tab, 
or if I simply change the amount of spaces used per tab in Creator, then 
the above will turn into:

   int foo( int arg1, int arg2, int arg3
                    int arg4, int arg5 )

IMO, the correct way to indent the second line is with spaces only.



More information about the Qt-creator-old mailing list