Quick: Attached property type | Qt Qml | Qt 6.11.1
Description: [Quick.attached-property-type] Misuses of the Quick attached property types.

- Qt 6.11
- Qt Qml
- Qt Qml Tooling
- qmllint
- QML Lint Warning and Errors
- Quick: Attached property type
- Qt 6.11.1 Reference Documentation

Enum declared outside the root element ◦ Readonly property

# Quick: Attached property type

This warning category is spelled `[Quick.attached-property-type]` by qmllint.

## 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
         }
     }

Enum declared outside the root element ◦ Readonly property