Schnell: Typ der angehängten Eigenschaft

Die angehängte Eigenschaft muss an ein Objekt angehängt sein, das von einem bestimmten Typ abgeleitet ist.

Was ist passiert?

Sie haben eine angehängte Eigenschaft in einem Objekt des falschen Typs instanziiert.

Warum ist das schlecht?

Die angehängte Eigenschaft wird nicht funktionieren.

Beispiel

import QtQuick

Item {
    QtObject {
        LayoutMirroring.enabled: true
    }
}

Um diese Warnung zu beheben, ändern Sie den umschließenden Typ so, dass er von dem in der Warnmeldung genannten Typ erbt:

import QtQuick

Item {
    Item {
        LayoutMirroring.enabled: true
    }
}

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