名称重复
此警告类别由 qmllint 拼写为[duplicated-name]
。
重复的属性名称
发生了什么事?
同一 QML 组件作用域中的多个属性具有相同的名称。
为什么会这样?
运行时将不会创建具有重复属性名的组件:它们将被置为空。
示例
要修复此警告,请删除重复的属性或重命名它:
重复的信号 mame
发生了什么?
同一 QML 组件作用域中的多个信号具有相同的名称。
为什么会这样?
运行时不会创建具有重复信号名称的组件:它们将被置为空。
示例
import QtQuick Rectangle { signal helloWorld signal helloWorld }
要修复此警告,请删除重复的信号或重命名它:
import QtQuick Rectangle { signal helloWorld }
© 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.