Book Image

Application Development with Qt Creator - Second Edition

Book Image

Application Development with Qt Creator - Second Edition

Overview of this book

Table of Contents (20 chapters)
Application Development with Qt Creator Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Configuring the coding style and coding format options


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 by copying a built-in style and editing it to suit your tastes; from the Edit Code Style dialog, you can select whether tabs are spaces or tabs, the...