QXmlStreamAttribute Class
A classe QXmlStreamAttribute representa um único atributo XML. Mais...
| Cabeçalho: | #include <QXmlStreamAttribute> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
- Lista de todos os membros, incluindo os herdados
- QXmlStreamAttribute faz parte das Classes XML.
Observação: Todas as funções desta classe são reentrantes.
Comparações de QXmlStreamAttribute
| Categoria | Tipos comparáveis |
|---|---|
| igualdade | QXmlStreamAttribute |
Funções 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 |
Elementos não-membros relacionados
| bool | operator!=(const QXmlStreamAttribute &lhs, const QXmlStreamAttribute &rhs) |
| bool | operator==(const QXmlStreamAttribute &lhs, const QXmlStreamAttribute &rhs) |
Descrição detalhada
Um atributo consiste em um atributo ` namespaceUri` (`()`) opcionalmente vazio, um ` name` (`()`), um ` value` (`()`) e um ` isDefault` (`()`).
O nome do atributo XML bruto é retornado como qualifiedName().
Documentação da função de membro
QXmlStreamAttribute::QXmlStreamAttribute()
Cria um atributo vazio.
QXmlStreamAttribute::QXmlStreamAttribute(const QString &qualifiedName, const QString &value)
Cria um atributo com o nome qualificado qualifiedName e o valor value.
O atributo terá isDefault() == false.
QXmlStreamAttribute::QXmlStreamAttribute(const QString &namespaceUri, const QString &name, const QString &value)
Cria um atributo no namespace descrito em namespaceUri, com name e valor value.
O atributo terá isDefault() == false.
bool QXmlStreamAttribute::isDefault() const
Retorna ` true ` se o analisador tiver adicionado esse atributo com um valor padrão após uma declaração `ATTLIST` na DTD; caso contrário, retorna ` false`.
QStringView QXmlStreamAttribute::name() const
Retorna o nome local do atributo.
QStringView QXmlStreamAttribute::namespaceUri() const
Retorna o namespaceUri resolvido do atributo ou uma referência a uma string vazia, caso o atributo não possua um namespace definido.
QStringView QXmlStreamAttribute::prefix() const
Retorna o prefixo do namespace do atributo.
Veja também name() e qualifiedName().
QStringView QXmlStreamAttribute::qualifiedName() const
Retorna o nome qualificado do atributo.
Um nome qualificado é o nome bruto de um atributo nos dados XML. Ele consiste no prefix() do namespace, seguido por dois pontos e, em seguida, pelo name() local do atributo. Como o prefixo do namespace não é único (o mesmo prefixo pode apontar para namespaces diferentes e prefixos diferentes podem apontar para o mesmo namespace), você não deve usar qualifiedName(), mas sim o nome resolvido namespaceUri() e o nome local do atributo name().
QStringView QXmlStreamAttribute::value() const
Retorna o valor do atributo.
Não-membros relacionados
[noexcept] bool operator!=(const QXmlStreamAttribute &lhs, const QXmlStreamAttribute &rhs)
Compara o atributo lhs com rhs e retorna true caso não sejam iguais; caso contrário, retorna false.
[noexcept] bool operator==(const QXmlStreamAttribute &lhs, const QXmlStreamAttribute &rhs)
Compara o atributo lhs com rhs e retorna true se forem iguais; caso contrário, retorna 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.