24 #include <ArmarXGui/gui-plugins/StatechartEditorPlugin/ui_MultiProfileDefaultValueEditWidget.h>
34 typeString(typeString),
35 communicator(communicator)
42 QString jsonString = it.value();
43 if (!jsonString.isEmpty())
46 ui->splitter->addWidget(defaultEdits[it.key()].data());
50 ui->comboBoxProfiles->addItems(profileNames);
51 ui->comboBoxProfiles->setCurrentIndex(ui->comboBoxProfiles->count() - 1);
55 for (
auto name : profileNames)
57 if (defaultEdits.contains(name) && !defaultEdits[name].isNull() && defaultEdits[name]->getValueAsJson())
59 ARMARX_DEBUG << name.toStdString() <<
" contains data: " << defaultEdits[name]->getValueAsJson()->toStdString();
60 ui->comboBoxProfiles->setCurrentIndex(i);
65 delete ui->editWidget;
75 QMap<QString, VariantContainerBasePtr> result;
76 for (
auto it = defaultEdits.begin(); it != defaultEdits.end(); it++)
80 auto var = it.value().data()->getVariantContainer();
83 result[it.key()] = var;
92 QMap<QString, QString> result;
93 for (
auto it = defaultEdits.begin(); it != defaultEdits.end(); it++)
95 std::optional<QString> json = it.value()->getValueAsJson();
98 result[it.key()] = *json;
104 void MultiProfileDefaultValueEditWidget::on_comboBoxProfiles_currentIndexChanged(
const QString& arg1)
106 for (
const auto& it : defaultEdits)
114 if (!defaultEdits[arg1].isNull())
117 defaultEdits[arg1]->show();
121 defaultEdits[arg1] =
new ProfileDefaultValueEditWidget(typeString,
"", communicator,
this);
122 ui->splitter->addWidget(defaultEdits[arg1].
data());