[QGIS-Developer] New Doxygen policies

Nyall Dawson nyall.dawson at gmail.com
Tue Feb 26 16:06:32 PST 2019


Hi all,

Following the merge of https://github.com/qgis/QGIS/pull/9269, this is
a notice regarding new practices regarding doxygen comments which
should be adhered to in all 3.8+ code.

The PR introduces some doxygen macro values, TRUE, FALSE and NULLPTR
(all caps). These should be used when dox mention true, false or
nullptr literal values, instead of "true", "false" or "nullptr". E.g.

 /*
  * Returns TRUE if something, FALSE otherwise.
 */

The macros expand out to "\c true", "\c false" and "\c nullptr" for
the c++ dox, and ``True``, ``False`` and ``None`` for Python
docstrings and the Python API docs. Basically, they apply the correct
formatting for literal values and ensure that the language-correct
values are used in the corresponding docs (Python users should never
have to care what a nullptr is!).

I've bulk updated all existing dox, but please stick to the new
strings when writing new dox.

Finally, we should consistently use "returns NULLPTR"/"set to NULLPTR"
instead of "returns a NULLPTR"/"set to a NULLPTR" (no "a"), because
otherwise the Python dox expand to the awkward phrasing: "returns a
None"/"set to a None".

Nyall


More information about the QGIS-Developer mailing list