QML Lint 警告和错误

下面是所有 QML Lint 警告和错误信息的概览。

Alias cycle

[alias-cycle] 别名属性是别名循环的一部分。

Attached property reuse

[attached-property-reuse] 附加类型被多次初始化。

Cannot access singleton as a property of an object

[access-singleton-via-object(通过对象访问单例)] 访问单例不正确。

Comma

[逗号] 不要使用逗号表达式。

Component is missing a required property

[required] 未绑定组件的必填属性。

Confusing minuses

[confusing-minuses] 令人困惑的减号。

Confusing pluses

[confusing-pluses] 容易混淆的优点。

Deprecated

[已废弃] 使用了已废弃的属性或类型。

Do not use void in expressions

[void] 使用了 void 表达式。

Duplicate Imports

[重复导入] 重复导入。

Duplicate bindings

[重复属性绑定] 一个属性被多次绑定。

Duplicate enum entries

[duplicate-enum-entries] 已经声明了枚举键 X。

Duplicate id

[syntax.duplicate-ids] id 不唯一。

Duplicate inline components

[duplicate-inline-components] 重复的内联组件。

Duplicated name

[duplicated-name] 在同一组件中,多个信号或属性共享相同的名称。

Enum declared outside the root element

[non-root-enum] 在根元素之外声明了一个枚举。

Enum entry matches enum

[enum-entry-matches-enum] 枚举项的命名应与枚举本身不同。

Id quotation

[syntax.id-quotation] Id 有引号。

Incompatible type

[不兼容类型] 对象、值或表达式用于不兼容类型。

Inheritance cycle

[inherance-cycle]组件从自身继承。

Invalid qmllint directives

[invalid-lint-directive] 无效的 qmllint 注释。

Literal constructor

[literal-constructor] 不要使用函数作为构造函数。

Missing enum entry

[missing-enum-entry] 在其声明中缺少枚举值。

Missing property

[missing-property] 将值绑定到不存在的属性。

Missing type

[missing-type] 未找到绑定或别名中使用的类型。

Multiline strings

[多行字符串] 字符串跨越多行。

Non-list property

[非列表属性] 为一个非列表属性分配了多个值。

Quick: Attached property type

错误使用 Quick 附加属性类型。

Readonly property

[只读属性] 写入了一个只读属性。

Recursion depths errors

[递归深度错误] Qml 语句或表达式嵌套过深。

Redundant Optional Chaining

[冗余可选链式查找] 某些可选链式查找可能是非可选的。

Restricted type

[受限类型] 访问了一个受限类型。

Signal handler parameters

[信号处理器参数] 信号处理器不符合信号类型。

Syntax

[语法] 各种语法错误。

Top level component

[top-level-component] 根 QML 类型是一个组件。

Uncreatable type

[uncreatable-type] 无法创建的类型。

Unqualified

[unqualified]访问没有 id 的外层作用域。

Unresolved alias

[unresolved-alias] 未找到属性别名的属性。

Unresolved type

[unresolved-type] 未找到已使用的类型。

Unterminated non-empty case block

[unterminated-case] 未终止非空的情况块。

Unused imports

[unused-imports] 未使用导入模块的类型。

Use proper function

[use-proper-function] 调用了可能不是函数的内容。

Var used before declaration

[var-used-before-declaration]JavaScript 变量在声明之前被使用。

Warn about using assignment in conditions

[在条件中赋值] 在条件中使用了赋值语句。

Warnings occurred while importing

[导入] 未找到导入的模块。

With

[With] QML 强烈反对使用 With 语句。

© 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.