En esta página

QQmlSA::GenericPass Class

class QQmlSA::GenericPass

La clase base para las pruebas de análisis estático. Más información...

Encabezado: #include <qqmlsa.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS QmlCompiler)
target_link_libraries(mytarget PRIVATE Qt6::QmlCompiler)
Heredado por:

QQmlSA::ElementPass y QQmlSA::PropertyPass

Estado: Vista previa tecnológica

Esta clase se encuentra en fase de vista previa tecnológica y está sujeta a cambios.

Funciones públicas

GenericPass(QQmlSA::PassManager *manager)
virtual ~GenericPass()
void emitWarning(QAnyStringView diagnostic, QQmlSA::LoggerWarningId id)
void emitWarning(QAnyStringView diagnostic, QQmlSA::LoggerWarningId id, QQmlSA::SourceLocation srcLocation)
void emitWarning(QAnyStringView diagnostic, QQmlSA::LoggerWarningId id, QQmlSA::SourceLocation srcLocation, const QQmlSA::FixSuggestion &fix)
QQmlSA::Element resolveAttached(QAnyStringView moduleName, QAnyStringView typeName)
QQmlSA::Element resolveAttachedInFileScope(QAnyStringView typeName)
QQmlSA::Element resolveBuiltinType(QAnyStringView typeName) const
QString resolveElementToId(const QQmlSA::Element &element, const QQmlSA::Element &context)
QQmlSA::Element resolveIdToElement(QAnyStringView id, const QQmlSA::Element &context)
QQmlSA::Element resolveLiteralType(const QQmlSA::Binding &binding)
QQmlSA::Element resolveType(QAnyStringView moduleName, QAnyStringView typeName)
QQmlSA::Element resolveTypeInFileScope(QAnyStringView typeName)
QString sourceCode(QQmlSA::SourceLocation location)

Descripción detallada

Esta clase contiene funcionalidades comunes utilizadas por pases más específicos. Los pases personalizados no deben derivarse directamente de ella, sino de una de sus subclases.

Véase también ElementPass y PropertyPass.

Documentación de las funciones miembro

GenericPass::GenericPass(QQmlSA::PassManager *manager)

Crea un pase genérico.

[virtual noexcept] GenericPass::~GenericPass()

Elimina la instancia de « GenericPass ».

void GenericPass::emitWarning(QAnyStringView diagnostic, QQmlSA::LoggerWarningId id)

Muestra un mensaje de advertencia diagnostic sobre un problema de tipo id.

void GenericPass::emitWarning(QAnyStringView diagnostic, QQmlSA::LoggerWarningId id, QQmlSA::SourceLocation srcLocation)

Muestra un mensaje de advertencia diagnostic sobre un problema de tipo id que se encuentra en srcLocation.

void GenericPass::emitWarning(QAnyStringView diagnostic, QQmlSA::LoggerWarningId id, QQmlSA::SourceLocation srcLocation, const QQmlSA::FixSuggestion &fix)

Muestra un mensaje de advertencia diagnostic sobre un problema de tipo id, que se encuentra en srcLocation y cuya solución sugerida es fix.

QQmlSA::Element GenericPass::resolveAttached(QAnyStringView moduleName, QAnyStringView typeName)

Devuelve el tipo asociado de « typeName » definido en el módulo « moduleName ».

QQmlSA::Element GenericPass::resolveAttachedInFileScope(QAnyStringView typeName)

Devuelve el tipo adjunto correspondiente a « typeName » utilizado en el archivo que se está analizando actualmente.

QQmlSA::Element GenericPass::resolveBuiltinType(QAnyStringView typeName) const

typeName C++ QDateTime QString Number

QString GenericPass::resolveElementToId(const QQmlSA::Element &element, const QQmlSA::Element &context)

Devuelve el identificador de « element » en un « context » determinado.

QQmlSA::Element GenericPass::resolveIdToElement(QAnyStringView id, const QQmlSA::Element &context)

Devuelve el elemento de context que tiene el identificador id.

QQmlSA::Element GenericPass::resolveLiteralType(const QQmlSA::Binding &binding)

Devuelve el elemento que representa el tipo del literal en binding. Si el enlace no contiene un valor literal, se devuelve un elemento nulo.

QQmlSA::Element GenericPass::resolveType(QAnyStringView moduleName, QAnyStringView typeName)

Devuelve el tipo de ` typeName ` definido en el módulo ` moduleName`. Si un tipo asociado y un tipo no asociado comparten el mismo nombre (por ejemplo, ` ListView`), se devuelve el ` Element ` correspondiente al tipo no asociado. Para obtener el tipo asociado, utilice ` resolveAttached`.

QQmlSA::Element GenericPass::resolveTypeInFileScope(QAnyStringView typeName)

Devuelve el tipo correspondiente a « typeName » dentro del archivo que se está analizando actualmente.

QString GenericPass::sourceCode(QQmlSA::SourceLocation location)

Devuelve el código fuente que se encuentra en location.

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