Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent Qt Creator 2.4.1 from replacing tabs with spaces?

Tags:

qt

qt4

qt5

How can I prevent Qt Creator 2.4.1 from replacing tabs with spaces?

I have chosen ‘Tabs only’ on ‘Tab policy’ but Qt Creator still has this annoying behaviour

like image 840
Rsvay Avatar asked Sep 10 '14 07:09

Rsvay


2 Answers

In settings, go to C++, and on the Code Style tab, press the Edit button. In the new window, you will have a General Tab which allows for C++-specific code indentation settings.

Set Tab policy to Tabs only and Align continuation lines (if 2.4.1 already had that, not sure) to With Regular Indent and you should be good.

Note: The same can be done for Qt Quick.

like image 51
Tim Meyer Avatar answered Nov 15 '22 06:11

Tim Meyer


3 years later the issue is still there but ... in QT5.9.1 - qt-creator go to Tools - Options - Fakevim and click on the button "set Qt Style" and the problem is gone (at least for Makefile(s))

like image 38
Agguro Avatar answered Nov 15 '22 07:11

Agguro