QQmlSA Namespace
为 QML 程序提供静态分析工具。更多
Header: | #include <QQmlSA> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS QmlCompiler) target_link_libraries(mytarget PRIVATE Qt6::QmlCompiler) |
状态: 技术预览 | 技术预览 |
类别
class | Binding |
class | Element |
class | ElementPass |
class | FixSuggestion |
class | GenericPass |
class | LintPlugin |
class | LoggerWarningId |
class | Method |
class | PassManager |
class | Property |
class | PropertyPass |
class | SourceLocation |
类型
enum class | AccessSemantics { Reference, Value, None, Sequence } |
enum class | BindingType { Invalid, BoolLiteral, NumberLiteral, StringLiteral, RegExpLiteral, …, GroupProperty } |
enum class | MethodType { Signal, Slot, Method, StaticMethod } |
enum class | ScopeType { JSFunctionScope, JSLexicalScope, QMLScope, GroupedPropertyScope, AttachedPropertyScope, EnumScope } |
enum class | ScriptBindingKind { Invalid, PropertyBinding, SignalHandler, ChangeHandler } |
类
类绑定
代表特定类型的单一 QML 属性绑定。更多...
元素类
代表一个 QML 类型。更多
类ElementPass
元素上所有静态分析传递的基类。更多
类FixSuggestion
源代码中问题的建议修复。更多
类通用传递
静态分析通行证的基类。更多
类LintPlugin
所有静态分析插件的基类。更多
类LoggerWarningId
用于在QQmlSA
框架中唯一标识警告类别的字符串字面的封装。更多
类方法
代表 QML 方法。更多
类PassManager
可以用静态分析传递分析一个元素及其子元素。更多
类属性
代表一个 QML 属性。更多
类PropertyPass
所有属性静态分析传递的基类。更多
类SourceLocation
代表源代码中的位置或区域。更多
类型文档
enum class QQmlSA::AccessSemantics
描述类型的访问和共享方式。
常量 | 值 | 说明 |
---|---|---|
QQmlSA::AccessSemantics::Reference | 0 | 该类型的行为类似于对象类型 |
QQmlSA::AccessSemantics::Value | 1 | 该类型的行为类似于值类型 |
QQmlSA::AccessSemantics::None | 2 | 类型是命名空间,或无效 |
QQmlSA::AccessSemantics::Sequence | 3 | 类型表现为序列类型 |
另请参阅 QML 类型系统。
enum class QQmlSA::BindingType
描述QQmlSA::Binding 的类型。
常量 | 值 | 说明 |
---|---|---|
QQmlSA::BindingType::Invalid | 0 | 没有绑定 |
QQmlSA::BindingType::BoolLiteral | 1 | 绑定为 bool 字面 |
QQmlSA::BindingType::NumberLiteral | 2 | 绑定为数字字面 |
QQmlSA::BindingType::StringLiteral | 3 | 绑定为字符串字面 |
QQmlSA::BindingType::RegExpLiteral | 4 | 绑定为正则表达式字面 |
QQmlSA::BindingType::Null | 5 | 绑定为空字面 |
QQmlSA::BindingType::Translation | 6 | 绑定为翻译 |
QQmlSA::BindingType::TranslationById | 7 | 绑定是按 ID 的翻译 |
QQmlSA::BindingType::Script | 8 | 绑定为正则脚本 |
QQmlSA::BindingType::Object | 9 | 绑定对象 |
QQmlSA::BindingType::Interceptor | 10 | 绑定是一个拦截器,可拦截写入行为等属性的内容 |
QQmlSA::BindingType::ValueSource | 11 | 绑定是一个属性值源 |
QQmlSA::BindingType::AttachedProperty | 12 | 绑定是一个附加对象 |
QQmlSA::BindingType::GroupProperty | 13 | 绑定是分组属性 |
enum class QQmlSA::MethodType
描述QQmlSA::Method 的类型。
常量 | 值 | 说明 |
---|---|---|
QQmlSA::MethodType::Signal | 0 | 该方法是一个信号 |
QQmlSA::MethodType::Slot | 1 | 方法是槽 |
QQmlSA::MethodType::Method | 2 | 该方法是Q_INVOKABLE 方法 |
QQmlSA::MethodType::StaticMethod | 3 | 该方法是Q_INVOKABLE 静态方法 |
enum class QQmlSA::ScopeType
描述 QML 作用域的类型。
常量 | 值 | 描述 |
---|---|---|
QQmlSA::ScopeType::JSFunctionScope | 0 | 作用域是 JavaScript 函数:Item { function f() : int { <- begin return 1 } <- end } |
QQmlSA::ScopeType::JSLexicalScope | 1 | 作用域是 JavaScript 词法作用域:property int i: { <- begin let a = 1 { <- begin console.log("hello") } <- end return a } <- end |
QQmlSA::ScopeType::QMLScope | 2 | 作用域是 QML 对象:Item { <- begin x: 50 } <- end |
QQmlSA::ScopeType::GroupedPropertyScope | 3 | 范围是分组属性Text { font { <- begin pixelSize: 12 bold: true } <- end } |
QQmlSA::ScopeType::AttachedPropertyScope | 4 | 范围是附加属性Item { Component.onCompleted: console.log("Hello") ^^^^^^^^^ \ Scope of attached property Component } |
QQmlSA::ScopeType::EnumScope | 5 | 范围是 QML枚举enum E { <- begin A, B, C } <- end |
每个条目都显示了 QML 代码中匹配类型的示例作用域。
enum class QQmlSA::ScriptBindingKind
描述QQmlSA::Binding 类型为Script 的脚本类型。
© 2025 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.