forked from qt-creator/qt-creator
QmlDesigner: Optimize condition
isBasedOn() handles equality. This already handles equality of types. Change-Id: If03e083ff6e3446341a37b8fd8fd8978bfc20666 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
committed by
Thomas Hartmann
parent
4d93a8b663
commit
9e995fe801
@@ -177,10 +177,8 @@ bool isType(const TypeName &first, const TypeName &second, const Tuple &...types
|
|||||||
bool compareTypes(const NodeMetaInfo &sourceType, const NodeMetaInfo &targetType)
|
bool compareTypes(const NodeMetaInfo &sourceType, const NodeMetaInfo &targetType)
|
||||||
{
|
{
|
||||||
#ifdef QDS_USE_PROJECTSTORAGE
|
#ifdef QDS_USE_PROJECTSTORAGE
|
||||||
return targetType.isVariant() || sourceType.isVariant() || targetType == sourceType
|
return targetType.isVariant() || sourceType.isVariant()
|
||||||
|| (targetType.isNumber() && sourceType.isNumber())
|
|| (targetType.isNumber() && sourceType.isNumber()) || sourceType.isBasedOn(targetType);
|
||||||
|| (targetType.isColor() && sourceType.isColor())
|
|
||||||
|| (targetType.isString() && sourceType.isString());
|
|
||||||
#else
|
#else
|
||||||
const TypeName source = sourceType.simplifiedTypeName();
|
const TypeName source = sourceType.simplifiedTypeName();
|
||||||
const TypeName target = targetType.simplifiedTypeName();
|
const TypeName target = targetType.simplifiedTypeName();
|
||||||
|
Reference in New Issue
Block a user