Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QPartialOrdering Class Reference

\variable Qt::partial_ordering::less More...

#include <qcompare.h>

+ Collaboration diagram for QPartialOrdering:

Public Member Functions

constexpr Q_IMPLICIT QPartialOrdering (Qt::partial_ordering order) noexcept
 
constexpr Q_IMPLICIT QPartialOrdering (Qt::weak_ordering stdorder) noexcept
 
constexpr Q_IMPLICIT QPartialOrdering (Qt::strong_ordering stdorder) noexcept
 
constexpr Q_IMPLICIT operator Qt::partial_ordering () const noexcept
 

Static Public Attributes

static const QPartialOrdering Less
 
static const QPartialOrdering Equivalent
 
static const QPartialOrdering Greater
 
static const QPartialOrdering Unordered
 
static const QPartialOrdering less
 
static const QPartialOrdering equivalent
 
static const QPartialOrdering greater
 
static const QPartialOrdering unordered
 

Friends

constexpr bool operator== (QPartialOrdering lhs, QtPrivate::CompareAgainstLiteralZero) noexcept
 
constexpr bool operator!= (QPartialOrdering lhs, QtPrivate::CompareAgainstLiteralZero) noexcept
 
constexpr bool operator< (QPartialOrdering lhs, QtPrivate::CompareAgainstLiteralZero) noexcept
 
constexpr bool operator<= (QPartialOrdering lhs, QtPrivate::CompareAgainstLiteralZero) noexcept
 
constexpr bool operator> (QPartialOrdering lhs, QtPrivate::CompareAgainstLiteralZero) noexcept
 
constexpr bool operator>= (QPartialOrdering lhs, QtPrivate::CompareAgainstLiteralZero) noexcept
 
constexpr bool operator== (QtPrivate::CompareAgainstLiteralZero, QPartialOrdering rhs) noexcept
 
constexpr bool operator!= (QtPrivate::CompareAgainstLiteralZero, QPartialOrdering rhs) noexcept
 
constexpr bool operator< (QtPrivate::CompareAgainstLiteralZero, QPartialOrdering rhs) noexcept
 
constexpr bool operator<= (QtPrivate::CompareAgainstLiteralZero, QPartialOrdering rhs) noexcept
 
constexpr bool operator> (QtPrivate::CompareAgainstLiteralZero, QPartialOrdering rhs) noexcept
 
constexpr bool operator>= (QtPrivate::CompareAgainstLiteralZero, QPartialOrdering rhs) noexcept
 
constexpr bool operator== (QPartialOrdering lhs, QPartialOrdering rhs) noexcept
 Return true if lhs and rhs represent the same result; otherwise, returns false.
 
constexpr bool operator!= (QPartialOrdering lhs, QPartialOrdering rhs) noexcept
 Return true if lhs and rhs represent different results; otherwise, returns true.
 
constexpr bool operator== (QPartialOrdering lhs, Qt::partial_ordering rhs) noexcept
 
constexpr bool operator!= (QPartialOrdering lhs, Qt::partial_ordering rhs) noexcept
 
constexpr bool operator== (Qt::partial_ordering lhs, QPartialOrdering rhs) noexcept
 
constexpr bool operator!= (Qt::partial_ordering lhs, QPartialOrdering rhs) noexcept
 
QT_WARNING_PUSH friend constexpr bool is_eq (QPartialOrdering o) noexcept
 
constexpr bool is_neq (QPartialOrdering o) noexcept
 
constexpr bool is_lt (QPartialOrdering o) noexcept
 
constexpr bool is_lteq (QPartialOrdering o) noexcept
 
constexpr bool is_gt (QPartialOrdering o) noexcept
 
constexpr bool is_gteq (QPartialOrdering o) noexcept
 

Related Symbols

(Note that these are not member symbols.)

bool operator== (QPartialOrdering lhs, QtPrivate::CompareAgainstLiteralZero)
 

Detailed Description

\variable Qt::partial_ordering::less

Represents the result of a comparison where the left operand is less than the right operand.

\variable Qt::partial_ordering::equivalent

Represents the result of a comparison where the two operands are equivalent.

\variable Qt::partial_ordering::greater

Represents the result of a comparison where the left operand is greater than the right operand.

\variable Qt::partial_ordering::unordered

Represents the result of a comparison where there is no ordering relationship between the two operands.

\inmodule QtCore

