Documentation: Clarify global variables.

Rubber-stamped-by: hjk

Change-Id: Ic5d8a50deeee93572d838725d1cf4d2af6245c0f
Reviewed-on: http://codereview.qt.nokia.com/510
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
Friedemann Kleint
2011-06-20 14:14:49 +02:00
parent e4651a28e3
commit d411933fe6
+6 -1
View File
@@ -450,7 +450,12 @@
\section3 Declaring Variables
\list
\o Avoid global or static variables.
\o Avoid global variables of class type to rule out initialization order problems.
Consider using \c Q_GLOBAL_STATIC if they cannot be avoided.
\o Declare global string literals as
\code
const char aString[] = "Hello";
\endcode
\o Avoid short names (such as, a, rbarr, nughdeget) whenever possible.
Use single-character variable names only for counters and
temporaries, where the purpose of the variable is obvious.