Qt Creator allows you to configure the text editor to suit your specific needs. To configure the editor, select Tools > Options... > Text Editor.

You can perform the following configuration actions:
You can select the font family and size. You can specify a zoom setting in percentage for viewing the text. You can also zoom in or out by pressing Ctrl++ or Ctrl +-, or by pressing Ctrl and rolling the mouse button up or down. To disable the mouse wheel function, select Tools > Options... > Text Editor > Behavior and deselect the Enable scroll wheel zooming check box.
Antialiasing is used by default to make text look smoother and more readable on the screen. Deselect the Antialias check box to turn off antialiasing.
You can select one of the predefined color schemes for syntax highlighting or create customized color schemes. The color schemes apply to highlighting both C++ and QML files and generic files.
To create a color scheme:
The backgound of the Text element determines the background of the code editor.
When you copy code from Qt Creator, it is copied in both plain text and HTML format. The latter makes sure that syntax highlighting is preserved when pasting to a rich-text editor.
Generic highlighting is based on highlight definition files that are provided by the Kate Editor. You can download highlight definition files for use with Qt Creator.
If you have a Unix installation that comes with the Kate Editor, you might already have the definition files installed. Typically, the files are in a read-only directory, and therefore, you cannot manage them. Qt Creator can try to locate them and use them as fallback files, when the primary location does not contain the definition for the current file type. You can also specify the directory that contains preinstalled highlight definition files as the primary location.
When you open a file for editing and the editor cannot find the highlight definition for it, an alert appears. You can turn off the alerts. You can also specify patterns for ignoring files. The editor will not alert you if highlight definitions for the ignored files are not found.
To download highlight definition files:



When you type code, it is indented automatically according to the selected options. Select a block to indent it when you press Tab. Press Shift+Tab to decrease the indentation.
When you press Backspace the indentation is decreased by one level, instead of one space, by default.
By default, the tab-length in code editor is 8 spaces, but you can change it. The code editor can also determine whether tabs or spaces are used on the previous or next line and copy the style.
You can determine whether the block indent style includes braces, or you can use the GNU indent style. The GNU style places braces on a separate line, indented by 2 spaces, except when they open a function definition, where they are not indented.
You can also specify whether continuation lines are aligned with the previous code or just indented to the logical depth. You can always use spaces for alignment or use spaces or tabs depending on the other options you selected.
The following code snippet illustrates excluding braces from the indented block:
void foobar(bool zoo)
{
if (zoo)
{
foo();
}
}
The following code snippet illustrates including braces in the indented block:
void foobar(bool zoo)
{
if (zoo)
{
foo();
}
}
The following code snippet illustrates the GNU style:
void foobar(bool zoo)
{
if (zoo)
{
foo();
}
}
[Previous: Pasting and Fetching Code Snippets] [Next: Using FakeVim Mode]