Componente de nivel superior
Esta categoría de advertencia se escribe [top-level-component] por qmllint.
El tipo de nivel superior QML no puede ser Componente
¿Qué ha ocurrido?
Ha utilizado el tipo Component como tipo de nivel superior para su archivo QML.
¿Por qué es malo?
Su archivo QML ya define un componente por sí mismo. El uso de un tipo Component como tipo de nivel superior envolverá su componente en otro componente innecesario.
Ejemplo
import QtQuick
Component {
Item { ... }
}Para corregir esta advertencia, elimine la envoltura adicional del componente:
import QtQuick
Item { ... }© 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.