QQmlSA Namespace
提供用于对 QML 程序进行静态分析的工具。更多内容...
| 标题: | #include <qqmljsloggingutils.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS QmlCompiler) target_link_libraries(mytarget PRIVATE Qt6::QmlCompiler) |
| 状态: | 技术预览 |
此命名空间处于技术预览阶段,内容可能会发生变更。
类
(technology preview) class | Binding |
(technology preview) class | DocumentEdit |
(technology preview) class | Element |
(technology preview) class | ElementPass |
(technology preview) class | FixSuggestion |
(technology preview) class | GenericPass |
(technology preview) class | LintPlugin |
(technology preview) class | LoggerWarningId |
(technology preview) class | Method |
(technology preview) class | PassManager |
(technology preview) class | Property |
(technology preview) class | PropertyPass |
(technology preview) class | SourceLocation |
类型
(technology preview) enum class | AccessSemantics { Reference, Value, None, Sequence } |
(technology preview) enum class | BindingType { Invalid, BoolLiteral, NumberLiteral, StringLiteral, RegExpLiteral, …, GroupProperty } |
(technology preview) enum class | MethodType { Signal, Slot, Method, StaticMethod } |
| enum class | ScopeType { JSFunctionScope, JSLexicalScope, QMLScope, GroupedPropertyScope, AttachedPropertyScope, …, SignalHandlerFunctionScope } |
(technology preview) enum class | ScriptBindingKind { Invalid, PropertyBinding, SignalHandler, ChangeHandler } |
(technology preview) enum class | WarningSeverity { Error, Warning, Info, Disable } |
类
类Binding
表示针对特定类型的单个 QML 属性绑定。更多...
DocumentEdit类
表示对文档的单次编辑。更多...
类Element
表示一种 QML 类型。更多...
classElementPass
所有针对元素的静态分析处理的基类。更多...
类FixSuggestion
表示针对源代码中某个问题的修复建议。更多...
类GenericPass
静态分析处理的基类。更多...
类LintPlugin
所有静态分析插件的基类。更多...
classLoggerWarningId
QQmlSA 框架中用于唯一标识警告类别的字符串字面量封装类。更多...
classMethod
表示一个 QML 方法。更多...
classPassManager
可通过静态分析阶段对元素及其子元素进行分析。更多...
classProperty
表示一个 QML 属性。更多...
类PropertyPass
所有针对属性的静态分析阶段的基类。更多...
类SourceLocation
表示源代码中的某个位置或区域。更多...
类型文档
[technology preview] enum class QQmlSA::AccessSemantics
此枚举处于技术预览阶段,可能会发生变更。
描述了如何访问和共享一种类型。
| 常量 | 值 | 描述 |
|---|---|---|
QQmlSA::AccessSemantics::Reference | 0 | 该类型的行为类似于Object 类型 |
QQmlSA::AccessSemantics::Value | 1 | 该类型的行为与值类型类似 |
QQmlSA::AccessSemantics::None | 2 | 该类型是一个命名空间,或者无效 |
QQmlSA::AccessSemantics::Sequence | 3 | 该类型表现得像一个序列类型 |
另请参阅 《QML 类型系统》。
[technology preview] 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 | 该绑定是一个拦截器,可以拦截对以下属性的写入操作:Behavior |
QQmlSA::BindingType::ValueSource | 11 | 该绑定是一个属性值源 |
QQmlSA::BindingType::AttachedProperty | 12 | 该绑定是一个附加对象 |
QQmlSA::BindingType::GroupProperty | 13 | 该绑定是一个分组属性 |
[technology preview] 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 函数: |
QQmlSA::ScopeType::JSLexicalScope | 1 | 作用域是一个 JavaScript 词法作用域: |
QQmlSA::ScopeType::QMLScope | 2 | 该作用域是一个 QML 对象: |
QQmlSA::ScopeType::GroupedPropertyScope | 3 | 该作用域是一个分组属性: |
QQmlSA::ScopeType::AttachedPropertyScope | 4 | 作用域是一个附加属性: |
QQmlSA::ScopeType::EnumScope | 5 | 该作用域是一个 QML枚举: |
QQmlSA::ScopeType::BindingFunctionScope (since Qt 6.11) | 6 | 作用域表示绑定中的表达式: |
在 Qt 6.11 之前,这被报告为 JSFunctionScope
| 常量 | 值 | 描述 |
|---|---|---|
QQmlSA::ScopeType::SignalHandlerFunctionScope (since Qt 6.11) | 7 | 该作用域表示用作信号处理程序的函数: |
在 Qt 6.11 之前,这被报告为 JSFunctionScope
每个条目均附有 QML 代码中对应类型的示例作用域。
[technology preview] enum class QQmlSA::ScriptBindingKind
此枚举处于技术预览阶段,可能会有变动。
描述了类型为Script 的QQmlSA::Binding 的脚本类型。
| 常量 | 值 | 描述 |
|---|---|---|
QQmlSA::ScriptBindingKind::Invalid | 0 | 绑定具有无效的脚本 |
QQmlSA::ScriptBindingKind::PropertyBinding | 1 | 该绑定绑定到一个属性 |
QQmlSA::ScriptBindingKind::SignalHandler | 2 | 该绑定是一个信号处理程序 |
QQmlSA::ScriptBindingKind::ChangeHandler | 3 | 该绑定是一个变化处理程序 |
[technology preview] enum class QQmlSA::WarningSeverity
此枚举目前处于技术预览阶段,内容可能会有变动。
用于存储某个日志类别中诊断消息可能的严重性级别。
| 常量 | 值 | 描述 |
|---|---|---|
QQmlSA::WarningSeverity::Error | QtMsgType::QtCriticalMsg | 此日志类别发出的消息将引发错误。 |
QQmlSA::WarningSeverity::Warning | QtMsgType::QtWarningMsg | 此日志类别发出的消息为警告。除非设置了MaxWarnings且超过该值,否则不会产生错误。 |
QQmlSA::WarningSeverity::Info | QtMsgType::QtInfoMsg | 此日志类别发出的消息仅供参考,不计入MaxWarnings。 |
QQmlSA::WarningSeverity::Disable | 100 | 此日志类别不会发出任何消息。 |
该枚举类型自 Qt 6.12 起引入。
© 2026 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.