Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt Creator indentation changes at save

I'm using Qt creator and i'm willing to create my own coding style.

The only thing i changed in the default Qt[built-in] settings is changed "Tab policy" to "Tabs Only" and "Align continuation lines" to "With regular indent". "Tab size" and "Indent size" are both set to 4.

And I get the following indentation:

int function( int param1 )
{
<  t  >if(  param != 0 &&
<  t  >< s >param != 1 )
<  t  >{
<  t  ><  t  >//do something
<  t  >}
}

< t > is for tabs and < s > is for spaces.

The problem is when I save(Ctrl+S) Qt Creator converts spaces into tabs :( How can I set it not to convert anything and not change indentation at save?

Thanks!

like image 699
Jacob Krieg Avatar asked Jan 17 '13 20:01

Jacob Krieg


People also ask

How to Auto indent in Qt Creator?

To automatically indent the highlighted text, select Auto-indent Selection or press Ctrl+I. To automatically format the highlighted text, select Auto-format Selection or press Ctrl+;. To adjust the wrapping of the selected paragraph, select Rewrap Paragraph or press Ctrl+E followed by R.

Is Qml good?

QML code is simpler to write, as it is less verbose than C++, and is not strongly typed. This also results in it being an excellent language to prototype in, a quality that is vital when collaborating with designers, for example. JavaScript can easily be used in QML to respond to events.

How do you indent in Dev C++?

in the top menu, look through each section until you find compiler options. there'll be a list of checkboxes and a section on the bottom to enter how many spaces it will take... also, you can highlight text and press tab and it'll indent all that text, or you can press shift + tab to unindent text...


1 Answers

Take a look here:

Tools > Options > Text Editor > Behavior
cleanups upon saving section

Or if you want for current project only (change qt creator version in path)

http://doc.qt.io/qtcreator/creator-editor-settings.html

like image 69
Kirween Avatar answered Sep 28 '22 04:09

Kirween