9 #include "visitors/AronTreeWidgetConverter.h"
10 #include "widgets/CustomWidget.h"
35 return itemValueError;
41 itemValueError |= isErrorSource;
42 transitiveValueError |= isTransitiveError;
55 else if (transitiveValueError)
60 QTreeWidgetItem::setBackground(1, QBrush(palette.color(QPalette::Base)));
70 keyValueError = hasError;
72 QTreeWidgetItem::setBackground(1, QBrush(palette.color(QPalette::Base)));
78 keyValueError =
false;
79 itemValueError =
false;
80 transitiveValueError =
false;
82 for (
int i = 0; i < childCount(); ++i)
85 arChild->resetError();
99 std::map<QString, std::vector<int>> found_keys;
100 auto numChildren = childCount();
101 for (
int i = 0; i < numChildren; ++i)
109 auto& vec = found_keys[casted->text(0)];
114 std::set<int> errorneous_indices;
115 for (
auto [key, vals] : found_keys)
127 casted->setKeyErrorState(
true);
128 errorneous_indices.emplace(i);
133 for (
int i = 0; i < numChildren; ++i)
135 if (errorneous_indices.find(i) != errorneous_indices.end())
145 casted->setKeyErrorState(
false);
152 QTreeWidgetItem* qParent = QTreeWidgetItem::parent();
155 if (changedColumn == 0)
172 preventIllegalKeyChange();
178 AronTreeWidgetItem::preventIllegalKeyChange()
182 setText(0, unchangeableKey);
190 aronType(type), col0Editable(editKey), col1Editable(editVal)
192 this->setText(0, key);
196 unchangeableKey = std::move(key);