QMetaAssociation Class
QMetaAssociation 클래스는 연관 컨테이너에 대한 유형 지워진 액세스를 허용합니다. 더 보기...
| Header: | #include <QMetaAssociation> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core)target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| 이후: | Qt 6.0 |
| 상속합니다: | QMetaContainer |
이 클래스는 동등 비교가 가능합니다.
공용 형
(since 6.11) class | Iterable |
공용 함수
| bool | canContainsKey() const |
| bool | canCreateConstIteratorAtKey() const |
| bool | canCreateIteratorAtKey() const |
| bool | canGetKeyAtConstIterator() const |
| bool | canGetKeyAtIterator() const |
| bool | canGetMappedAtConstIterator() const |
| bool | canGetMappedAtIterator() const |
| bool | canGetMappedAtKey() const |
| bool | canInsertKey() const |
| bool | canRemoveKey() const |
| bool | canSetMappedAtIterator() const |
| bool | canSetMappedAtKey() const |
| bool | containsKey(const void *container, const void *key) const |
| void * | createConstIteratorAtKey(const void *container, const void *key) const |
| void * | createIteratorAtKey(void *container, const void *key) const |
| void | insertKey(void *container, const void *key) const |
| void | keyAtConstIterator(const void *iterator, void *key) const |
| void | keyAtIterator(const void *iterator, void *key) const |
| QMetaType | keyMetaType() const |
| void | mappedAtConstIterator(const void *iterator, void *mapped) const |
| void | mappedAtIterator(const void *iterator, void *mapped) const |
| void | mappedAtKey(const void *container, const void *key, void *mapped) const |
| QMetaType | mappedMetaType() const |
| void | removeKey(void *container, const void *key) const |
| void | setMappedAtIterator(const void *iterator, const void *mapped) const |
| void | setMappedAtKey(void *container, const void *key, const void *mapped) const |
정적 공용 멤버
(since 6.0) QMetaAssociation | fromContainer() |
관련 비회원
| bool | operator!=(const QMetaAssociation &lhs, const QMetaAssociation &rhs) |
| bool | operator==(const QMetaAssociation &lhs, const QMetaAssociation &rhs) |
상세 설명
이 클래스는 void*를 피연산자로 사용하는 여러 가지 원시 컨테이너 연산을 제공합니다. 이렇게 하면 변종에서 검색된 일반 컨테이너를 그 유형을 몰라도 조작할 수 있습니다.
QMetaAssociation은 QMap 또는 QHash 과 같이 매핑된 값이 있는 컨테이너와 QSet 과 같이 키만 보유하는 컨테이너를 모두 다룹니다.
다양한 메서드에 대한 void* 인수는 일반적으로 해당 컨테이너 또는 값 유형의 QVariant 를 사용하고 QVariant::data() 또는 QVariant::constData() 메서드를 호출하여 만듭니다. 그러나 컨테이너 또는 값 유형의 객체에 대한 일반 포인터를 전달할 수도 있습니다.
이터레이터 무효화는 기본 컨테이너에서 제공하는 규칙을 따르며 API에는 표현되어 있지 않습니다. 따라서 진정한 일반 컨테이너의 경우 모든 이터레이터는 쓰기 작업 후에 유효하지 않은 것으로 간주해야 합니다.
QMetaContainer, QMetaSequence, QIterable, QIterator 을참조하세요 .
멤버 함수 문서
bool QMetaAssociation::canContainsKey() const
containsKey()를 사용하여 컨테이너에서 키를 쿼리할 수 있으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.
bool QMetaAssociation::canCreateConstIteratorAtKey() const
createConstIteratorAtKey()을 사용하여 컨테이너의 항목을 가리키는 const 이터레이터를 생성할 수 있으면 true 을 반환하고, 그렇지 않으면 false를 반환합니다.
bool QMetaAssociation::canCreateIteratorAtKey() const
createIteratorAtKey()를 사용하여 컨테이너의 항목을 가리키는 반복자를 만들 수 있으면 true 을 반환하고, 그렇지 않으면 false를 반환합니다.
createIteratorAtKey()도 참조하세요 .
bool QMetaAssociation::canGetKeyAtConstIterator() const
keyAtConstIterator()을 사용하여 생성자 반복자에서 키를 검색할 수 있으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.
keyAtConstIterator()도 참조하세요 .
bool QMetaAssociation::canGetKeyAtIterator() const
keyAtIterator()를 사용하여 컨스트가 아닌 반복자에서 키를 검색할 수 있으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.
keyAtIterator()도 참조하세요 .
bool QMetaAssociation::canGetMappedAtConstIterator() const
mappedAtConstIterator()를 사용하여 생성자 이터레이터에서 매핑된 값을 검색할 수 있으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.
mappedAtConstIterator()도 참조하세요 .
bool QMetaAssociation::canGetMappedAtIterator() const
mappedAtIterator()를 사용하여 컨스트가 아닌 반복자에서 매핑된 값을 검색할 수 있으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.
mappedAtIterator()도 참조하세요 .
bool QMetaAssociation::canGetMappedAtKey() const
컨테이너에서 mappedAtKey()를 사용하여 값을 쿼리할 수 있으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.
bool QMetaAssociation::canInsertKey() const
insertKey()를 사용하여 컨테이너에 키를 추가할 수 있으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.
insertKey()도 참조하세요 .
bool QMetaAssociation::canRemoveKey() const
removeKey()을 사용하여 컨테이너에서 키를 제거할 수 있으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.
removeKey()도 참조하세요 .
bool QMetaAssociation::canSetMappedAtIterator() const
매핑된 값이 setMappedAtIterator()를 사용하여 컨스트가 아닌 반복자를 통해 설정할 수 있는 경우 true 를 반환하고, 그렇지 않으면 false 를 반환합니다.
setMappedAtIterator()도 참조하세요 .
bool QMetaAssociation::canSetMappedAtKey() const
setMappedAtKey()를 사용하여 컨테이너에서 매핑된 값을 수정할 수 있으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.
setMappedAtKey()도 참조하세요 .
bool QMetaAssociation::containsKey(const void *container, const void *key) const
container 에서 키를 쿼리할 수 있고 key 을 포함하면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.
canContainsKey()도 참조하세요 .
void *QMetaAssociation::createConstIteratorAtKey(const void *container, const void *key) const
가능하면 container 에서 key 의 엔트리를 가리키는 const 이터레이터를 반환합니다. 항목이 존재하지 않으면 container 의 끝을 가리키는 const 이터레이터를 만듭니다. const 이터레이터를 만들 수 없으면 nullptr 을 반환합니다.
const 이터레이터는 destroyConstIterator()를 사용하여 소멸시켜야 합니다.
canCreateConstIteratorAtKey(), constBegin(), constEnd() 및 destroyConstIterator()도 참조하세요 .
void *QMetaAssociation::createIteratorAtKey(void *container, const void *key) const
가능하면 container 에서 key 의 엔트리를 가리키는 non-const 이터레이터를 반환합니다. 항목이 존재하지 않으면 container 의 끝을 가리키는 비-const 이터레이터를 만듭니다. 비-const 이터레이터를 만들 수 없는 경우 nullptr 을 반환합니다.
비-const 이터레이터는 destroyIterator()를 사용하여 삭제해야 합니다.
canCreateIteratorAtKey(), begin(), end() 및 destroyIterator()도 참조하세요 .
[static constexpr, since 6.0] template <typename T> QMetaAssociation QMetaAssociation::fromContainer()
템플릿 파라미터로 지정된 유형에 해당하는 QMetaAssociation 을 반환합니다.
이 함수는 Qt 6.0에 도입되었습니다.
void QMetaAssociation::insertKey(void *container, const void *key) const
가능하면 container 에 key 을 삽입합니다. 컨테이너에 매핑된 값이 있는 경우 기본적으로 생성된 매핑된 값은 key 에 연결됩니다.
canInsertKey()도 참조하세요 .
void QMetaAssociation::keyAtConstIterator(const void *iterator, void *key) const
iterator const가 가리키는 키를 검색하여 가능하면 key 가 가리키는 메모리 위치에 저장합니다.
canGetKeyAtConstIterator(), constBegin(), constEnd() 및 createConstIteratorAtKey()도 참조하세요 .
void QMetaAssociation::keyAtIterator(const void *iterator, void *key) const
논컨스트 iterator 가 가리키는 키를 검색하여 가능하면 key 가 가리키는 메모리 위치에 저장합니다.
canGetKeyAtIterator(), begin(), end() 및 createIteratorAtKey()도 참조하세요 .
QMetaType QMetaAssociation::keyMetaType() const
컨테이너에 있는 키의 메타 타입을 반환합니다.
void QMetaAssociation::mappedAtConstIterator(const void *iterator, void *mapped) const
iterator 함수가 가리키는 매핑된 값을 검색하여 가능하면 mapped 함수가 가리키는 메모리 위치에 저장합니다.
canGetMappedAtConstIterator(), constBegin(), constEnd() 및 createConstIteratorAtKey()도 참조하세요 .
void QMetaAssociation::mappedAtIterator(const void *iterator, void *mapped) const
논컨스트 iterator 가 가리키는 매핑된 값을 검색하여 가능하면 mapped 가 가리키는 메모리 위치에 저장합니다.
setMappedAtIterator(), canGetMappedAtIterator(), begin(), end() 및 createIteratorAtKey()도 참조하세요 .
void QMetaAssociation::mappedAtKey(const void *container, const void *key, void *mapped) const
container 에서 key 과 연관된 매핑된 값을 검색하여 mapped 이 가리키는 메모리 위치에 배치합니다(가능한 경우).
setMappedAtKey() 및 canGetMappedAtKey()도 참조하세요 .
QMetaType QMetaAssociation::mappedMetaType() const
컨테이너에 매핑된 값의 메타 타입을 반환합니다.
void QMetaAssociation::removeKey(void *container, const void *key) const
가능하면 container 에서 key 및 관련 매핑된 값을 제거합니다.
canRemoveKey()도 참조하세요 .
void QMetaAssociation::setMappedAtIterator(const void *iterator, const void *mapped) const
가능하면 참조되지 않는 iterator 이 가리키는 컨테이너 위치에 mapped 값을 씁니다.
mappedAtIterator(), canSetMappedAtIterator(), begin(), end() 및 createIteratorAtKey()도 참조하세요 .
void QMetaAssociation::setMappedAtKey(void *container, const void *key, const void *mapped) const
가능한 경우 인자로 전달된 mapped 값을 사용하여 container 에서 key 와 관련된 값을 덮어씁니다.
mappedAtKey() 및 canSetMappedAtKey()도 참조하세요 .
관련 비회원
[noexcept] bool operator!=(const QMetaAssociation &lhs, const QMetaAssociation &rhs)
QMetaAssociation lhs 이 QMetaAssociation rhs 과 다른 컨테이너 유형을 나타내는 경우 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.
[noexcept] bool operator==(const QMetaAssociation &lhs, const QMetaAssociation &rhs)
QMetaAssociation lhs 이 QMetaAssociation 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.