5 #include "visitors/AronTreeWidgetContextMenu.h"
6 #include "visitors/AronTreeWidgetConverter.h"
7 #include "visitors/AronTreeWidgetSetter.h"
12 QTreeWidgetItem* parent,
15 parent(parent), tree(tree), type(type)
18 SIGNAL(customContextMenuRequested(
const QPoint&)),
22 &QTreeWidget::itemDoubleClicked,
24 &AronTreeWidgetController::onTreeWidgetItemDoubleClicked);
29 v.setTopLevelWidget(tree);
45 new QTreeWidgetItem(parent, {QString::fromStdString(
"No args")});
50 &QTreeWidget::itemChanged,
52 &AronTreeWidgetController::onTreeWidgetItemChanged);
82 tree->blockSignals(
true);
84 auto idx = tree->indexAt(pos);
94 tree->blockSignals(
false);
98 AronTreeWidgetController::onTreeWidgetItemDoubleClicked(QTreeWidgetItem* item,
int column)
104 tree->blockSignals(
true);
107 if (column == 1 && aronItem)
116 auto modal =
v.createdModal;
123 else if (aronItem->col1Editable)
125 item->treeWidget()->editItem(item, column);
128 else if (column == 0 && aronItem && aronItem->col0Editable)
130 item->treeWidget()->editItem(item, column);
133 tree->blockSignals(
false);
137 AronTreeWidgetController::onTreeWidgetItemChanged(QTreeWidgetItem* item,
int column)
139 tree->blockSignals(
true);
144 aronElem->onUserChange(column);
147 if (parent->childCount() == 1)
150 aronTreeRoot->resetError();
153 AronTreeWidgetConverterVisitor
v(parent, 0);
155 aronTreeRoot->setValueErrorState(
v.hasDirectError(),
v.onlyChildFailedConversion());
160 tree->blockSignals(
false);