QmlDesigner: Do not compare type names for file components

For file components the fully qualified type name is not properly
defined and the component is created from source anyway.

Task-number: QDS-7992
Change-Id: I2c2754c1bab53257a210c2e4de990a0a768618a3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Thomas Hartmann
2022-10-18 16:47:11 +02:00
parent edd07ff986
commit 3be3663bf7
2 changed files with 5 additions and 1 deletions

View File

@@ -827,6 +827,8 @@ NodeMetaInfoPrivate::NodeMetaInfoPrivate(Model *model, TypeName type, int maj, i
if (importInfo.type() == ImportType::Library) {
m_majorVersion = importInfo.version().majorVersion();
m_minorVersion = importInfo.version().minorVersion();
} else {
m_isFileComponent = true;
}
m_qualfiedTypeName = getUnqualifiedName(m_qualfiedTypeName);
@@ -835,6 +837,8 @@ NodeMetaInfoPrivate::NodeMetaInfoPrivate(Model *model, TypeName type, int maj, i
|| importInfo.type() == ImportType::Directory);
if (prepandName)
m_qualfiedTypeName.prepend(importInfo.name().toUtf8() + '.');
m_qualfiedTypeName.replace("/", ".");
}
m_objectValue = getObjectValue();

View File

@@ -531,7 +531,7 @@ public:
qDebug() << metaInfo.isValid() << metaInfo.typeName();
qDebug() << metaInfo.directSuperClass().typeName();
if (!typeName.startsWith("...") && m_model == m_model->metaInfoProxyModel()
if (!metaInfo.isFileComponent() && m_model == m_model->metaInfoProxyModel()
&& metaInfo.isValid())
throw RewritingException(__LINE__, __FUNCTION__, __FILE__, "test", "test");
}