重复导入
此警告类别由 qmllint 拼写为[duplicate-import]
。
重复导入
发生了什么事?
文件包含重复导入语句。
为什么会这样?
它们会不必要地污染文档,并可能减慢应用程序的启动速度。
示例
import QtQuick.Controls
import QtQuick
import QtQuick 2.1 as QQ21
import QtQuick.Controls
Item {
}
要修复此警告,请删除除最后一个重复导入语句以外的所有导入语句。注意不要改变导入的顺序,因为这会影响类型解析:
import QtQuick import QtQuick 2.1 as QQ21 // different from the previous import import QtQuick.Controls Item { }
© 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.