Expresión confusa
Esta categoría de advertencia se escribe [confusing-expression-statement] por qmllint.
La expresión no tiene un efecto obvio
¿Qué ha ocurrido?
Ha utilizado una expresión que no tiene un efecto evidente.
¿Por qué es malo?
Hace que el código sea más difícil de leer y puede causar confusión. Normalmente, indica que algún resultado de la expresión fue ignorado.
La expresión se compila en bytecode y se evalúa en tiempo de ejecución, a pesar de no tener ningún efecto.
Ejemplo
import QtQuick Item { function add(a: int, b: int) : int { a + b } }
Para solucionar esta advertencia, elimine la expresión sin efecto o utilice el resultado de la expresión.
import QtQuick Item { function add(a: int, b: int) : int { return a + b } }
© 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.