aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmllint/quick/quicklintplugin.cpp
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2022-08-23 14:38:59 +0200
committerUlf Hermann <[email protected]>2022-08-29 13:20:28 +0200
commitcc89f62851ce1b9f859e9bc43415d4ce7e3a36e2 (patch)
tree80bc126e403cb96d4ddec6d8b74522990e673dc0 /src/plugins/qmllint/quick/quicklintplugin.cpp
parent88aef52989ca86aecd2c09e2d54b804f5d8b0aad (diff)
qmllint: Don't warn about access to attached enums
You can always access enums of attached objects, no matter what other rules apply to the attached properties. Pick-to: 6.4 Fixes: QTBUG-105590 Change-Id: I07878d8efe63468539168aa2c2842e3159ed2090 Reviewed-by: Sami Shalayel <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'src/plugins/qmllint/quick/quicklintplugin.cpp')
-rw-r--r--src/plugins/qmllint/quick/quicklintplugin.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/qmllint/quick/quicklintplugin.cpp b/src/plugins/qmllint/quick/quicklintplugin.cpp
index 49db324b28..29703c50db 100644
--- a/src/plugins/qmllint/quick/quicklintplugin.cpp
+++ b/src/plugins/qmllint/quick/quicklintplugin.cpp
@@ -144,10 +144,10 @@ void AttachedPropertyTypeValidatorPass::onRead(const QQmlSA::Element &element,
const QQmlSA::Element &readScope,
QQmlJS::SourceLocation location)
{
- Q_UNUSED(readScope)
- Q_UNUSED(propertyName)
-
- checkWarnings(element, readScope, location);
+ // If the attachment does not have such a property or method then
+ // it's either a more general error or an enum. Enums are fine.
+ if (element->hasProperty(propertyName) || element->hasMethod(propertyName))
+ checkWarnings(element, readScope, location);
}
void AttachedPropertyTypeValidatorPass::onWrite(const QQmlSA::Element &element,