QmlDesigner: Use simplfied type name to avoid ambiguities

Types can be prefixed with QtQuick. or <cpp>.

Task-number: QDS-8947
Change-Id: If2b1423d6a08a9e083f6abeeca62be690ce20d3e
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
Thomas Hartmann
2023-01-26 13:18:52 +01:00
parent 751bb8df08
commit 03f9b2ecf6

View File

@@ -2564,7 +2564,7 @@ bool NodeMetaInfo::isBool() const
if (!isValid()) if (!isValid())
return false; return false;
auto type = m_privateData->qualfiedTypeName(); auto type = simplifiedTypeName();
return type == "bool" || type == "boolean"; return type == "bool" || type == "boolean";
} }
@@ -2579,7 +2579,7 @@ bool NodeMetaInfo::isInteger() const
if (!isValid()) if (!isValid())
return false; return false;
auto type = m_privateData->qualfiedTypeName(); auto type = simplifiedTypeName();
return type == "int" || type == "integer"; return type == "int" || type == "integer";
} }
@@ -2597,7 +2597,7 @@ bool NodeMetaInfo::isFloat() const
if (!isValid()) if (!isValid())
return false; return false;
auto type = m_privateData->qualfiedTypeName(); auto type = simplifiedTypeName();
return type == "qreal" || type == "double" || type == "float"; return type == "qreal" || type == "double" || type == "float";
} }
@@ -2609,7 +2609,7 @@ bool NodeMetaInfo::isVariant() const
using namespace Storage::Info; using namespace Storage::Info;
return isTypeId(m_typeId, m_projectStorage->builtinTypeId<QVariant>()); return isTypeId(m_typeId, m_projectStorage->builtinTypeId<QVariant>());
} else { } else {
return isValid() && m_privateData->qualfiedTypeName() == "QVariant"; return isValid() && simplifiedTypeName() == "QVariant";
} }
} }
@@ -2622,7 +2622,7 @@ bool NodeMetaInfo::isString() const
if (!isValid()) if (!isValid())
return false; return false;
auto type = m_privateData->qualfiedTypeName(); auto type = simplifiedTypeName();
return type == "string" || type == "QString"; return type == "string" || type == "QString";
} }