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!
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.
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.
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...
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With