-
Notifications
You must be signed in to change notification settings - Fork 5
Coding style
szreder edited this page Nov 27, 2013
·
1 revision
Code style is based mostly on Linux kernel coding style with the following additions and modifications:
- We don't enforce the limit on the length of lines.
- Pointers and references bind to the right side (name of the variable) and not the left side (type). This also applies to returning results from functions, where we put space around the asterisk and ampersand characters. Examples:
int *a, *b;const QString & f(const Object &o);
- We follow camelCase naming convention. Type names (including classes) and constants start with a CapitalLetter.
- Angle-parens in template types are prefixed and suffixed with a space:
- WRONG:
QVector<QList<QPair<int, int> > > - CORRECT:
QVector <QList <QPair <int, int> > >
- Angle-parens in template functions and entities with function-like syntax (e.g. casts) are not prefixed nor suffixed with a space:
static_cast<int>(x);