이 페이지에서

QPartialOrdering Class

QPartialOrdering은 순서가 정해지지 않은 결과를 허용하는 비교 결과를 나타냅니다. 더 보기...

헤더: #include <QPartialOrdering>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
다음부터: Qt 6.0부터

공개 함수

QPartialOrdering(std::partial_ordering stdorder)
operator std::partial_ordering() const

정적 공용 멤버

const QPartialOrdering Equivalent
const QPartialOrdering Greater
const QPartialOrdering Less
const QPartialOrdering Unordered
const QPartialOrdering equivalent
const QPartialOrdering greater
const QPartialOrdering less
const QPartialOrdering unordered
(since 6.7) bool is_eq(QPartialOrdering o)
(since 6.7) bool is_gt(QPartialOrdering o)
(since 6.7) bool is_gteq(QPartialOrdering o)
(since 6.7) bool is_lt(QPartialOrdering o)
(since 6.7) bool is_lteq(QPartialOrdering o)
(since 6.7) bool is_neq(QPartialOrdering o)
bool operator!=(QPartialOrdering lhs, QPartialOrdering rhs)
bool operator==(QPartialOrdering lhs, QPartialOrdering rhs)

상세 설명

QPartialOrdering 유형의 값은 일반적으로 3자 비교 함수에서 반환됩니다. 이러한 함수는 두 객체를 비교하여, 두 객체 간에 순서가 있는지 여부와, 만약 있다면 그 순서를 결정합니다. 이 반환 유형은 순서가 부분적임을 나타내기 위해 사용되며, 즉 모든 값 쌍에 대해 순서가 정해지는 것은 아닙니다.

QPartialOrdering에는 다음 기호 상수로 표현되는 네 가지 값이 있습니다:

  • less 는 왼쪽 피연산자가 오른쪽 피연산자보다 작음을 나타냅니다;
  • equivalent 두 피연산자가 동등함을 나타냅니다;
  • greater 왼쪽 피연산자가 오른쪽 피연산자보다 크다는 것을 나타냅니다;
  • unordered 두 피연산자 사이에 순서가 없음을 나타냅니다.

QPartialOrdering은 관례적으로 인스턴스를 리터럴 0과 비교하는 방식으로 사용되며, 예를 들면 다음과 같습니다:

// 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
}

QPartialOrdering::unordered 를 리터럴 0과 비교하면 항상 false 결과를 반환합니다.

Qt::strong_ordering, Qt::weak_ordering 및 비교 유형 개요도참조하십시오 .

멤버 함수 문서

[constexpr noexcept] QPartialOrdering::QPartialOrdering(std::partial_ordering stdorder)

stdorder 를 사용하여 다음 규칙에 따라 QPartialOrdering 객체를 생성합니다.

  • std::partial_ordering::less는 less 로 변환됩니다.
  • std::partial_ordering::equivalent는 equivalent 로 변환됩니다.
  • std::partial_ordering::greater는 greater 로 변환됩니다.
  • std::partial_ordering::unordered는 다음으로 변환됩니다: unordered

[constexpr noexcept] QPartialOrdering::operator std::partial_ordering() const

다음 규칙을 사용하여 이 QPartialOrdering 값을 std::partial_ordering 객체로 변환합니다:

  • less std::partial_ordering::less로 변환됩니다.
  • equivalent std::partial_ordering::equivalent로 변환합니다.
  • greater std::partial_ordering::greater로 변환합니다.
  • unordered std::partial_ordering::unordered로 변환합니다.

멤버 변수 설명

const QPartialOrdering QPartialOrdering::Equivalent

두 피연산자가 서로 같을 때의 비교 결과를 나타냅니다.

const QPartialOrdering QPartialOrdering::Greater

왼쪽 피연산자가 오른쪽 피연산자보다 큰 비교의 결과를 나타냅니다.

const QPartialOrdering QPartialOrdering::Less

왼쪽 피연산자가 오른쪽 피연산자보다 작을 때의 비교 결과를 나타냅니다.

const QPartialOrdering QPartialOrdering::Unordered

두 피연산자 사이에 순서 관계가 없는 비교 결과를 나타냅니다.

const QPartialOrdering QPartialOrdering::equivalent

두 피연산자가 서로 같을 때의 비교 결과를 나타냅니다.

const QPartialOrdering QPartialOrdering::greater

왼쪽 피연산자가 오른쪽 피연산자보다 큰 비교 결과를 나타냅니다.

const QPartialOrdering QPartialOrdering::less

왼쪽 피연산자가 오른쪽 피연산자보다 작을 때의 비교 결과를 나타냅니다.

const QPartialOrdering QPartialOrdering::unordered

두 피연산자 사이에 순서 관계가 없는 비교 결과를 나타냅니다.

관련 비회원

[constexpr noexcept, since 6.7] bool is_eq(QPartialOrdering o)

[constexpr noexcept, since 6.7] bool is_gt(QPartialOrdering o)

[constexpr noexcept, since 6.7] bool is_gteq(QPartialOrdering o)

[constexpr noexcept, since 6.7] bool is_lt(QPartialOrdering o)

[constexpr noexcept, since 6.7] bool is_lteq(QPartialOrdering o)

[constexpr noexcept, since 6.7] bool is_neq(QPartialOrdering o)

o 를 다음 여섯 가지 관계 연산자 중 하나의 결과로 변환합니다:

함수연산
is_eqo == 0
is_neqo != 0
is_lto < 0
is_lteqo <= 0
is_gto > 0
is_gteqo >= 0

이 함수들은 ` std::partial_ordering`과의 호환성을 위해 제공됩니다.

이 함수들은 Qt 6.7에서 도입되었습니다.

[constexpr noexcept] bool operator!=(QPartialOrdering lhs, QPartialOrdering rhs)

lhs 와 rhs 가 서로 다른 결과를 나타내는 경우 true를 반환하고, 그렇지 않은 경우 true를 반환합니다.

[constexpr noexcept] bool operator==(QPartialOrdering lhs, QPartialOrdering rhs)

lhs 와 rhs 가 동일한 결과를 나타내는 경우 true를 반환하고, 그렇지 않은 경우 false를 반환합니다.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.