GenericPass Class
class QQmlSA::GenericPassThe base class for static analysis passes. More...
Header: | #include <GenericPass> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS QmlCompiler) target_link_libraries(mytarget PRIVATE Qt6::QmlCompiler) |
Inherited By: | |
Status: | Technical Preview |
Public Functions
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) |
Detailed Description
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.
See also ElementPass and PropertyPass.
Member Function Documentation
GenericPass::GenericPass(QQmlSA::PassManager *manager)
Creates a generic pass.
void GenericPass::emitWarning(QAnyStringView diagnostic, QQmlSA::LoggerWarningId id)
Emits a warning message diagnostic about an issue of type id.
void GenericPass::emitWarning(QAnyStringView diagnostic, QQmlSA::LoggerWarningId id, QQmlSA::SourceLocation srcLocation)
Emits warning message diagnostic about an issue of type id located at srcLocation.
void GenericPass::emitWarning(QAnyStringView diagnostic, QQmlSA::LoggerWarningId id, QQmlSA::SourceLocation srcLocation, const QQmlSA::FixSuggestion &fix)
Emits a warning message diagnostic about an issue of type id located at srcLocation and with suggested fix fix.
QQmlSA::Element GenericPass::resolveAttached(QAnyStringView moduleName, QAnyStringView typeName)
Returns the attached type of typeName defined in module moduleName.
QQmlSA::Element GenericPass::resolveAttachedInFileScope(QAnyStringView typeName)
Returns the attached type corresponding to typeName used inside the currently analysed file.
QQmlSA::Element GenericPass::resolveBuiltinType(QAnyStringView typeName) const
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.
QString GenericPass::resolveElementToId(const QQmlSA::Element &element, const QQmlSA::Element &context)
Returns the id of element in a given context.
QQmlSA::Element GenericPass::resolveIdToElement(QAnyStringView id, const QQmlSA::Element &context)
Returns the element in context that has id id.
QQmlSA::Element GenericPass::resolveLiteralType(const QQmlSA::Binding &binding)
Returns the element representing the type of literal in binding. If the binding does not contain a literal value, a null Element is returned.
QQmlSA::Element GenericPass::resolveType(QAnyStringView moduleName, QAnyStringView typeName)
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
), the Element corresponding to the non-attached type is returned. To obtain the attached type, use resolveAttached.
QQmlSA::Element GenericPass::resolveTypeInFileScope(QAnyStringView typeName)
Returns the type corresponding to typeName inside the currently analysed file.
QString GenericPass::sourceCode(QQmlSA::SourceLocation location)
Returns the source code located within location.
© 2024 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.