QML Lint 警告和错误
下面是所有 QML Lint 警告和错误信息的概览。
[alias-cycle] 别名属性是别名循环的一部分。 | |
[attached-property-reuse] 附加类型被多次初始化。 | |
[access-singleton-via-object(通过对象访问单例)] 访问单例不正确。 | |
[逗号] 不要使用逗号表达式。 | |
[required] 未绑定组件的必填属性。 | |
[组件-子节点数] 一个组件的子节点数错误。 | |
[confusing-expression-statement] 表达式语句混乱。 | |
[confusing-minuses] 表达式语句混乱。 | |
[confusing-pluses] 混淆的长句。 | |
[使用了上下文属性。 | |
[已废弃] 使用了已废弃的属性或类型。 | |
[void] 使用了 void 表达式。 | |
[重复导入] 重复导入。 | |
[重复属性绑定] 一个属性被多次绑定。 | |
[duplicate-enum-entries] 已经声明了枚举键 X。 | |
[syntax.duplicate-ids] id 不唯一。 | |
[duplicate-inline-components] 重复的内联组件。 | |
[duplicated-name] 同一组件中多个成员共享相同名称。 | |
[non-root-enum] 在根元素之外声明了一个枚举。 | |
[enum-entry-matches-enum] 枚举项的命名应与枚举本身不同。 | |
[enums-are-not-types] 作为类型注解使用的枚举名称。 | |
[eval] 使用 eval。 | |
[function-used-before-declaration] 在函数声明之前使用了该函数。 | |
[syntax.id-quotation] Id 有引号。 | |
[import-file-selector] 使用文件选择器导入。 | |
[incompatible-type] 在不兼容的类型上使用了对象、值或表达式。 | |
[继承循环] 一个组件从自身继承。 | |
[invalid-lint-directive] 无效的 qmllint 注释。 | |
[literal-constructor] 不要使用函数作为构造函数。 | |
[equality-type-coercion] 使用松散的相等比较运算符可能会胁迫值。 | |
[missing-enum-entry] 在声明中缺少枚举值。 | |
[missing-property] 将值绑定到不存在的属性。 | |
[missing-type] 未找到绑定或别名中使用的类型。 | |
[多行字符串] 字符串跨越多行。 | |
[非列表属性] 为一个非列表属性分配了多个值。 | |
[prefer-non-var-properties] 优先选择非变量属性,而不是变量属性。 | |
[Quick.attached-property-type] 误用 Quick 附加属性类型。 | |
[read-only-property] 写入了一个只读属性。 | |
[递归深度错误] Qml 语句或表达式嵌套过深。 | |
[冗余可选链式查找] 某些可选链式查找可能是非可选的。 | |
[受限类型] 访问了一个受限类型。 | |
[信号处理器参数] 信号处理器不符合信号类型。 | |
[stale-property-read] 读取非常数和不可注属性。 | |
[语法] 各种语法错误。 | |
[top-level-component] 根 QML 类型是一个组件。 | |
[uncreatable-type] 无法创建的类型。 | |
[unintentional-empty-block] 创建了一个空块,很可能是代替了一个对象字面。 | |
[unqualified] 在没有 id 的情况下访问外层作用域。 | |
[无法访问代码] 某些指令无法访问。 | |
[unresolved-alias]未找到属性别名的属性。 | |
[unresolved-type] 未找到已使用的类型。 | |
[unterminated-case] 一个非空的情况块未被终止。 | |
[unused-imports] 未使用导入模块的类型。 | |
[use-proper-function] 调用了可能不是函数的内容。 | |
[var-used-before-declaration]JavaScript 变量在声明之前被使用。 | |
[在条件中赋值] 在条件中使用了赋值语句。 | |
[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.