- Qt 6.10
- Qt QML Compiler
- C++ Classes
- QtQmlCompiler (Technical Preview)
- PropertyPass
- Qt 6.10.2 Reference Documentation

# QQmlSA::PropertyPass Class

class QQmlSA::PropertyPass

Base class for all static analysis passes on properties. More...

Header: | `#include <PropertyPass>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS QmlCompiler)` `target_link_libraries(mytarget PRIVATE Qt6::QmlCompiler)`
Inherits: | QQmlSA::GenericPass
Status: | Technical Preview

- List of all members, including inherited members

## Public Functions

| PropertyPass(QQmlSA::PassManager *manager)
virtual void | onBinding(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Binding &binding, const QQmlSA::Element &bindingScope, const QQmlSA::Element &value)
virtual void | onCall(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Element &readScope, QQmlSA::SourceLocation location)
virtual void | onRead(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Element &readScope, QQmlSA::SourceLocation location)
virtual void | onWrite(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Element &expressionType, const QQmlSA::Element &writeScope, QQmlSA::SourceLocation location)

## Detailed Description

## Member Function Documentation

### PropertyPass::PropertyPass(QQmlSA::PassManager *manager)

Creates a PropertyPass object and uses manager to refer to the pass manager.

### `[virtual]` void PropertyPass::onBinding(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Binding &binding, const QQmlSA::Element &bindingScope, const QQmlSA::Element &value)

Executes whenever a property gets bound to a value.

The property propertyName of element is bound to the value within bindingScope with binding.

### `[virtual]` void PropertyPass::onCall(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Element &readScope, QQmlSA::SourceLocation location)

Executes whenever a property or method is called.

The property or method propertyName of element is called as a function by an instruction within readScope defined at location.

Note: Currently only direct calls of methods or properties are supported, indirect calls, for example by storing a method into a JavaScript variable and then calling the variable, are not recognized.

### `[virtual]` void PropertyPass::onRead(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Element &readScope, QQmlSA::SourceLocation location)

Executes whenever a property is read.

The property propertyName of element is read by an instruction within readScope defined at location.

This is also executed if the property propertyName is called as a function as that requires the property to be read first.

### `[virtual]` void PropertyPass::onWrite(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Element &expressionType, const QQmlSA::Element &writeScope, QQmlSA::SourceLocation location)

Executes whenever a property is written to.

The property propertyName of element is written to by an instruction within writeScope defined at location. The type of the expression written to propertyName is expressionType.