diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2021-04-14 12:01:52 +0200 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2021-04-14 14:10:07 +0200 |
commit | 1c0e771197fc6d8341737fb4bb8446c1d8988307 (patch) | |
tree | 1442aa00240308be1ab46482750a262435714feb /tools/qmllint | |
parent | 45aa0853dae3f3068af08a6ed2d3248155e13e24 (diff) |
qmllint: Fix QQmlComponent default property incompatible type warnings
Assigning any element to a QQmlComponent property implictly wraps it into a Component.
Thus checking for compatible types does not make sense here.
Fixes: QTBUG-92571
Change-Id: Id72f69d30d8506193c52a51b038b9c218ac85917
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmllint')
-rw-r--r-- | tools/qmllint/findwarnings.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/qmllint/findwarnings.cpp b/tools/qmllint/findwarnings.cpp index 3f0c992fd3..dd7e3596af 100644 --- a/tools/qmllint/findwarnings.cpp +++ b/tools/qmllint/findwarnings.cpp @@ -176,6 +176,10 @@ void FindWarningVisitor::checkDefaultProperty(const QQmlJSScope::ConstPtr &scope if (!propType) // should be an error somewhere else return; + // Assigning any element to a QQmlComponent property implicitly wraps it into a Component + if (defaultProp.typeName() == QStringLiteral("QQmlComponent")) + return; + // scope's type hierarchy has to have property type for (const QQmlJSScope *type = scope.data(); type; type = type->baseType().data()) { if (type == propType) |