forked from qt-creator/qt-creator
QmlDesigner.TextToModelMerger: Fixing comparison of QVariant
n the case of custom types, their equalness operators are not called. Instead the values' addresses are compared. This is not want we want. Instead we have to cast and compare our custom types manually. This fixed a couple of QTC_ASSERTS. Change-Id: I3a82b84744f9b8860b7efaeb203475bb9dba5d11 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
This commit is contained in:
@@ -671,6 +671,8 @@ static inline bool smartVeryFuzzyCompare(QVariant value1, QVariant value2)
|
||||
|
||||
static inline bool equals(const QVariant &a, const QVariant &b)
|
||||
{
|
||||
if (a.canConvert<Enumeration>() && b.canConvert<Enumeration>())
|
||||
return a.value<Enumeration>().toString() == b.value<Enumeration>().toString();
|
||||
if (a == b)
|
||||
return true;
|
||||
if (smartVeryFuzzyCompare(a, b))
|
||||
|
||||
Reference in New Issue
Block a user