In questa pagina

QQmlSA::GenericPass Class

class QQmlSA::GenericPass

La classe base per i passaggi dell'analisi statica. Per saperne di più...

Intestazione: #include <qqmlsa.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS QmlCompiler)
target_link_libraries(mytarget PRIVATE Qt6::QmlCompiler)
Ereditato da:

QQmlSA::ElementPass e QQmlSA::PropertyPass

Stato: Anteprima tecnologica

Questa classe è in anteprima tecnologica ed è soggetta a modifiche.

Funzioni pubbliche

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)

Descrizione dettagliata

Questa classe contiene funzionalità comuni utilizzate da passaggi più specifici. I passaggi personalizzati non dovrebbero derivare direttamente da essa, ma piuttosto da una delle sue sottoclassi.

Vedi anche ElementPass e PropertyPass.

Documentazione delle funzioni membro

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

Crea un pass generico.

[virtual noexcept] GenericPass::~GenericPass()

Elimina l'istanza di GenericPass.

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

Visualizza un messaggio di avviso diagnostic relativo a un problema di tipo id.

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

Visualizza un messaggio di avviso diagnostic relativo a un problema di tipo id presente all'indirizzo srcLocation.

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

Visualizza un messaggio di avviso diagnostic relativo a un problema di tipo id, individuato all'indirizzo srcLocation e per il quale viene suggerita la seguente soluzione fix.

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

Restituisce il tipo associato di " typeName " definito nel modulo moduleName.

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

Restituisce il tipo associato corrispondente a un typeName e utilizzato all'interno del file attualmente analizzato.

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

Restituisce il tipo del tipo incorporato identificato da typeName. I tipi incorporati comprendono i tipi C++ che il motore QML è in grado di gestire senza alcuna importazione (ad esempio QDateTime e QString), gli oggetti globali E come Number, nonché l'oggetto globale Qt.

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

Restituisce l'ID di un oggetto di tipo ` element ` in un dato oggetto di tipo ` context`.

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

Restituisce l'elemento in context con id id.

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

Restituisce l'elemento che rappresenta il tipo del letterale in binding. Se il binding non contiene un valore letterale, viene restituito un elemento nullo.

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

Restituisce il tipo di ` typeName ` definito nel modulo ` moduleName`. Se un tipo associato e un tipo non associato condividono lo stesso nome (ad esempio, ` ListView`), viene restituito l’` Element ` corrispondente al tipo non associato. Per ottenere il tipo associato, utilizzare ` resolveAttached`.

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

Restituisce il tipo corrispondente a “ typeName ” all’interno del file attualmente analizzato.

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

Restituisce il codice sorgente presente all'indirizzo 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.