10 const std::string& label,
12 QTreeWidget* parent) :
18 widget.groupBoxInput->setTitle(QString::fromStdString(label));
22 connect(widget.pushButtonAddElement,
23 &QPushButton::clicked,
25 &AronTreeWidgetDictInputModalController::addEmptyElement);
27 connect(widget.pushButtonReset,
28 &QPushButton::clicked,
30 &AronTreeWidgetDictInputModalController::reset);
31 connect(widget.pushButtonSubmit,
32 &QPushButton::clicked,
34 &AronTreeWidgetDictInputModalController::submit);
38 AronTreeWidgetDictInputModalController::submit()
40 for (
const auto& added : addedItems)
49 AronTreeWidgetDictInputModalController::reset()
54 widget.treeWidgetDict->clear();
55 for (
int i = 0; i <
init.childCount(); ++i)
57 auto el =
init.child(i);
58 widget.treeWidgetDict->addTopLevelItem(el->clone());
63 AronTreeWidgetDictInputModalController::addEmptyElement()
65 QString
s = widget.lineEditKey->text();
66 widget.lineEditKey->setText(
"Enter Key");
68 if (widget.treeWidgetDict->findItems(s, Qt::MatchFlag::MatchExactly, 0).empty())
70 auto t =
item->aronType;
72 auto ac = d->getAcceptedType();
74 AronTreeWidgetCreatorVisitor
v(
nullptr);
75 v.setTopLevelWidget(widget.treeWidgetDict);
78 if (
v.createdQWidgetItem)
82 addedItems.push_back(
v.createdQWidgetItem);
83 widget.treeWidgetDict->addTopLevelItem(
v.createdQWidgetItem);
static std::shared_ptr< Dict > DynamicCastAndCheck(const VariantPtr &n)
void visit(VisitorImplementation &v, typename VisitorImplementation::Input &t)
The visit function.
double s(double t, double s0, double v0, double a0, double j)
double v(double t, double v0, double a0, double j)
This file offers overloads of toIce() and fromIce() functions for STL container types.