En esta página

QXmlStreamAttribute Class

La clase QXmlStreamAttribute representa un único atributo XML. Más información...

Encabezado: #include <QXmlStreamAttribute>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core

Nota: Todas las funciones de esta clase son reentrantes.

Comparaciones de QXmlStreamAttribute

CategoríaTipos comparables
igualdadQXmlStreamAttribute

Funciones públicas

QXmlStreamAttribute()
QXmlStreamAttribute(const QString &qualifiedName, const QString &value)
QXmlStreamAttribute(const QString &namespaceUri, const QString &name, const QString &value)
bool isDefault() const
QStringView name() const
QStringView namespaceUri() const
QStringView prefix() const
QStringView qualifiedName() const
QStringView value() const
bool operator!=(const QXmlStreamAttribute &lhs, const QXmlStreamAttribute &rhs)
bool operator==(const QXmlStreamAttribute &lhs, const QXmlStreamAttribute &rhs)

Descripción detallada

Un atributo consta de un atributo « namespaceUri » (opcionalmente vacío), un « name », un « value » y un « isDefault ».

El nombre del atributo XML sin procesar se devuelve como qualifiedName().

Documentación de la función miembro

QXmlStreamAttribute::QXmlStreamAttribute()

Crea un atributo vacío.

QXmlStreamAttribute::QXmlStreamAttribute(const QString &qualifiedName, const QString &value)

Crea un atributo con el nombre calificado qualifiedName y el valor value.

El atributo tendrá isDefault() == false.

QXmlStreamAttribute::QXmlStreamAttribute(const QString &namespaceUri, const QString &name, const QString &value)

Crea un atributo en el espacio de nombres descrito en namespaceUri con name y el valor value.

El atributo tendrá isDefault() == false.

bool QXmlStreamAttribute::isDefault() const

Devuelve « true » si el analizador ha añadido este atributo con un valor por defecto tras una declaración ATTLIST en la DTD; en caso contrario, devuelve « false ».

QStringView QXmlStreamAttribute::name() const

Devuelve el nombre local del atributo.

QStringView QXmlStreamAttribute::namespaceUri() const

Devuelve el `namespaceUri` resuelto del atributo, o una referencia a una cadena vacía si el atributo no tiene un espacio de nombres definido.

QStringView QXmlStreamAttribute::prefix() const

Devuelve el prefijo del espacio de nombres del atributo.

Véase también name() y qualifiedName().

QStringView QXmlStreamAttribute::qualifiedName() const

Devuelve el nombre calificado del atributo.

Un nombre calificado es el nombre sin formato de un atributo en los datos XML. Se compone del espacio de nombres prefix(), seguido de dos puntos, y a continuación del nombre local del atributo name(). Dado que el prefijo del espacio de nombres no es único (el mismo prefijo puede apuntar a diferentes espacios de nombres y diferentes prefijos pueden apuntar al mismo espacio de nombres), no debes utilizar qualifiedName(), sino el nombre resuelto namespaceUri() y el nombre local del atributo name().

QStringView QXmlStreamAttribute::value() const

Devuelve el valor del atributo.

Elementos no miembros relacionados

[noexcept] bool operator!=(const QXmlStreamAttribute &lhs, const QXmlStreamAttribute &rhs)

Compara el atributo « lhs » con « rhs » y devuelve « true » si no son iguales; en caso contrario, devuelve « false ».

[noexcept] bool operator==(const QXmlStreamAttribute &lhs, const QXmlStreamAttribute &rhs)

Compara el atributo « lhs » con « rhs » y devuelve « true » si son iguales; en caso contrario, devuelve « 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.