8 #include "../ColorPalettes.h"
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();
100 std::map<QString, std::vector<int>> found_keys;
101 auto numChildren = childCount();
102 for (
int i = 0; i < numChildren; ++i)
110 auto& vec = found_keys[casted->text(0)];
115 std::set<int> errorneous_indices;
116 for (
auto [key, vals] : found_keys)
128 casted->setKeyErrorState(
true);
129 errorneous_indices.emplace(i);
134 for (
int i = 0; i < numChildren; ++i)
136 if (errorneous_indices.find(i) != errorneous_indices.end())
146 casted->setKeyErrorState(
false);
153 QTreeWidgetItem* qParent = QTreeWidgetItem::parent();
156 if (changedColumn == 0)
173 preventIllegalKeyChange();
179 AronTreeWidgetItem::preventIllegalKeyChange()
183 setText(0, unchangeableKey);
191 aronType(type), col0Editable(editKey), col1Editable(editVal)
193 this->setText(0, key);
197 unchangeableKey = std::move(key);