In Qt Creator (3.0.1, Ubuntu 14.04.LTS), how do you insert a literal "tab" character (\t
) (into a C source file) in the Text Editor? (Within a line, the Tab key inserts spaces as per your C++ Indentation level setting.)
At the moment I am having to find a tab character somewhere and use copy & paste. I expected to find some sort of "InsertLiteralCharacter" Command in Tools > Options > Environment > Keyboard, but there isn't one. (While we are there, I see that Commands Indent & Unindent claim to be unbound, but Tab & Shift+Tab respectively do these; don't know why those are not shown?)
[EDIT: For clarity, I want to insert a tab character into (the middle of) lines. I am not asking about tab character behaviour for indenting at the start of a line.]
If you are editing a Make file which requires tab's and your indention is based on insert spaces, you can insert a tab character using: Ctrl+Alt+I
How the tab key is handled in C++ code is configured in the settings for C++ (Tools>Options>C++). I can not check the exact place right now, but there is box with different options on how to handle tabs in there.
You can have tab indent the line whenever it is pressed or do not use it to indent at all or have it indent only when hit in the leading whitespace of a line.
In case this ancient issue still exists or others are facing it: I encountered the same problem with QtCreator 7.0.2 and could solve it by disabling the ClangFormat-Plugin (which I accidentally enabled).
Help -> About Plugins -> Search: Format -> uncheck the plugin
Dialog to disable ClangFormat Plugin