The QT coding style is used with the following additions:
Member variables (private and public) are prefixed by m.
Slots are prefixed by sl and signals sig
Implicit this pointers are used when possible.
void A::f()
{
this->mCount = 0; // wrong
mCount = 0; // correct
}
All memory management strategies directly supported by QT are accepted in addition to stack allocated objects ala. RAII.
For user-defined types smart pointers (as in QSharedPointer) is highly encouraged.
Contrary to the QT coding style, brackets are always used with if statements even if the body of the if statement only consist of a single line. This is to improve robustness.
// correct
int* value;
void* A::func(char* c) { ...
// wrong
int *value;
void *A::func(char *c) { ...