[Qt-creator] Tabs vs Spaces?

Brendan Murphy brendan.murphy at qt.io
Mon Mar 9 14:44:28 CET 2020

Hi Jason,

QtCreator also has an option to insert tabs AS spaces, which is what I tend to use because I like the single key press but want the uniformity of spaces.

So one tab press = n spaces

Hope that helps.

Brendan J. Murphy

Get Outlook for Android<https://aka.ms/ghei36>

From: Qt-creator <qt-creator-bounces at qt-project.org> on behalf of Bryan Bennetts <bryan.bennetts at gmail.com>
Sent: Friday, March 6, 2020 4:40:29 PM
To: Jason H <jhihn at gmx.com>
Cc: qt-creator <qt-creator at qt-project.org>
Subject: Re: [Qt-creator] Tabs vs Spaces?

Hi Jason,

You can use git smudge and clean filters so that local versions appear to have spaces, but the remote has tabs. Having said that, I've fiddled with them in the past for formatting they are a little scary IMHO.

Best plan is just to choose a format and get everyone to use it, regardless of personal preference. 'this is the project format - suck it up.'

As the others have said clang-format is a popular formatter at the moment, and is quite nicely integrated in QTC.

There are more than a few pre and post commit hooks out out on the Web to auto clang format to the configuration in the root of the project directory, the only shortfall I've seen in some is that they fail to format the working version at the same time so the dev will see a difference between the working version and the committed version that they might not anticipate.


On Fri, 6 Mar 2020, 16:38 Jason H, <jhihn at gmx.com<mailto:jhihn at gmx.com>> wrote:
I am a tabs guy. I change the Qt style to use tabs. I tab all the things!!

Anyway, I now have other contributors to my project that are spaces people. How can we live in harmony? One side effect is that it seems git considers whitespace changes so his code is indented with spaces, mine are tabs and it's making a mess in git.

Or should this be handled by git? (And if so, how?)

Qt-creator mailing list
Qt-creator at qt-project.org<mailto:Qt-creator at qt-project.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20200309/418c04d7/attachment.html>

More information about the Qt-creator mailing list