QPartialOrdering represents the result of a comparison that allows for unordered results.

See also
Qt::strong_ordering, Qt::weak_ordering, {Comparison types overview}
Since
6.0

A value of type QPartialOrdering is typically returned from a three-way comparison function. Such a function compares two objects, establishing whether they are ordered and, if so, their ordering. It uses this return type to indicate that the ordering is partial; that is, not all pairs of values are ordered.

QPartialOrdering has four values, represented by the following symbolic constants:

\list

  • \l less represents that the left operand is less than the right;
  • \l equivalent represents that the two operands are equivalent;
  • \l greater represents that the left operand is greater than the right;
  • \l unordered represents that the two operands are {not ordered}. \endlist

QPartialOrdering is idiomatically used by comparing an instance against a literal zero, for instance like this:

// given a, b, c, d as objects of some type that allows for a 3-way compare,
// and a compare function declared as follows:
QPartialOrdering compare(T lhs, T rhs); // defined out-of-line
~~~
QPartialOrdering result = compare(a, b);
if (result < 0) {
// a is less than b
}
if (compare(c, d) >= 0) {
// c is greater than or equal to d
}
\variable Qt::partial_ordering::less
Definition qcompare.h:679
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
const GLubyte * c
GLuint64EXT * result
[6]
static int compare(quint64 a, quint64 b)

Comparing QPartialOrdering::unordered against literal 0 always returns a false result.

Definition at line 678 of file qcompare.h.

Constructor & Destructor Documentation

◆ QPartialOrdering() [1/3]

constexpr Q_IMPLICIT QPartialOrdering::QPartialOrdering ( Qt::partial_ordering order)
inlineconstexprnoexcept

Definition at line 758 of file qcompare.h.

◆ QPartialOrdering() [2/3]

constexpr Q_IMPLICIT QPartialOrdering::QPartialOrdering ( Qt::weak_ordering stdorder)
inlineconstexprnoexcept

Definition at line 769 of file qcompare.h.

◆ QPartialOrdering() [3/3]

constexpr Q_IMPLICIT QPartialOrdering::QPartialOrdering ( Qt::strong_ordering stdorder)
inlineconstexprnoexcept

Definition at line 772 of file qcompare.h.

Member Function Documentation

◆ operator Qt::partial_ordering()

constexpr Q_IMPLICIT QPartialOrdering::operator Qt::partial_ordering ( ) const
inlineconstexprnoexcept

Definition at line 775 of file qcompare.h.

References qToUnderlying(), and R.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ is_eq

QPartialOrdering::is_eq ( QPartialOrdering o)
friend

Definition at line 863 of file qcompare.h.

◆ is_gt

QPartialOrdering::is_gt ( QPartialOrdering o)
friend

Definition at line 867 of file qcompare.h.

◆ is_gteq

QPartialOrdering::is_gteq ( QPartialOrdering o)
friend
Since
6.7
is_eq_table

These functions are provided for compatibility with {std::partial_ordering}.

Definition at line 868 of file qcompare.h.

◆ is_lt

QPartialOrdering::is_lt ( QPartialOrdering o)
friend

Definition at line 865 of file qcompare.h.

◆ is_lteq

QPartialOrdering::is_lteq ( QPartialOrdering o)
friend

Definition at line 866 of file qcompare.h.

◆ is_neq

QPartialOrdering::is_neq ( QPartialOrdering o)
friend

Definition at line 864 of file qcompare.h.

◆ operator!= [1/5]

bool QPartialOrdering::operator!= ( QPartialOrdering lhs,
QPartialOrdering rhs )
friend

Return true if lhs and rhs represent different results; otherwise, returns true.

Definition at line 755 of file qcompare.h.

◆ operator!= [2/5]

constexpr bool operator!= ( QPartialOrdering lhs,
Qt::partial_ordering rhs )
friend

Definition at line 797 of file qcompare.h.

◆ operator!= [3/5]

constexpr bool operator!= ( QPartialOrdering lhs,
QtPrivate::CompareAgainstLiteralZero  )
friend

Definition at line 695 of file qcompare.h.

◆ operator!= [4/5]

constexpr bool operator!= ( Qt::partial_ordering lhs,
QPartialOrdering rhs )
friend

Definition at line 803 of file qcompare.h.

◆ operator!= [5/5]

