Membre « Id shadows »
Cette catégorie d'avertissement est orthographiée « [id-shadows-member] » par qmllint.
L'identifiant fait de l'ombre à une propriété, une méthode ou un signal
Que s'est-il passé ?
Un identifiant risque de masquer une propriété, une méthode ou un signal dans le même contexte.
Pourquoi est-ce un problème ?
Vous ne pouvez plus accéder à la propriété, à la méthode ou au signal par son nom non qualifié. Le code qui le faisait auparavant accédera désormais silencieusement à l'identifiant à la place, ce qui peut entraîner des bogues difficiles à détecter.
Exemple
import QtQuick
Item {
Item { id: helloWorld }
property int helloWorld: 42
Component.onCompleted: console.log(helloWorld) // not 42
}Pour corriger cet avertissement, renommez l'identifiant ou le membre masqué.
© 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.