fix formating

This commit is contained in:
arcan1s 2015-10-08 01:14:30 +03:00
parent f1e6f74c7d
commit 6f86e8ec5e

View File

@ -25,11 +25,13 @@ for more details. Some additional detail see below.
* Any header should have [include guard](https://en.wikipedia.org/wiki/Include_guard) * Any header should have [include guard](https://en.wikipedia.org/wiki/Include_guard)
named as `CLASSNAMECAPS_H` named as `CLASSNAMECAPS_H`
* If any `#if` directive is used condition should be mentioned in `#endif`: * If any `#if` directive is used condition should be mentioned in `#endif`:
``` ```
#if (FOO) #if (FOO)
someCodeInside(); someCodeInside();
#endif /* FOO */ #endif /* FOO */
``` ```
* `Q_PROPERTY` macro is allowed and recommended for QObject based classes. * `Q_PROPERTY` macro is allowed and recommended for QObject based classes.
* Qt macros (e.g. `signals`, `slots`, `Q_OBJECT`, etc) are allowed. * Qt macros (e.g. `signals`, `slots`, `Q_OBJECT`, etc) are allowed.
* Current project standard is **C++11**. * Current project standard is **C++11**.
@ -40,11 +42,13 @@ for more details. Some additional detail see below.
of `reinterpret_cast` is not recommended. It is highly recommended to use of `reinterpret_cast` is not recommended. It is highly recommended to use
`dynamic_Cast` with the exception catching. It is also possible to use `dynamic_Cast` with the exception catching. It is also possible to use
`qvariant_cast` if required. Exception is class constructors, e.g.: `qvariant_cast` if required. Exception is class constructors, e.g.:
``` ```
char c = 'c'; char c = 'c';
std::string s = "string"; std::string s = "string";
qDebug() << QString("some string") << QChar(c) << QString(s); qDebug() << QString("some string") << QChar(c) << QString(s);
``` ```
* C-like `NULL`, use `nullptr` instead. * C-like `NULL`, use `nullptr` instead.
* It is highly recommended to avoid implicit casts. * It is highly recommended to avoid implicit casts.
* Abstract classes (which has at least one pure virtual method) are allowed. * Abstract classes (which has at least one pure virtual method) are allowed.
@ -103,11 +107,13 @@ Development
* For experimental features development new branch `feature-foo` creation is allowed * For experimental features development new branch `feature-foo` creation is allowed
and recommended. and recommended.
* Experimental features should be added inside `BUILD_FUTURE` definition: * Experimental features should be added inside `BUILD_FUTURE` definition:
``` ```
#ifdef BUILD_FUTURE #ifdef BUILD_FUTURE
someTestFunctionInside(); someTestFunctionInside();
#endif /* BUILD_FUTURE */ #endif /* BUILD_FUTURE */
``` ```
* Any project specific build variable should be mentioned inside `version.h` as * Any project specific build variable should be mentioned inside `version.h` as
well. well.
@ -152,6 +158,7 @@ Tools
* For QString concatenation use `QString::arg` method. * For QString concatenation use `QString::arg` method.
* Any source file should have license header: * Any source file should have license header:
``` ```
/*************************************************************************** /***************************************************************************
* This file is part of awesome-widgets * * This file is part of awesome-widgets *
@ -170,7 +177,9 @@ Tools
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ * * along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/ ***************************************************************************/
``` ```
* Recommended class constructor for QObject based classes: * Recommended class constructor for QObject based classes:
``` ```
FooClass::FooClass(QObject *parent, const QVariant var) FooClass::FooClass(QObject *parent, const QVariant var)
: QObject(parent), : QObject(parent),
@ -180,7 +189,9 @@ FooClass::FooClass(QObject *parent, const QVariant var)
// some code below if any // some code below if any
} }
``` ```
* Property usage: * Property usage:
``` ```
Q_PROPERTY(bool prop READ prop WRITE setProp); Q_PROPERTY(bool prop READ prop WRITE setProp);
public: public: