이 페이지에서

QXmlAttributes Class

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

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

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

공개 함수

QXmlAttributes()
QXmlAttributes(const QXmlAttributes &)
QXmlAttributes(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
QXmlAttributes &operator=(QXmlAttributes &&)
QXmlAttributes &operator=(const QXmlAttributes &)

상세 설명

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

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

멤버 함수 문서

QXmlAttributes::QXmlAttributes()

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

[noexcept default] QXmlAttributes::QXmlAttributes(const QXmlAttributes &)

QXmlAttributes 의 인스턴스를 복사 생성합니다.

[noexcept default] QXmlAttributes::QXmlAttributes(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)

this 을 other 으로 바꿉니다.

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 는 속성의 로컬 이름을 지정합니다.

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

[noexcept default] QXmlAttributes &QXmlAttributes::operator=(QXmlAttributes &&)

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

[noexcept default] QXmlAttributes &QXmlAttributes::operator=(const QXmlAttributes &)

other 를 이 QXmlAttributes 인스턴스에 복사-할당합니다.

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