15 for (
int i=0; i<formdata->keys().size(); i++)
17 if (formdata->value(formdata->keys()[i]).isObject())
19 QJsonObject
object = formdata->value(formdata->keys()[i]).toObject();
20 formdata->value(formdata->keys()[i]).toObject();
23 parameter_prop.
DefaultValue =
object.value(
"default").toString();
24 if (
object.contains(
"type"))
26 if (
object[
"type"].toString()!=
"Description")
28 QLabel *label =
new QLabel(parameter_prop.
Discription,
this);
29 QString typeval =
object.value(
"type").toString();
30 if (
object.value(
"type").toString()==
"spinBox")
33 QSpinBox *spinbox =
new QSpinBox(
this);
35 if (
object.contains(
"minimum"))
36 spinbox->setMinimum(
object.value(
"minimum").toString().toInt());
37 if (
object.contains(
"maximum"))
38 spinbox->setMaximum(
object.value(
"maximum").toString().toInt());
39 spinbox->setValue(
object.value(
"default").toString().toInt());
40 ui->formLayout->addRow(label,spinbox);
43 if (
object.value(
"type").toString()==
"lineEdit")
46 QLineEdit *lineedit =
new QLineEdit(
this);
47 lineedit->setText(
object.value(
"default").toString());
48 ui->formLayout->addRow(label,lineedit);
51 if (
object.value(
"type").toString()==
"comboBox")
54 QComboBox *combobox =
new QComboBox(
this);
55 combobox->setCurrentText(
object.value(
"default").toString());
56 ui->formLayout->addRow(label,combobox);
59 if (
object.value(
"source").toString().contains(
"Blank"))
61 combobox->addItem(
"");
63 if (
object.value(
"source").toString().contains(
"TargetSamplesList"))
66 for (
unsigned int i=0; i<names.size(); i++)
67 combobox->addItem(QString::fromStdString(names[i]));
69 if (
object.value(
"source").toString().contains(
"ElementsList"))
72 for (
unsigned int i=0; i<names.size(); i++)
73 combobox->addItem(QString::fromStdString(names[i]),QString::fromStdString(names[i]));
76 if (
object.value(
"source").toString().contains(
"SourceList"))
79 for (
unsigned int i=0; i<names.size(); i++)
80 combobox->addItem(QString::fromStdString(names[i]),QString::fromStdString(names[i]));
83 if (
object.value(
"source").toString().contains(
"Items:"))
85 QStringList items =
object.value(
"source").toString().split(
":")[1].split(
",");
86 combobox->addItems(items);
88 if (
object.value(
"source").toString().contains(
"OM"))
90 QString element = QString::fromStdString(
mainwindow()->Data()->FirstOMConstituent());
92 combobox->setCurrentIndex(combobox->findText(element));
93 int i = combobox->findText(element);
96 if (
object.value(
"source").toString().contains(
"Size"))
98 QString element = QString::fromStdString(
mainwindow()->Data()->FirstSizeConstituent());
100 combobox->setCurrentIndex(combobox->findText(element));
101 int i = combobox->findText(element);
106 if (
object.value(
"type").toString()==
"fileBrowser_Save")
111 filebrowserpushbuttom->setText(
object.value(
"default").toString());
112 ui->formLayout->addRow(label,filebrowserpushbuttom);
113 parameter_prop.
InputWidget = filebrowserpushbuttom;
116 if (
object.value(
"type").toString()==
"fileBrowser_Open")
121 filebrowserpushbuttom->setText(
object.value(
"default").toString());
122 ui->formLayout->addRow(label,filebrowserpushbuttom);
123 parameter_prop.
InputWidget = filebrowserpushbuttom;
126 if (
object.value(
"type").toString()==
"checkBox")
129 QCheckBox *checkbox =
new QCheckBox(
this);
130 if (
object.value(
"default").toString().toLower()==
"true")
131 checkbox->setCheckState(Qt::CheckState::Checked);
133 checkbox->setCheckState(Qt::CheckState::Unchecked);
134 ui->formLayout->addRow(label,checkbox);
143 for (
int i=0; i<formdata->keys().size(); i++)
145 if (formdata->value(formdata->keys()[i]).isObject())
147 QJsonObject
object = formdata->value(formdata->keys()[i]).toObject();
148 formdata->value(formdata->keys()[i]).toObject();
151 parameter_prop.
DefaultValue =
object.value(
"default").toString();
152 if (
object.contains(
"type"))
156 if (
object[
"type"].toString()==
"Description")
157 label =
new QLabel(parameter_prop.
Discription,
this);
158 QString typeval =
object.value(
"type").toString();
159 if (
object.value(
"type").toString()==
"Description")
162 QTextBrowser *textBrowswer =
new QTextBrowser(
this);
163 textBrowswer->insertHtml(
object.value(
"default").toString());
164 ui->formLayout->addRow(label,textBrowswer);
171 buttonOk =
new QPushButton(
"Ok",
this);
172 QIcon iconOk = QIcon(qApp->applicationDirPath()+
"/../../resources/Icons/Proceed.png");
177 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, std::map< std::string, std::string > arguments)
Executes a specified analysis command.