The base class for static analysis passes. 更多...
头: | #include <GenericPass> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS QmlCompiler)
target_link_libraries(mytarget PRIVATE Qt6::QmlCompiler) |
继承者: | |
状态: | 技术预览 |
GenericPass (QQmlSA::PassManager * manager ) | |
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 ) |
This class contains common functionality used by more specific passses. Custom passes should not directly derive from it, but rather from one of its subclasses.
另请参阅 ElementPass and PropertyPass .
Creates a generic pass.
Emits a warning message diagnostic about an issue of type id .
Emits warning message diagnostic about an issue of type id located at srcLocation .
Emits a warning message diagnostic about an issue of type id located at srcLocation and with suggested fix fix .
Returns the attached type of typeName defined in module moduleName .
Returns the attached type corresponding to typeName used inside the currently analysed file.
Returns the type of the built-in type identified by
typeName
. Built-in types encompasses
C++
types which the QML engine can handle without any imports (e.g.
QDateTime
and
QString
), global EcmaScript objects like
Number
, as well as the
global Qt object
.
Returns the id of element in a given context .
Returns the element in context that has id id .
Returns the element representing the type of literal in binding . If the binding does not contain a literal value, a null Element is returned.
Returns the type of
typeName
defined in module
moduleName
. If an attached type and and a non-attached type share the same name (e.g.
ListView
),
Element
corresponding to the non-attached type is returned. To obtain the attached type, use
resolveAttached
.
Returns the type corresponding to typeName inside the currently analysed file.
Returns the source code located within location .