Auf dieser Seite

Doppelte Namen

Diese Warnkategorie wird von qmllint als „ [duplicated-name] “ bezeichnet.

Doppelte Eigenschafts-, Signal- oder Methodennamen

Was ist passiert?

Sie haben einer Eigenschaft, einem Signal oder einer Methode einen Namen gegeben, der in der aktuellen QML-Komponente bereits verwendet wird.

Warum ist das ein Problem?

Die QML Runtime erstellt zur Laufzeit keine Komponenten mit doppelten Mitgliedsnamen: Diese werden stattdessen auf null gesetzt.

Beispiel

import QtQuick

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

Um diese Warnung zu beheben, entfernen oder benennen Sie die doppelten Elemente um:

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.