No usar void en expresiones
Esta categoría de advertencia se escribe [void] por qmllint.
No utilizar expresiones void
¿Qué ha ocurrido?
Se ha utilizado una expresión void de JavaScript.
¿Por qué es malo?
La expresión void se ha vuelto redundante en su mayor parte y puede oscurecer la lógica de algunos códigos suprimiendo los valores devueltos. También está prohibida en muchos estilos de código por ser poco obvia y difícil de leer.
Ejemplo
import QtQuick Item { function undef() { return void 0 } function f() { return void someFunction() } }
Para corregir esta advertencia, elimine o sustituya el uso de void:
import QtQuick Item { function undef() { return undefined } function f() { somefunction() } }
© 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.