AppFwk: Addjust default implementation of equal comparisons for QVariant encapsuled field content types that are not directly supported by Qt.

Should now work in most cases, where as it always returned "false" before this fix
This commit is contained in:
Jacob Støren 2017-09-23 07:23:09 +02:00
parent b28bcaa4e4
commit f4eadc5cef

View File

@ -45,7 +45,14 @@ public:
/// This is needed for the lookup regarding OptionValues
static bool isDataElementEqual(const QVariant& variantValue, const QVariant& variantValue2)
{
return variantValue == variantValue2;
if (variantValue.type() == QVariant::UserType)
{
return (variantValue.value<T>() == variantValue2.value<T>());
}
else
{
return variantValue == variantValue2;
}
}
/// Methods to get a list of options for a field, specialized for AppEnum