1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

docs(CONTRIBUTING): add section about include styles

This commit is contained in:
sudden6 2016-09-20 20:40:15 +02:00
parent a719f98570
commit 84208d0b3f
No known key found for this signature in database
GPG Key ID: 279509B499E032B9

View File

@ -268,6 +268,30 @@ git config --global commit.gpgsign true
Use `C++11`.
## Includes
On the project level, include files starting with the root directory of the
repository, e.g. `src/core/core.h` from `src/widget/widget.cpp`:
```C++
#include "src/core/core.h"
```
Do **not** use `<>` tags to include files on the project level, e.g.
`src/core/core.h` from `src/widget/widget.cpp`:
```C++
#include <core.h> // WRONG
```
If including files from the operating system, external libraries, frameworks
or Qt classes use `<>` tags, e.g. `cstdio` and `QString` from `src/main.cpp`:
```C++
#include <cstdio>
#include <QString>
```
## Coding style
```C++
@ -310,7 +334,6 @@ QObject notToMentionThatWeUseCamelCase;
E.g. https://github.com/qTox/qTox/blob/master/src/misc/flowlayout.cpp
## Dynamic casts / RTTI
qTox is compiled without support for RTTI, as such PRs making use of
@ -324,7 +347,7 @@ behaves very much like C++'s `dynamic_cast()` but without the RTTI overhead.
Enforced with `-fno-rtti`.
## Documentaion
## Documentation
If you added a new function, also add a doxygen comment before the
implementation. If you changed an old function, make sure the doxygen comment