diff options
| author | Sami Shalayel <sami.shalayel@qt.io> | 2024-07-18 16:54:27 +0200 |
|---|---|---|
| committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-08-13 16:29:06 +0000 |
| commit | 6dd8348d6e0f5929dc425d9a9a7f8dc18b4528cc (patch) | |
| tree | 3a6f57d134927e2f507c16e9b5bbc888dc63e889 | |
| parent | 7233fd3082ac3004e1a6dfd34ee15a2d962a19e8 (diff) | |
doc: add qmllint quick attached property type warnings
Add description of the warning and an example on how to fix it.
Task-number: QTBUG-118112
Change-Id: Ic057c768945b3ef0e38ce80cd19a8ca0567c9ca5
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 93c0ef04fa0a07a2e805fccd914b7e699ee12f43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ca1a665da99f439fcaec433ecd088a73cd70da9f)
| -rw-r--r-- | src/qml/doc/src/qmllint/quick/attached-property-type.qdoc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/qml/doc/src/qmllint/quick/attached-property-type.qdoc b/src/qml/doc/src/qmllint/quick/attached-property-type.qdoc new file mode 100644 index 0000000000..493f1c1413 --- /dev/null +++ b/src/qml/doc/src/qmllint/quick/attached-property-type.qdoc @@ -0,0 +1,43 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! +\page qmllint-warnings-and-errors-quick-attached-property-type.html +\ingroup qmllint-warnings-and-errors + +\title Quick: Attached property type +\brief Misuses of the Quick attached property types. + +\section1 Attached property must be attached to an object deriving from a particular type + +\section2 What happened? +You instantiated an attached property in an object of the wrong type. + +\section2 Why is this bad? +The attached property will not work. + +\section2 Example +\qml +import QtQuick + +Item { + QtObject { + LayoutMirroring.enabled: true + } +} + +\endqml +To fix this warning, change the enclosing type to inherit from the type +mentioned in the warning message: + +\qml +import QtQuick + +Item { + Item { + LayoutMirroring.enabled: true + } +} + +\endqml +*/ |
