Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
Sorting Namespace Reference

Pure text-to-enum helpers for sort directives used by \generatelist and \annotatedlist atoms. More...

Functions

Qt::SortOrder parseSortOrder (const QString &directive)

Detailed Description

Pure text-to-enum helpers for sort directives used by \generatelist and \annotatedlist atoms.

These helpers live in QDocLib so that the QDocLib-pure content builder can parse sort directives without pulling in the driver-layer Generator header. The legacy Generator::sortOrder member delegates here, preserving legacy behavior at all call sites.

Function Documentation

◆ parseSortOrder()

Qt::SortOrder Sorting::parseSortOrder ( const QString & directive)
nodiscard

Parses a QDoc sort directive into a Qt::SortOrder.

Returns Qt::DescendingOrder when directive is "descending" (exact match, case-sensitive). Any other value, including the empty string, returns Qt::AscendingOrder. This matches the legacy behavior of Generator::sortOrder, which accepts the atom's raw second-string argument even when it is the command's primary argument rather than a bracketed sort directive.

Definition at line 33 of file sorting.cpp.