QML Lint 警告和错误
以下是所有 QML Lint 警告和错误消息的概述。
[alias-cycle] 别名属性属于别名循环。 | |
[attached-property-reuse] 附加类型被初始化了多次。 | |
[var-used-in-block-scope] 在代码块作用域内使用 var 声明了变量。 | |
[access-singleton-via-object] 访问单例的方式不正确。 | |
[comma] 请勿使用逗号表达式。 | |
[required] 组件的 required 属性未被绑定。 | |
[component-children-count] 组件的子元素数量有误。 | |
[confusing-expression-statement] 表达式语句令人困惑。 | |
[confusing-minuses] 令人困惑的减号。 | |
[confusing-pluses] 令人困惑的加号。 | |
[context-properties] 使用了上下文属性。 | |
[deprecated] 使用了已弃用的属性或类型。 | |
[void] 使用了 void 表达式。 | |
[duplicate-import] 导入重复。 | |
[属性绑定重复] 某个属性被绑定多次。 | |
[duplicate-enum-entries] 枚举键 X 已被声明。 | |
[syntax.duplicate-ids] 某个标识符不唯一。 | |
[duplicate-inline-components] 内联组件重复。 | |
[duplicated-name] 同一组件中多个成员共享相同名称。 | |
[非根枚举] 枚举在根元素之外被声明。 | |
[enum-entry-matches-enum] 枚举条目的名称应与枚举本身不同。 | |
[enum-key-case] 枚举键以小写字母开头。 | |
[enums-are-not-types] 枚举名称被用作类型注释。 | |
[eval] 使用了 eval。 | |
[function-used-before-declaration] 函数在声明之前已被调用。 | |
[syntax.id-quotation] 标识符包含引号。 | |
[id-shadows-member] 标识符遮蔽了成员。 | |
[import-file-selector] 使用文件选择器的导入。 | |
[incompatible-type] 某个对象、值或表达式被用于不兼容的类型上。 | |
[inheritance-cycle] 某个组件继承自其自身。 | |
[inline-component-enums] 在内联组件内部声明了枚举。 | |
[invalid-lint-directive] qmllint 注释无效。 | |
[字面量构造函数] 请勿将函数用作构造函数。 | |
[equality-type-coercion] 使用宽松的相等比较运算符可能会导致值被强制转换。 | |
[缺失枚举条目] 枚举声明中缺少枚举值。 | |
[missing-property] 将值绑定到不存在的属性上。 | |
[missing-type] 未找到绑定或别名中使用的类型。 | |
[多行字符串] 字符串跨越了多行。 | |
[非列表属性] 向非列表属性赋值了多个值。 | |
[prefer-non-var-properties] 优先使用非 var 属性而非 var 属性。 | |
[property-override] 错误使用了 override、final 和 virtual 关键字。 | |
[Quick.attached-property-type] 误用了 Quick 附加属性类型。 | |
[read-only-property] 编写了只读属性。 | |
[递归深度错误] QML 语句或表达式嵌套过深。 | |
[redundant-optional-chaining] 某些可选链式查找可能并非可选。 | |
[renamed-type] 通过未导出的名称调用了某个类型。 | |
[受限类型] 访问了受限类型。 | |
[遮蔽] 一个成员遮蔽了另一个成员。 | |
[信号处理程序参数] 信号处理程序不符合信号类型的要求。 | |
[过期属性读取] 读取了非常量且不可通知的属性。 | |
[syntax] 各种语法错误。 | |
[top-level-component] 根 QML 类型是一个组件。 | |
[type-instantiated-recursively] 类型正在递归实例化自身。 | |
[无法创建的类型] 无法创建的类型。 | |
[unintentional-empty-block] 创建了一个空代码块,很可能是代替对象字面量。 | |
[未限定] 未使用 id 访问外部作用域。 | |
[无法触及的代码] 某些指令无法被执行。 | |
[未解析别名] 未找到属性别名的属性。 | |
[unresolved-type] 未找到已使用的类型。 | |
[未终止-case] 一个非空的 case 代码块未被终止。 | |
[未使用的导入] 导入模块中的类型未被使用。 | |
[use-proper-function] 调用了可能不是函数的对象。 | |
[变量在声明前被使用] 某个 JavaScript 变量在声明之前就被使用了。 | |
[assignment-in-condition] 在条件语句中使用了赋值语句。 | |
[import] 未找到所导入的模块。 | |
[with] 在 QML 中强烈不建议使用 with 语句。 |
© 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.