QJsonObject::const_iterator Class
class QJsonObject::const_iteratorQJsonObject::const_iterator 클래스는 ` QJsonObject`에 대한 STL 스타일의 const 이터레이터를 제공합니다. 더 보기...
- 상속된 멤버를 포함한 모든 멤버 목록
- const_iterator는 Qt의 JSON 지원 기능의 일부입니다.
QJsonObject::const_iterator 비교
| 범주 | 비교 가능한 유형 |
|---|---|
| strong | QJsonObject::const_iterator |
| strong | QJsonObject::iterator. |
공개 유형
공개 함수
| const_iterator() | |
| const_iterator(const QJsonObject::iterator &other) | |
| const_iterator(const QJsonObject::const_iterator &other) | |
| QString | key() const |
(since 6.10) QAnyStringView | keyView() const |
| QJsonValueConstRef | value() const |
| const QJsonValueConstRef | operator*() const |
| QJsonObject::const_iterator | operator+(qsizetype j) const |
| QJsonObject::const_iterator & | operator++() |
| QJsonObject::const_iterator | operator++(int) |
| QJsonObject::const_iterator & | operator+=(qsizetype j) |
| qsizetype | operator-(QJsonObject::const_iterator other) const |
| QJsonObject::const_iterator | operator-(qsizetype j) const |
| QJsonObject::const_iterator & | operator--() |
| QJsonObject::const_iterator | operator--(int) |
| QJsonObject::const_iterator & | operator-=(qsizetype j) |
| const QJsonValueConstRef * | operator->() const |
| QJsonValueConstRef | operator[](qsizetype j) const |
관련 비회원 요소
| bool | operator!=(const QJsonObject::const_iterator &lhs, const QJsonObject::const_iterator &rhs) |
| bool | operator<(const QJsonObject::const_iterator &lhs, const QJsonObject::const_iterator &rhs) |
| bool | operator<=(const QJsonObject::const_iterator &lhs, const QJsonObject::const_iterator &rhs) |
| bool | operator==(const QJsonObject::const_iterator &lhs, const QJsonObject::const_iterator &rhs) |
| bool | operator>(const QJsonObject::const_iterator &lhs, const QJsonObject::const_iterator &rhs) |
| bool | operator>=(const QJsonObject::const_iterator &lhs, const QJsonObject::const_iterator &rhs) |
상세 설명
QJsonObject::const_iterator QJsonObject 를 반복 처리할 수 있게 해줍니다. 반복 처리하는 동안 를 수정하려면 대신 를 사용해야 합니다. 일반적으로 이터레이터를 통해 를 변경할 필요가 없는 한, 비const 에 대해서도 를 사용하는 것이 권장됩니다. const 이터레이터는 속도가 약간 더 빠르며 코드의 가독성을 높여줍니다. QJsonObject QJsonObject::iterator QJsonObject QJsonObject QJsonObject::const_iterator
QJsonObject::const_iterator 의 기본 생성자는 초기화되지 않은 이터레이터를 생성합니다. 반복 처리를 시작하기 전에 QJsonObject::constBegin(), QJsonObject::constEnd() 또는 QJsonObject::find()과 같은 QJsonObject 함수를 사용하여 이터레이터를 초기화해야 합니다.
동일한 객체에 여러 개의 이터레이터를 사용할 수 있습니다. 단, 객체가 수정될 경우 기존 이터레이터는 더 이상 유효하지 않게 됩니다.
QJsonObject::iterator, Qt의 JSON 지원, 게임 저장 및 불러오기도참조하십시오 .
멤버 유형 문서
const_iterator::iterator_category
이 이터레이터가 랜덤 액세스 이터레이터임을 나타내는 std::random_access_iterator_tag의 동의어입니다.
참고: Qt 5.6 이전버전에서는 이 값이 실수로 std::bidirectional_iterator_tag로 설정되어 있었습니다.
멤버 함수 문서
const_iterator::const_iterator()
초기화되지 않은 이터레이터를 생성합니다.
key(), value() 및 operator++()와 같은 함수는 초기화되지 않은 이터레이터에 대해 호출해서는 안 됩니다. 이터레이터를 사용하기 전에 operator=()를 사용하여 값을 할당하십시오.
QJsonObject::constBegin() 및 QJsonObject::constEnd()도 참조하십시오 .
const_iterator::const_iterator(const QJsonObject::iterator &other)
other 의 복사본을 생성합니다.
[constexpr noexcept default] const_iterator::const_iterator(const QJsonObject::const_iterator &other)
const_iterator 의 인스턴스를 복사 생성합니다.
QString const_iterator::key() const
현재 항목의 키를 반환합니다.
[since 6.10] QAnyStringView const_iterator::keyView() const
현재 항목의 키를 ` QAnyStringView` 형식으로 반환합니다. 이 함수는 메모리를 할당하지 않습니다.
QJsonObject 는 키를 US-ASCII, UTF-8 또는 UTF-16으로 저장하므로, 반환된 ` QAnyStringView `는 이 중 어떤 인코딩으로도 되어 있을 수 있습니다.
이 함수는 Qt 6.10에서 도입되었습니다.
QJsonValueConstRef const_iterator::value() const
현재 항목의 값을 반환합니다.
key(), keyView(), operator*()도 참조하십시오 .
const QJsonValueConstRef const_iterator::operator*() const
현재 항목의 값을 반환합니다.
value()와 동일합니다.
QJsonObject::const_iterator const_iterator::operator+(qsizetype j) const
이 이터레이터로부터 앞으로 j 위치에 있는 항목으로 이동하는 이터레이터를 반환합니다. j 가 음수인 경우, 이터레이터는 뒤로 이동합니다.
j 값이 크면 이 연산의 수행 속도가 느려질 수 있습니다.
operator-()도 참조하십시오 .
QJsonObject::const_iterator &const_iterator::operator++()
++ 연산자( ++i)는 이터레이터를 객체 내의 다음 항목으로 이동시키고, 새로운 현재 항목에 대한 이터레이터를 반환합니다.
QJsonObject::end()에서 이 함수를 호출하면 정의되지 않은 결과가 발생합니다.
operator--()도 참조하십시오 .
QJsonObject::const_iterator const_iterator::operator++(int)
후치 연산자 ` ++ `( i++)는 이터레이터를 객체의 다음 항목으로 이동시키고, 이전에 현재 항목이었던 항목에 대한 이터레이터를 반환합니다.
이는 오버로드된 함수입니다.
QJsonObject::const_iterator &const_iterator::operator+=(qsizetype j)
이테레이터를 j 개 항목만큼 앞으로 이동시킵니다. j 가 음수인 경우, 이테레이터는 뒤로 이동합니다.
j 값이 클 경우 이 연산의 수행 속도가 느려질 수 있습니다.
operator-=() 및 operator+()도 참조하십시오 .
qsizetype const_iterator::operator-(QJsonObject::const_iterator other) const
other 가 가리키는 항목과 이 반복자가 가리키는 항목 사이에 있는 항목의 개수를 반환합니다.
QJsonObject::const_iterator const_iterator::operator-(qsizetype j) const
이 이터레이터에서 뒤쪽으로 j 위치에 있는 항목에 대한 이터레이터를 반환합니다. j 가 음수인 경우, 이터레이터는 앞으로 이동합니다.
j 값이 크면 이 연산의 수행 속도가 느려질 수 있습니다.
operator+()도 참조하십시오 .
QJsonObject::const_iterator &const_iterator::operator--()
-- 연산자( --i)는 앞의 항목을 현재 항목으로 설정하고, 새로운 현재 항목을 가리키는 반복자를 반환합니다.
QJsonObject::begin()에 대해 이 함수를 호출하면 정의되지 않은 결과가 발생합니다.
operator++()도 참조하십시오 .
QJsonObject::const_iterator const_iterator::operator--(int)
후치 연산자 ` -- `( i--)는 바로 앞의 항목을 현재 항목으로 지정하고, 이전에 현재 항목이었던 항목을 가리키는 이터레이터를 반환합니다.
이는 오버로드된 함수입니다.
QJsonObject::const_iterator &const_iterator::operator-=(qsizetype j)
이테레이터를 j 개 항목만큼 뒤로 이동시킵니다. j 가 음수인 경우, 이테레이터는 앞으로 이동합니다.
j 값이 클 경우 이 연산의 수행 속도가 느려질 수 있습니다.
operator+=() 및 operator-()도 참조하십시오 .
const QJsonValueConstRef *const_iterator::operator->() const
현재 항목에 대한 포인터를 반환합니다.
QJsonValueConstRef const_iterator::operator[](qsizetype j) const
이 이터레이터가 가리키는 항목(위치 *this + j 에 있는 항목)에서 오프셋 j 에 있는 항목을 반환합니다.
이 함수는 QJsonObject 이터레이터가 C++ 포인터처럼 동작하도록 하기 위해 제공됩니다.
operator+()도 참조하십시오 .
관련 비멤버 함수
[noexcept] bool operator!=(const QJsonObject::const_iterator &lhs, const QJsonObject::const_iterator &rhs)
lhs 가 rhs 이터레이터와 다른 항목을 가리키는 경우 true 를 반환하고, 그렇지 않은 경우 false 를 반환합니다.
operator==()도 참조하십시오 .
[noexcept] bool operator<(const QJsonObject::const_iterator &lhs, const QJsonObject::const_iterator &rhs)
lhs 이터레이터가 가리키는 항목이 rhs 이터레이터가 가리키는 항목보다 작을 경우, true 를 반환합니다.
[noexcept] bool operator<=(const QJsonObject::const_iterator &lhs, const QJsonObject::const_iterator &rhs)
lhs 이터레이터가 가리키는 항목이 rhs 이터레이터가 가리키는 항목보다 작거나 같을 경우, ` true `를 반환합니다.
[noexcept] bool operator==(const QJsonObject::const_iterator &lhs, const QJsonObject::const_iterator &rhs)
lhs 가 rhs 이터터와 동일한 항목을 가리키는 경우 true 를 반환하고, 그렇지 않은 경우 false 를 반환합니다.
operator!=()도 참조하십시오 .
[noexcept] bool operator>(const QJsonObject::const_iterator &lhs, const QJsonObject::const_iterator &rhs)
lhs 이터레이터가 가리키는 항목이 rhs 이터레이터가 가리키는 항목보다 크면 true 를 반환합니다.
[noexcept] bool operator>=(const QJsonObject::const_iterator &lhs, const QJsonObject::const_iterator &rhs)
lhs 이터레이터가 가리키는 항목이 rhs 이터레이터가 가리키는 항목보다 크거나 같을 경우, ` true `을 반환합니다.
© 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.