QmlJS: Fix false positives for Connections

Connections and ListElement are in the QtQml scope,
when using type information from Qt kit.

Change-Id: I6236a317117e15f4b68c0642186bfdb91d0c92db
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Christian Kamm <mail@ckamm.de>
This commit is contained in:
Thomas Hartmann
2020-06-24 19:34:31 +02:00
parent 3dc946374b
commit ad17ea9611

View File

@@ -176,10 +176,10 @@ void ScopeBuilder::setQmlScopeObject(Node *node)
while (iter.hasNext()) {
const ObjectValue *prototype = iter.next();
if (const CppComponentValue *qmlMetaObject = value_cast<CppComponentValue>(prototype)) {
if ((qmlMetaObject->className() == QLatin1String("ListElement")
|| qmlMetaObject->className() == QLatin1String("Connections")
) && (qmlMetaObject->moduleName() == QLatin1String("Qt")
|| qmlMetaObject->moduleName() == QLatin1String("QtQuick"))) {
if ((qmlMetaObject->className() == "ListElement"
|| qmlMetaObject->className() == "Connections")
&& (qmlMetaObject->moduleName() == "Qt" || qmlMetaObject->moduleName() == "QtQml"
|| qmlMetaObject->moduleName() == "QtQuick")) {
qmlScopeObjects.clear();
break;
}