W3cubDocs

/Qt 6.9

Quick: Attached property type

Attached property must be attached to an object deriving from a particular type

What happened?

You instantiated an attached property in an object of the wrong type.

Why is this bad?

The attached property will not work.

Example

import QtQuick

Item {
    QtObject {
        LayoutMirroring.enabled: true
    }
}

To fix this warning, change the enclosing type to inherit from the type mentioned in the warning message:

import QtQuick

Item {
    Item {
        LayoutMirroring.enabled: true
    }
}

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.9/qmllint-warnings-and-errors-quick-attached-property-type.html