Sur cette page

Rapide : Type de propriété attachée

Cette catégorie d'avertissement est orthographiée [Quick.attached-property-type] par qmllint.

Une propriété attachée doit être attachée à un objet dérivant d'un type particulier.

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

Vous avez instancié une propriété attachée dans un objet du mauvais type.

Pourquoi est-ce mauvais ?

La propriété attachée ne fonctionnera pas.

Exemple

import QtQuick

Item {
    QtObject {
        LayoutMirroring.enabled: true
    }
}

Pour corriger cet avertissement, modifiez le type englobant pour qu'il hérite du type mentionné dans le message d'avertissement :

import QtQuick

Item {
    Item {
        LayoutMirroring.enabled: true
    }
}

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