constexpr bool operator!= ( QtPrivate::CompareAgainstLiteralZero ,
QPartialOrdering rhs )
friend

Definition at line 720 of file qcompare.h.

◆ operator< [1/2]

constexpr bool operator< ( QPartialOrdering lhs,
QtPrivate::CompareAgainstLiteralZero  )
friend

Definition at line 699 of file qcompare.h.

◆ operator< [2/2]

constexpr bool operator< ( QtPrivate::CompareAgainstLiteralZero ,
QPartialOrdering rhs )
friend

Definition at line 724 of file qcompare.h.

◆ operator<= [1/2]

constexpr bool operator<= ( QPartialOrdering lhs,
QtPrivate::CompareAgainstLiteralZero  )
friend

Definition at line 703 of file qcompare.h.

◆ operator<= [2/2]

constexpr bool operator<= ( QtPrivate::CompareAgainstLiteralZero ,
QPartialOrdering rhs )
friend

Definition at line 728 of file qcompare.h.

◆ operator== [1/6]

bool QPartialOrdering::operator== ( QPartialOrdering lhs,
QPartialOrdering rhs )
friend

Return true if lhs and rhs represent the same result; otherwise, returns false.

Definition at line 752 of file qcompare.h.

◆ operator== [2/6]

constexpr bool operator== ( QPartialOrdering lhs,
Qt::partial_ordering rhs )
friend

Definition at line 794 of file qcompare.h.

◆ operator==() [3/6]

bool operator== ( QPartialOrdering lhs,
QtPrivate::CompareAgainstLiteralZero  )
related

◆ operator== [4/6]

bool operator== ( QPartialOrdering lhs,
QtPrivate::CompareAgainstLiteralZero  )
friend

Definition at line 691 of file qcompare.h.

◆ operator== [5/6]

constexpr bool operator== ( Qt::partial_ordering lhs,
QPartialOrdering rhs )
friend

Definition at line 800 of file qcompare.h.

◆ operator== [6/6]

constexpr bool operator== ( QtPrivate::CompareAgainstLiteralZero ,
QPartialOrdering rhs )
friend

Definition at line 716 of file qcompare.h.

◆ operator> [1/2]

constexpr bool operator> ( QPartialOrdering lhs,
QtPrivate::CompareAgainstLiteralZero  )
friend

Definition at line 707 of file qcompare.h.

◆ operator> [2/2]

constexpr bool operator> ( QtPrivate::CompareAgainstLiteralZero ,
QPartialOrdering rhs )
friend

Definition at line 732 of file qcompare.h.

◆ operator>= [1/2]

constexpr bool operator>= ( QPartialOrdering lhs,
QtPrivate::CompareAgainstLiteralZero  )
friend

Definition at line 711 of file qcompare.h.

◆ operator>= [2/2]

constexpr bool operator>= ( QtPrivate::CompareAgainstLiteralZero ,
QPartialOrdering rhs )
friend

Definition at line 736 of file qcompare.h.

Member Data Documentation

◆ Equivalent

constexpr QPartialOrdering QPartialOrdering::Equivalent
inlinestaticconstexpr

◆ equivalent

constexpr QPartialOrdering QPartialOrdering::equivalent
inlinestaticconstexpr

Definition at line 687 of file qcompare.h.

◆ Greater

constexpr QPartialOrdering QPartialOrdering::Greater
inlinestaticconstexpr

Definition at line 683 of file qcompare.h.

Referenced by QMetaType::compare(), spaceShip(), threeWayCompare(), and QTest::toString().

◆ greater

constexpr QPartialOrdering QPartialOrdering::greater
inlinestaticconstexpr

Definition at line 688 of file qcompare.h.

◆ Less

constexpr QPartialOrdering QPartialOrdering::Less
inlinestaticconstexpr

Definition at line 681 of file qcompare.h.

Referenced by QMetaType::compare(), spaceShip(), threeWayCompare(), and QTest::toString().

◆ less

constexpr QPartialOrdering QPartialOrdering::less
inlinestaticconstexpr

Definition at line 686 of file qcompare.h.

◆ Unordered

constexpr QPartialOrdering QPartialOrdering::Unordered
inlinestaticconstexpr

◆ unordered

constexpr QPartialOrdering QPartialOrdering::unordered
inlinestaticconstexpr

Definition at line 689 of file qcompare.h.


The documentation for this class was generated from the following files: