diff --git a/GUI/coregui/Models/SessionItem.cpp b/GUI/coregui/Models/SessionItem.cpp index b0a831b65237aeaa271b4370dfc892d924a82379..41d692723d9c171127cbc1dd556db2dc9d2ffffa 100644 --- a/GUI/coregui/Models/SessionItem.cpp +++ b/GUI/coregui/Models/SessionItem.cpp @@ -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); } diff --git a/GUI/main/main.cpp b/GUI/main/main.cpp index 6e7b4af7e6c58429a3bd4bed35bd56fa2a0ffa55..fc4ad6894f73e5ced101850808d161d32f5140b6 100644 --- a/GUI/main/main.cpp +++ b/GUI/main/main.cpp @@ -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);