Los componentes deben tener exactamente un hijo
Esta categoría de advertencia se escribe [component-children-count] por qmllint.
Los componentes deben tener exactamente un hijo
¿Qué ha ocurrido?
Un componente tiene un número incorrecto de hijos. Debe tener exactamente uno.
¿Por qué es malo?
El componente raíz del archivo no será instanciable y causará un error en tiempo de ejecución.
Ejemplo
Component { Rectangle { width: 50 height: 50 color: "red" } Rectangle { width: 50 height: 50 color: "blue" } }
Para corregir esta advertencia, asegúrese de que el componente tiene exactamente un hijo. Si está vacío, añádale un hijo. Si contiene varios, elimine los hijos sobrantes o envuélvalos en un único hijo de nivel superior del componente.
© 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.