Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
attached-property-type.qdoc
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\ingroup qmllint-warnings-and-errors
6
7\title Quick: Attached property type
8\brief [Quick.attached-property-type] Misuses of the Quick attached property types.
9
10\qmllintwarningcategory Quick.attached-property-type
11
12\section1 Attached property must be attached to an object deriving from a particular type
13
14\section2 What happened?
15You instantiated an attached property in an object of the wrong type.
16
17\section2 Why is this bad?
18The attached property will not work.
19
20\section2 Example
21\qml
22import QtQuick
23
24Item {
25 QtObject {
26 LayoutMirroring.enabled: true
27 }
28}
29
30\endqml
31To fix this warning, change the enclosing type to inherit from the type
32mentioned in the warning message:
33
34\qml
35import QtQuick
36
37Item {
38 Item {
39 LayoutMirroring.enabled: true
40 }
41}
42
43\endqml
44*/