Nesta página

QMetaClassInfo Class

A classe QMetaClassInfo fornece informações adicionais sobre uma classe. Mais...

Cabeçalho: #include <QMetaClassInfo>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core

Funções públicas

const char *name() const
const char *value() const

Descrição detalhada

Os itens de informação da classe são simples paresnome-valor especificados por meio de ` Q_CLASSINFO()` no código-fonte. As informações podem ser recuperadas usando ` name()` e ` value()`. Por exemplo:

class MyClass : public QObject
{
    Q_OBJECT
    Q_CLASSINFO("author", "Sabrina Schweinsteiger")
    Q_CLASSINFO("url", "http://doc.moosesoft.co.uk/1.0/")

public:
    //...
};

Esse mecanismo pode ser usado livremente em suas aplicações Qt.

Observação: ele também é usado pelo Active Qt, Qt D-Bus, Qt Qmle Qt Remote Objects . Algumas chaves podem ser definidas ao usar esses módulos.

Veja também QMetaObject.

Documentação das funções de membro

const char *QMetaClassInfo::name() const

Retorna o nome deste item.

Veja também value().

const char *QMetaClassInfo::value() const

Retorna o valor deste item.

Veja também name().

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