Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
\inmodule QtQmlCompiler More...
#include <qqmlsa.h>
Public Member Functions | |
void | registerElementPass (std::unique_ptr< ElementPass > pass) |
Registers a static analysis pass to be run on all elements. | |
bool | registerPropertyPass (std::shared_ptr< PropertyPass > pass, QAnyStringView moduleName, QAnyStringView typeName, QAnyStringView propertyName=QAnyStringView(), bool allowInheritance=true) |
Registers a static analysis pass for properties. | |
void | analyze (const Element &root) |
Runs the element passes over root and all its children. | |
bool | hasImportedModule (QAnyStringView name) const |
Returns true if the module named module has been imported by the QML to be analyzed, false otherwise. | |
bool | isCategoryEnabled (LoggerWarningId category) const |
Returns true if warnings of category are enabled, false otherwise. | |
std::vector< std::shared_ptr< ElementPass > > | elementPasses () const |
Returns the list of element passes. | |
std::multimap< QString, PropertyPassInfo > | propertyPasses () const |
Returns the list of property passes. | |
std::unordered_map< quint32, BindingInfo > | bindingsByLocation () const |
Returns bindings by their source location. | |
\inmodule QtQmlCompiler
Can analyze an element and its children with static analysis passes.
Runs the element passes over root and all its children.
Definition at line 1185 of file qqmlsa.cpp.
References d.
std::unordered_map< quint32, BindingInfo > QQmlSA::PassManager::bindingsByLocation | ( | ) | const |
Returns bindings by their source location.
Definition at line 1559 of file qqmlsa.cpp.
References d.
std::vector< std::shared_ptr< ElementPass > > QQmlSA::PassManager::elementPasses | ( | ) | const |
bool QQmlSA::PassManager::hasImportedModule | ( | QAnyStringView | module | ) | const |
Returns true
if the module named module has been imported by the QML to be analyzed, false
otherwise.
This can be used to skip registering a pass which is specific to a specific module.
Definition at line 1274 of file qqmlsa.cpp.
References QAnyStringView::toString(), and QQmlSA::PassManagerPrivate::visitor().
bool QQmlSA::PassManager::isCategoryEnabled | ( | LoggerWarningId | category | ) | const |
Returns true
if warnings of category are enabled, false
otherwise.
Definition at line 1282 of file qqmlsa.cpp.
References category(), and QQmlSA::PassManagerPrivate::visitor().
std::multimap< QString, PropertyPassInfo > QQmlSA::PassManager::propertyPasses | ( | ) | const |
void QQmlSA::PassManager::registerElementPass | ( | std::unique_ptr< ElementPass > | pass | ) |
Registers a static analysis pass to be run on all elements.
Definition at line 1050 of file qqmlsa.cpp.
References d.
bool QQmlSA::PassManager::registerPropertyPass | ( | std::shared_ptr< PropertyPass > | pass, |
QAnyStringView | moduleName, | ||
QAnyStringView | typeName, | ||
QAnyStringView | propertyName = QAnyStringView(), | ||
bool | allowInheritance = true ) |
Registers a static analysis pass for properties.
The pass will be run on every property matching the moduleName, typeName and propertyName.
Omitting the propertyName will register this pass for all properties matching the typeName and moduleName.
Setting allowInheritance to true
means that the filtering on the type also accepts types deriving from typeName.
pass is passed as a {std::shared_ptr} to allow reusing the same pass on multiple elements:
Returns true
if the pass was successfully added, false
otherwise. Adding a pass fails when the \l{QQmlSA::Element}{Element} specified by moduleName and typeName does not exist.
Definition at line 1119 of file qqmlsa.cpp.