En esta página

Componente de nivel superior

qmllint escribe esta categoría de advertencia como « [top-level-component] ».

Un tipo de nivel superior de QML no puede ser un componente

¿Qué ha pasado?

Has utilizado el tipo « Component » como tipo de nivel superior en tu archivo QML.

¿Por qué es un error?

Tu archivo QML ya define un componente por sí mismo. Utilizar un tipo « Component » como tipo de nivel superior envolverá tu componente en otro componente innecesario.

Ejemplo

import QtQuick

Component {
    Item { ... }
}

Para solucionar esta advertencia, elimina el envoltorio adicional de «Component»:

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.