Readable code is crucial, and Qt Creator's default coding style is one that most people find very readable. However, you might be on a project with different coding guidelines, or you might just find that you can't bear a particular facet of how the Qt Creator editor deals with code formatting; maybe it's the positioning of the brackets or how a switch statement gets formatted. Fortunately, Qt Creator is extremely configurable. Go to Tools | Options... | C++ and configure how Qt Creator will format your code, as shown in the following screenshot:
The basic dialog lets you pick popular formatting styles, such as Qt's default format or the format used by most GNU code. You can also click on Edit..., which brings up the code style editor, which you can see in the next screenshot:
You'll want to begin...