5 #include "visitors/AronTreeWidgetContextMenu.h"
6 #include "visitors/AronTreeWidgetConverter.h"
7 #include "visitors/AronTreeWidgetSetter.h"
13 QTreeWidgetItem* parent,
16 parent(parent), tree(tree), type(type)
19 SIGNAL(customContextMenuRequested(
const QPoint&)),
23 &QTreeWidget::itemDoubleClicked,
25 &AronTreeWidgetController::onTreeWidgetItemDoubleClicked);
30 v.setTopLevelWidget(tree);
46 new QTreeWidgetItem(parent, {QString::fromStdString(
"No args")});
51 &QTreeWidget::itemChanged,
53 &AronTreeWidgetController::onTreeWidgetItemChanged);
82 tree->blockSignals(
true);
84 auto idx = tree->indexAt(pos);
94 tree->blockSignals(
false);
97 AronTreeWidgetController::onTreeWidgetItemDoubleClicked(QTreeWidgetItem* item,
int column)
103 tree->blockSignals(
true);
106 if (column == 1 && aronItem)
113 AronTreeWidgetModalCreatorVisitor
v(name, aronItem, tree);
115 auto modal =
v.createdModal;
122 else if (aronItem->col1Editable)
124 item->treeWidget()->editItem(item, column);
127 else if (column == 0 && aronItem && aronItem->col0Editable)
129 item->treeWidget()->editItem(item, column);
132 tree->blockSignals(
false);
136 AronTreeWidgetController::onTreeWidgetItemChanged(QTreeWidgetItem* item,
int column)
138 tree->blockSignals(
true);
143 aronElem->onUserChange(column);
146 if (parent->childCount() == 1)
149 aronTreeRoot->resetError();
152 AronTreeWidgetConverterVisitor
v(parent, 0);
154 aronTreeRoot->setValueErrorState(
v.hasDirectError(),
v.onlyChildFailedConversion());
159 tree->blockSignals(
false);