Expression prêtant à confusion
Cette catégorie d'avertissement est orthographiée « [confusing-expression-statement] » par qmllint.
L'instruction d'expression n'a aucun effet apparent
Que s'est-il passé ?
Vous avez utilisé une instruction d'expression qui n'a aucun effet évident.
Pourquoi est-ce un problème ?
Cela rend le code plus difficile à lire et peut prêter à confusion. En général, cela indique qu’un résultat d’expression a été ignoré.
L'instruction d'expression est compilée en bytecode et évaluée lors de l'exécution, bien qu'elle n'ait aucun effet.
Exemple
import QtQuick
Item {
function add(a: int, b: int) : int {
a + b
}
}Pour corriger cet avertissement, supprimez l'expression sans effet ou utilisez le résultat de l'expression.
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.