快:附加属性类型

附加属性必须附加到派生自特定类型的对象上

发生了什么?

你在错误类型的对象中实例化了附加属性。

为什么会这样?

附加属性将不起作用。

示例

import QtQuick

Item {
    QtObject {
        LayoutMirroring.enabled: true
    }
}

要修复此警告,请将外层类型改为从警告信息中提到的类型继承:

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.