Sur cette page

Nom en double

Cette catégorie d'avertissement est orthographiée [duplicated-name] par qmllint.

Duplication du nom d'une propriété, d'un signal ou d'une méthode

Qu'est-ce qui s'est passé ?

Vous avez donné à une propriété, un signal ou une méthode un nom qui est déjà utilisé dans le composant QML actuel.

Pourquoi est-ce mauvais ?

Le QML Runtime ne crée pas de composants avec des noms de membres dupliqués à l'exécution : ils seront null à la place.

Exemple

import QtQuick

Item {
    property int helloWorld
    property int helloWorld // duplicate property
    signal helloWorld() // duplicate signal
}

Pour corriger cet avertissement, supprimez ou renommez les membres en double :

import QtQuick

Item {
    property int helloWorld
    signal helloWorldSignal()
}

© 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.