18 for (
int i=0; i<formdata->keys().size(); i++)
20 if (formdata->value(formdata->keys()[i]).isObject())
22 QJsonObject
object = formdata->value(formdata->keys()[i]).toObject();
23 formdata->value(formdata->keys()[i]).toObject();
25 parameter_prop.
Name = formdata->keys()[i];
26 parameter_prop.
DefaultValue =
object.value(
"default").toString();
27 if (
object.contains(
"type"))
29 if (
object[
"type"].toString()!=
"Description")
31 QLabel *label =
new QLabel(parameter_prop.
Name,
this);
32 QString typeval =
object.value(
"type").toString();
33 if (
object.value(
"type").toString()==
"spinBox")
36 QSpinBox *spinbox =
new QSpinBox(
this);
38 if (
object.contains(
"minimum"))
39 spinbox->setMinimum(
object.value(
"minimum").toString().toInt());
40 if (
object.contains(
"maximum"))
41 spinbox->setMaximum(
object.value(
"maximum").toString().toInt());
42 spinbox->setValue(
object.value(
"default").toString().toInt());
43 ui->formLayout->addRow(label,spinbox);
46 if (
object.value(
"type").toString()==
"lineEdit")
49 QLineEdit *lineedit =
new QLineEdit(
this);
50 lineedit->setText(
object.value(
"default").toString());
51 ui->formLayout->addRow(label,lineedit);
54 if (
object.value(
"type").toString()==
"comboBox")
57 QComboBox *combobox =
new QComboBox(
this);
58 combobox->setCurrentText(
object.value(
"default").toString());
59 ui->formLayout->addRow(label,combobox);
62 if (
object.value(
"source").toString().contains(
"Blank"))
64 combobox->addItem(
"");
66 if (
object.value(
"source").toString().contains(
"TargetSamplesList"))
69 for (
unsigned int i=0; i<names.size(); i++)
70 combobox->addItem(QString::fromStdString(names[i]));
72 if (
object.value(
"source").toString().contains(
"ElementsList"))
75 for (
unsigned int i=0; i<names.size(); i++)
76 combobox->addItem(QString::fromStdString(names[i]),QString::fromStdString(names[i]));
79 if (
object.value(
"source").toString().contains(
"SourceList"))
82 for (
unsigned int i=0; i<names.size(); i++)
83 combobox->addItem(QString::fromStdString(names[i]),QString::fromStdString(names[i]));
86 if (
object.value(
"source").toString().contains(
"Items:"))
88 QStringList items =
object.value(
"source").toString().split(
":")[1].split(
",");
89 combobox->addItems(items);
91 if (
object.value(
"source").toString().contains(
"OM"))
93 QString element = QString::fromStdString(
mainwindow()->Data()->FirstOMConstituent());
95 combobox->setCurrentIndex(combobox->findText(element));
97 if (
object.value(
"source").toString().contains(
"Size"))
99 QString element = QString::fromStdString(
mainwindow()->Data()->FirstSizeConstituent());
101 combobox->setCurrentIndex(combobox->findText(element));
105 if (
object.value(
"type").toString()==
"fileBrowser_Save")
110 filebrowserpushbutton->setText(
object.value(
"default").toString());
111 ui->formLayout->addRow(label,filebrowserpushbutton);
112 parameter_prop.
InputWidget = filebrowserpushbutton;
115 if (
object.value(
"type").toString()==
"fileBrowser_Open")
120 filebrowserpushbutton->setText(
object.value(
"default").toString());
121 ui->formLayout->addRow(label,filebrowserpushbutton);
122 parameter_prop.
InputWidget = filebrowserpushbutton;
125 if (
object.value(
"type").toString()==
"checkBox")
128 QCheckBox *checkbox =
new QCheckBox(
this);
129 if (
object.value(
"default").toString().toLower()==
"true")
130 checkbox->setCheckState(Qt::CheckState::Checked);
132 checkbox->setCheckState(Qt::CheckState::Unchecked);
133 ui->formLayout->addRow(label,checkbox);
142 for (
int i=0; i<formdata->keys().size(); i++)
144 if (formdata->value(formdata->keys()[i]).isObject())
146 QJsonObject
object = formdata->value(formdata->keys()[i]).toObject();
147 formdata->value(formdata->keys()[i]).toObject();
149 parameter_prop.
Name = formdata->keys()[i];
150 parameter_prop.
DefaultValue =
object.value(
"default").toString();
151 if (
object.contains(
"type"))
154 QLabel *label =
nullptr;
155 if (
object[
"type"].toString()==
"Description")
156 label =
new QLabel(parameter_prop.
Name,
this);
157 QString typeval =
object.value(
"type").toString();
158 if (
object.value(
"type").toString()==
"Description")
161 QTextBrowser *textBrowswer =
new QTextBrowser(
this);
162 textBrowswer->insertHtml(
object.value(
"default").toString());
163 ui->formLayout->addRow(label,textBrowswer);
170 buttonOk =
new QPushButton(
"Ok",
this);
171 QIcon iconOk = QIcon(qApp->applicationDirPath()+
"/../../resources/Icons/Proceed.png");
176 QIcon iconCancel = QIcon(qApp->applicationDirPath()+
"/../../resources/Icons/Cancel.png");
Main application window for SedSAT3 source apportionment analysis.
SourceSinkData * Data()
Returns pointer to the main data collection.
bool Execute(const std::string &command, const std::map< std::string, std::string > &arguments)
Executes a specified analysis command.