QXmlAttributes Class

QXmlAttributes 클래스는 XML 속성을 제공합니다. 더 보기...

Header: #include <QXmlAttributes>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core5Compat)
target_link_libraries(mytarget PRIVATE Qt6::Core5Compat)
qmake: QT += core5compat

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

공용 함수

QXmlAttributes()
virtual ~QXmlAttributes()
void append(const QString &qName, const QString &uri, const QString &localPart, const QString &value)
void clear()
int count() const
int index(const QString &qName) const
int index(QLatin1String qName) const
int index(const QString &uri, const QString &localPart) const
int length() const
QString localName(int index) const
QString qName(int index) const
void swap(QXmlAttributes &other)
QString type(int index) const
QString type(const QString &qName) const
QString type(const QString &uri, const QString &localName) const
QString uri(int index) const
QString value(int index) const
QString value(QLatin1String qName) const
QString value(const QString &qName) const
QString value(const QString &uri, const QString &localName) const

상세 설명

속성이 QXmlContentHandler::startElement()로 보고되는 경우 이 클래스는 속성 값을 전달하는 데 사용됩니다.

목록에서 속성의 위치를 찾으려면 index(), 속성 개수를 검색하려면 count(), 속성을 제거하려면 clear()를 사용합니다. append ()를 사용하여 새 속성을 추가할 수 있습니다. 속성의 유형을 가져오려면 type(), 값을 가져오려면 value()을 사용합니다. 속성의 이름은 localName() 또는 qName()에서, 네임스페이스 URI는 uri()에서 사용할 수 있습니다.

멤버 함수 문서

QXmlAttributes::QXmlAttributes()

빈 속성 목록을 작성합니다.

[virtual noexcept] QXmlAttributes::~QXmlAttributes()

속성 객체를 삭제합니다.

void QXmlAttributes::append(const QString &qName, const QString &uri, const QString &localPart, const QString &value)

새 속성 항목을 속성 목록에 추가합니다. 속성의 정규화된 이름은 qName, 네임스페이스 URI는 uri, 로컬 이름은 localPart 입니다. 속성 값은 value 입니다.

qName(), uri(), localName() 및 value()도 참조하세요 .

void QXmlAttributes::clear()

속성 목록을 지웁니다.

append()도 참조하세요 .

int QXmlAttributes::count() const

목록에 있는 속성 수를 반환합니다. 이 함수는 length()와 동일합니다.

int QXmlAttributes::index(const QString &qName) const

한정된 이름으로 속성의 인덱스를 조회합니다 qName.

속성의 인덱스를 반환하거나 찾을 수 없는 경우 -1을 반환합니다.

int QXmlAttributes::index(QLatin1String qName) const

과부하가 걸린 기능입니다.

int QXmlAttributes::index(const QString &uri, const QString &localPart) const

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

네임스페이스 이름으로 속성의 인덱스를 조회합니다.

uri 는 네임스페이스 URI를 지정하거나 이름에 네임스페이스 URI가 없는 경우 빈 문자열을 지정합니다. localPart 는 속성의 로컬 이름을 지정합니다.

속성의 인덱스를 반환하거나, 찾을 수 없는 경우 -1을 반환합니다.

int QXmlAttributes::length() const

목록에 있는 속성 수를 반환합니다.

count()도 참조하세요 .

QString QXmlAttributes::localName(int index) const

위치 index 에서 속성의 로컬 이름을 조회합니다. 네임스페이스 처리가 수행되지 않으면 로컬 이름은 빈 문자열이 됩니다.

QString QXmlAttributes::qName(int index) const

위치 index 에서 속성의 XML 1.0 정규화된 이름을 조회합니다.

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

thisother 로 바꿉니다.

QString QXmlAttributes::type(int index) const

위치 index 에 있는 속성의 유형을 조회합니다.

현재는 "CDATA"만 반환됩니다.

QString QXmlAttributes::type(const QString &qName) const

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

한정된 이름 qName 에 대한 속성 유형을 조회합니다.

현재는 "CDATA"만 반환됩니다.

QString QXmlAttributes::type(const QString &uri, const QString &localName) const

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

네임스페이스 이름으로 어트리뷰트의 유형을 조회합니다.

uri 는 네임스페이스 URI를 지정하고 localName 는 로컬 이름을 지정합니다. 이름에 네임스페이스 URI가 없는 경우 uri 에 빈 문자열을 사용합니다.

현재는 "CDATA"만 반환됩니다.

QString QXmlAttributes::uri(int index) const

위치 index 에 있는 속성에 대한 속성의 네임스페이스 URI를 조회합니다. 네임스페이스 처리가 수행되지 않거나 속성에 네임스페이스가 없는 경우 네임스페이스 URI는 빈 문자열입니다.

QString QXmlAttributes::value(int index) const

위치 index 에 있는 속성의 값을 반환합니다. 인덱스는 유효한 위치여야 합니다(즉, 0 <= index < count()).

QString QXmlAttributes::value(QLatin1String qName) const

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

한정된 이름 qName 에 대한 속성 값을 반환하거나 주어진 이름에 대한 속성이 없는 경우 빈 문자열을 반환합니다.

QString QXmlAttributes::value(const QString &qName) const

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

한정된 이름 qName 에 대한 속성 값을 반환하거나 주어진 이름에 대한 속성이 없는 경우 빈 문자열을 반환합니다.

QString QXmlAttributes::value(const QString &uri, const QString &localName) const

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

네임스페이스 이름으로 속성 값을 반환합니다.

uri 는 네임스페이스 URI를 지정하거나 이름에 네임스페이스 URI가 없는 경우 빈 문자열을 지정합니다. localName 는 속성의 로컬 이름을 지정합니다.

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