QPartialOrdering Class
The QPartialOrdering class represents the result of a comparison that allows for unordered results. More…
| Header | #include <QPartialOrdering> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Core) |
| Module | Nt Core C++ Classes |
List of all members, including inherited members
Static Public Members
| const QPartialOrdering | Less |
| const QPartialOrdering | Equivalent |
| const QPartialOrdering | Greater |
| const QPartialOrdering | Unordered |
Detailed Description
A comparison of two values gives one of Less, Equivalent, Greater or Unordered; the last happens for values such as a NaN that have no order relative to anything. The result is compared with a literal 0, the same way as the result of std::partial_ordering:
QPartialOrdering order = compare(a, b);
if (order < 0)
qDebug() << "a comes first";
else if (order == QPartialOrdering::Unordered)
qDebug() << "a and b cannot be compared";
Every comparison against 0 is false for Unordered, except !=.
Differences from Qt
There are no conversions to and from std::partial_ordering, because Nt is built as C++17 and that type is C++20. The Qt::partial_ordering, Qt::weak_ordering and Qt::strong_ordering classes are not provided.
Member Variable Documentation
const QPartialOrdering QPartialOrdering::Equivalent
The operands are equivalent.
const QPartialOrdering QPartialOrdering::Greater
The left operand is ordered after the right one.
const QPartialOrdering QPartialOrdering::Less
The left operand is ordered before the right one.
const QPartialOrdering QPartialOrdering::Unordered
The operands have no order relative to each other.