QmlDesigner: Use simplifiedTypeName instead of qualfiedTypeName

This reduced the number of corner cases.

Change-Id: I12f6622577caf3b5e661cbe13479893d37f02dc3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Thomas Hartmann
2024-03-04 15:13:55 +01:00
parent 88c52f0c25
commit 61038a42f1

View File

@@ -3027,11 +3027,9 @@ bool NodeMetaInfo::isQmlComponent() const
if (!isValid()) if (!isValid())
return false; return false;
auto type = m_privateData->qualfiedTypeName(); auto type = simplifiedTypeName();
return type == "Component" || type == "Qt.Component" || type == "QtQuick.Component" return type == "Component" || type == "QQmlComponent";
|| type == "QtQml.Component" || type == "<cpp>.QQmlComponent" || type == "QQmlComponent"
|| type == "QML.Component" || type == "QtQml.Base.Component";
} }
} }
@@ -3041,7 +3039,7 @@ bool NodeMetaInfo::isFont() const
using namespace Storage::Info; using namespace Storage::Info;
return isValid() && isTypeId(m_typeId, m_projectStorage->commonTypeId<QtQuick, font>()); return isValid() && isTypeId(m_typeId, m_projectStorage->commonTypeId<QtQuick, font>());
} else { } else {
return isValid() && m_privateData->qualfiedTypeName() == "font"; return isValid() && simplifiedTypeName() == "font";
} }
} }
@@ -3054,9 +3052,9 @@ bool NodeMetaInfo::isColor() const
if (!isValid()) if (!isValid())
return false; return false;
auto type = m_privateData->qualfiedTypeName(); auto type = simplifiedTypeName();
return type == "QColor" || type == "color" || type == "QtQuick.color"; return type == "QColor" || type == "color" || type == "color";
} }
} }