Com
Essa categoria de aviso é denominada “ [with] ” pelo qmllint.
Com instruções
O que aconteceu?
A instrução “ with ” do JavaScript foi utilizada.
Por que isso é ruim?
As instruções “with” podem causar falsos positivos ao analisar identificadores não qualificados. Além disso, as instruções “ with ” são marcadas como obsoletas pelo padrão mais recente do JavaScript.
Exemplo
import QtQuick
Item {
function f() {
with (Math) {
return PI
}
}
}Para corrigir esse aviso, substitua a instrução ` with ` por uma propriedade de desestruturação:
import QtQuick
Item {
function f() {
const { PI } = Math;
return PI
}
}Observação: você pode encontrar mais sugestões de substituição aqui.
© 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.