Espressione che crea confusione
Questa categoria di avviso viene indicata da qmllint con il nome " [confusing-expression-statement] ".
L'istruzione di espressione non ha alcun effetto evidente
Cosa è successo?
Hai utilizzato un'istruzione di tipo espressione che non ha alcun effetto evidente.
Perché è un problema?
Rende il codice più difficile da leggere e può causare confusione. Di solito, indica che il risultato di un'espressione è stato ignorato.
L'istruzione di espressione viene compilata in bytecode e valutata in fase di esecuzione, nonostante non abbia alcun effetto.
Esempio
import QtQuick
Item {
function add(a: int, b: int) : int {
a + b
}
}Per risolvere questo avviso, rimuovi l'espressione senza effetto oppure utilizza il risultato dell'espressione.
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.