codingConventions.doxygen   codingConventions.doxygen 
skipping to change at line 119 skipping to change at line 119
// passed object I18n name. // passed object I18n name.
QList<QString> listMatchingObjectsI18n(const QString& objPrefix, unsigned i nt maxNbItem=5) const QList<QString> listMatchingObjectsI18n(const QString& objPrefix, unsigned i nt maxNbItem=5) const
{ {
etc.. etc..
@endcode @endcode
@section cpp_code C/C++ Code @section cpp_code C/C++ Code
Use C++ replacement for C functions and %Qt replacements for C++ functions/ STL wherever possible. Use C++ replacement for C functions and %Qt replacements for C++ functions/ STL wherever possible.
<ul> <ul>
<li>Use <a href="http://doc.trolltech.com/stable/qstring.html">QString</a> <li>Use <a href="http://qt-project.org/doc/qt-4.8/qstring.html">QString</a
instead of @c std::string or <tt>char *</tt> > instead of @c std::string or <tt>char *</tt>
<li>Use <a href="http://doc.trolltech.com/stable/qiodevice.html">QIODevice <li>Use <a href="http://qt-project.org/doc/qt-4.8/qiodevice.html">QIODevic
</a> instead of C file managment with @c fopen() e</a> instead of C file managment with @c fopen()
<li>Pass objects as references when needed instead of using pointers. <li>Pass objects as references when needed instead of using pointers.
<li>Include standard headers the C++ way, it is more portable: <li>Include standard headers the C++ way, it is more portable:
@code @code
#include <stdio.h> // Bad #include <stdio.h> // Bad
#include <cstdio> // Good #include <cstdio> // Good
#include <QString> // Good #include <QString> // Good
@endcode @endcode
<li>Use <a href='http://doc.trolltech.com/stable/containers.html'>Qt conta iners</a> instead of STL ones. They are easier to use, allow for the foreac h keyword. Only if speed is really critical, use STL containers such as @c std::vector or @c std::map, they are extremely efficient. Documentation is <a href='http://www.sgi.com/tech/stl/'>there</a>. <li>Use <a href='http://qt-project.org/doc/qt-4.8/containers.html'>Qt cont ainers</a> instead of STL ones. They are easier to use, allow for the forea ch keyword. Only if speed is really critical, use STL containers such as @c std::vector or @c std::map, they are extremely efficient. Documentation is <a href='http://www.sgi.com/tech/stl/'>there</a>.
<li>Avoid public global function and variable. Encapsulate them in classes or namespaces as static members/variable. <li>Avoid public global function and variable. Encapsulate them in classes or namespaces as static members/variable.
<li>Avoid using C macro, use static const variables instead. It is safer b ecause it is type safe. <li>Avoid using C macro, use static const variables instead. It is safer b ecause it is type safe.
@code @code
#define RADIUS 12 // Bad #define RADIUS 12 // Bad
static const int RADIUS = 12; // Good static const int RADIUS = 12; // Good
@endcode @endcode
<li>Use stdc++ math functions instead of C ones. There are more portable a nd are also overrided for float, thus may be faster. <li>Use stdc++ math functions instead of C ones. There are more portable a nd are also overrided for float, thus may be faster.
@code @code
double cosLat = cos(lat); // Bad double cosLat = cos(lat); // Bad
double cosLat = std::cos(lat); // Good double cosLat = std::cos(lat); // Good
 End of changes. 2 change blocks. 
5 lines changed or deleted 5 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/