QXmlStreamAttributes Class

QXmlStreamAttributes 클래스는 QXmlStreamAttribute...의 벡터를 나타냅니다.. ..

헤더: #include <QXmlStreamAttributes>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
상속합니다: QList

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

공용 함수

QXmlStreamAttributes()
void append(const QString &namespaceUri, const QString &name, const QString &value)
void append(const QString &qualifiedName, const QString &value)
bool hasAttribute(QAnyStringView qualifiedName) const
bool hasAttribute(QAnyStringView namespaceUri, QAnyStringView name) const
QStringView value(QAnyStringView namespaceUri, QAnyStringView name) const
QStringView value(QAnyStringView qualifiedName) const

상세 설명

속성은 독자가 start element 를 보고할 때 attributes()의 QXmlStreamReader 에 의해 반환됩니다. 이 클래스는 QXmlStreamWriterwriteAttributes()의 인수로 사용할 수도 있습니다.

편의 함수 value()는 벡터를 반복하여 주어진 네임스페이스Uri와 속성 이름에 대한 속성 값을 반환합니다.

append()를 사용하여 새 속성을 추가할 수 있습니다.

멤버 함수 문서

QXmlStreamAttributes::QXmlStreamAttributes()

QXmlStreamAttributes의 생성자입니다.

void QXmlStreamAttributes::append(const QString &namespaceUri, const QString &name, const QString &value)

namespaceUri 으로 설명된 네임스페이스에 name 으로 새 속성을 추가하고 값 value 을 추가합니다. namespaceUri 은 비워둘 수 있습니다.

void QXmlStreamAttributes::append(const QString &qualifiedName, const QString &value)

이것은 오버로드된 함수입니다.

정규화된 이름 qualifiedName 및 값 value 을 사용하여 새 속성을 추가합니다.

bool QXmlStreamAttributes::hasAttribute(QAnyStringView qualifiedName) const

QXmlStreamAttributes 에 정규화된 이름이 qualifiedName 인 속성이 있는 경우 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

이 함수는 네임스페이스를 인식하지 못한다는 점에 유의하세요. 예를 들어 QXmlStreamAttributes 에 어휘 이름이 "xlink:href"인 속성이 포함되어 있는 경우 xlink 접두사는 모든 네임스페이스에 바인딩될 수 있으므로 XLink 네임스페이스에 href 이라는 속성이 있다는 것을 알 수 없습니다. 네임스페이스 인식 코드의 경우 네임스페이스 URI와 로컬 이름을 매개변수로 사용하는 오버로드를 사용하세요.

bool QXmlStreamAttributes::hasAttribute(QAnyStringView namespaceUri, QAnyStringView name) const

이 함수는 오버로드된 함수입니다.

QXmlStreamAttributes 에 네임스페이스 URI와 이름이 namespaceUriname 에 해당하는 속성이 있는 경우 true 를 반환하고, 그렇지 않으면 false 를 반환합니다.

[noexcept] QStringView QXmlStreamAttributes::value(QAnyStringView namespaceUri, QAnyStringView name) const

namespaceUri 으로 설명된 네임스페이스에서 name 속성의 값을 반환하거나 속성이 정의되지 않은 경우 빈 문자열 참조를 반환합니다. namespaceUri 은 비어 있을 수 있습니다.

참고: 6.6 이전 Qt 버전에서 이 함수는 QStringQLatin1StringView 의 조합만 허용하는 오버로드 집합으로 구현되었습니다.

[noexcept] QStringView QXmlStreamAttributes::value(QAnyStringView qualifiedName) const

이 함수는 오버로드된 함수입니다.

한정된 이름의 속성 값 qualifiedName 을 반환하거나 속성이 정의되지 않은 경우 빈 문자열 참조를 반환합니다. 정규화된 이름은 XML 데이터에 있는 속성의 원시 이름입니다. 네임스페이스 접두사, 콜론, 속성의 로컬 이름으로 구성됩니다. 네임스페이스 접두사는 고유하지 않으므로(동일한 접두사가 다른 네임스페이스를 가리킬 수 있고 다른 접두사가 동일한 네임스페이스를 가리킬 수 있음) 한정된 이름을 사용하지 말고 확인된 네임스페이스Uri와 속성의 로컬 이름을 사용해야 합니다.

참고: 6.6 이전 Qt 버전에서는 이 함수가 QStringQLatin1StringView 만 허용하는 오버로드 집합으로 구현되었습니다.

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