Skip to content
Snippets Groups Projects
Commit b772d861 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

Additional check for equality of SessionItem's data.

parent f36718ed
No related branches found
No related tags found
No related merge requests found
......@@ -438,7 +438,6 @@ QVariant SessionItem::getItemValue(const QString &tag) const
void SessionItem::setItemValue(const QString &tag, const QVariant &variant)
{
// check if variant of previous property coincides with new one
if (!isTag(tag))
throw GUIHelpers::Error("Property not existing!");
......@@ -615,6 +614,11 @@ bool SessionItem::setValue(QVariant value)
throw GUIHelpers::Error("ParameterizedItem::setRegisteredProperty() -> Error. Type of "
"previous and new variant does not coincide.");
}
// TODO If QVariant contains ComboProperty, the comparison will be always true.
if(previous_variant == value)
return true;
return setData(Qt::DisplayRole, value);
}
......
......@@ -39,6 +39,9 @@ int main(int argc, char *argv[])
QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
qRegisterMetaType<QVector<double> >("QVector<double>");
qRegisterMetaType<FitProgressInfo>("FitProgressInfo");
// If uncomment line below, we will be able to compare QVariant containig ComboProperty
// but the program will be unstable.
// QMetaType::registerComparators<ComboProperty>();
QApplication a(argc, argv);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment