이 페이지에서

QCollatorSortKey Class

QCollatorSortKey 클래스를 사용하면 문자열 정렬 속도를 높일 수 있습니다. 더 보기...

헤더: #include <QCollatorSortKey>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core

참고: 이 클래스의 모든 함수는 재진입 가능합니다.

QCollatorSortKey 비교

범주비교 가능한 유형
weakQCollatorSortKey

공개 함수

QCollatorSortKey()
QCollatorSortKey(const QCollatorSortKey &other)
(since 6.8) QCollatorSortKey(QCollatorSortKey &&other)
~QCollatorSortKey()
int compare(const QCollatorSortKey &otherKey) const
void swap(QCollatorSortKey &other)
QCollatorSortKey &operator=(QCollatorSortKey &&other)
QCollatorSortKey &operator=(const QCollatorSortKey &other)
(since 6.12) bool operator!=(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
(since 6.12) bool operator<(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
(since 6.12) bool operator<=(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
(since 6.12) bool operator==(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
(since 6.12) bool operator>(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
(since 6.12) bool operator>=(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)

상세 설명

QCollatorSortKey 클래스는 항상 QCollator::sortKey()에 의해 생성되며, 예를 들어 많은 문자열을 정렬할 때와 같이 빠른 문자열 정렬에 사용됩니다.

QCollator, QCollator::sortKey() 및 compare()도 참조하십시오 .

멤버 함수 설명

[delete] QCollatorSortKey::QCollatorSortKey()

QCollatorSortKey 의 인스턴스를 기본 생성합니다. 이 함수는 삭제되었습니다.

QCollatorSortKey::QCollatorSortKey(const QCollatorSortKey &other)

other 정렬기의 키 사본을 생성합니다.

[constexpr noexcept default, since 6.8] QCollatorSortKey::QCollatorSortKey(QCollatorSortKey &&other)

other 에서 새로운 QCollatorSortKey를 생성합니다.

참고: 이동된대상인 ` other `는 부분적으로 형성된 상태가 되며, 이 상태에서는 소멸과 새 값 할당만이 유효한 연산입니다.

이 함수는 Qt 6.8에서 도입되었습니다.

[noexcept] QCollatorSortKey::~QCollatorSortKey()

정렬 키를 삭제합니다.

[noexcept] int QCollatorSortKey::compare(const QCollatorSortKey &otherKey) const

이 키를 otherKey 와 비교합니다. 이 키는 이 키와 동일한 QCollator 의 sortKey() 메서드에 의해 생성되었어야 합니다. 비교는 해당 QCollator 의 정렬 순서에 따라 수행됩니다.

이 키가 otherKey 보다 먼저 정렬되면 음수 값을, 두 키가 같으면 0을, 이 키가 otherKey 보다 나중에 정렬되면 양수 값을 반환합니다.

operator==(), operator!=(), operator<(), operator<=(), operator>(), operator>=()도 참조하십시오 .

[noexcept] void QCollatorSortKey::swap(QCollatorSortKey &other)

이 콜레이터 키를 other 와 교환합니다. 이 작업은 매우 빠르며 절대 실패하지 않습니다.

[noexcept] QCollatorSortKey &QCollatorSortKey::operator=(QCollatorSortKey &&other)

other 를 이 QCollatorSortKey 인스턴스에 이동 할당합니다.

참고: 이동된객체 other 는 부분적으로 형성된 상태로 전환되며, 이 상태에서는 소멸과 새 값 할당만이 유효한 연산입니다.

QCollatorSortKey &QCollatorSortKey::operator=(const QCollatorSortKey &other)

이 콜레이터 키에 ` other `를 할당합니다.

관련 비회원

[noexcept, since 6.12] bool operator!=(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)

[noexcept, since 6.12] bool operator<(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)

[noexcept, since 6.12] bool operator<=(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)

[noexcept, since 6.12] bool operator==(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)

[noexcept, since 6.12] bool operator>(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)

[noexcept, since 6.12] bool operator>=(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)

두 키 모두 동일한 ` QCollator`의 `sortKey()`에 의해 생성되었어야 합니다. 이를 생성한 ` QCollator `에 따라 ` lhs `과 ` rhs `을 비교합니다.

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

QCollatorSortKey::compare()도 참조하십시오 .

© 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.