SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
indicatesheetsdialog.cpp
Go to the documentation of this file.
2#include "ui_indicatesheetsdialog.h"
3#include "qlabel.h"
4#include "qgroupbox.h"
5#include "QRadioButton"
6#include "QDebug"
7#include "mainwindow.h"
8
10 QDialog(parent),
12{
13 ui->setupUi(this);
14 connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
15 connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
16}
17
22
23void IndicateSheetsDialog::Populate_Table(const QStringList &sheets)
24{
25 for (int i=0; i<sheets.count(); i++)
26 {
27 QLabel *label = new QLabel(ui->scrollAreaWidgetContents);
28 label->setText(sheets[i]);
29 group_names<<sheets[i];
30 ui->formLayout->setWidget(i, QFormLayout::LabelRole, label);
31
32 QGroupBox *groupBox = new QGroupBox(ui->scrollAreaWidgetContents);
33 groupBox->setObjectName(QString::fromUtf8("groupBox"));
34
35 QHBoxLayout *horizontalLayout = new QHBoxLayout(groupBox);
36 horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
37 QRadioButton* radioButton_mixture = new QRadioButton(groupBox);
38 radioButton_mixture->setObjectName(QString::fromUtf8("Target"));
39 radioButton_mixture->setText("Target");
40 horizontalLayout->addWidget(radioButton_mixture);
41 radio_buttons_sinks.append(radioButton_mixture);
42 QRadioButton* radioButton_source = new QRadioButton(groupBox);
43 radioButton_source->setObjectName(QString::fromUtf8("Source"));
44 radioButton_source->setText("Source");
45 horizontalLayout->addWidget(radioButton_source);
46 radio_buttons_sources.append(radioButton_source);
47
48 radioButton_source->setChecked(i!=0);
49 radioButton_mixture->setChecked(i==0);
50 connect(radioButton_mixture,SIGNAL(clicked()),this, SLOT(on_radio_button_changed()));
51 connect(radioButton_source,SIGNAL(clicked()),this, SLOT(on_radio_button_changed()));
52 ui->formLayout->setWidget(i, QFormLayout::FieldRole, groupBox);
53
54 }
55}
56
58{
59 QDialog::reject();
60}
62{
63 for (int i=0; i<radio_buttons_sinks.count(); i++)
64 {
65 if (radio_buttons_sinks[i]->isChecked())
66 { dynamic_cast<MainWindow*>(parent())->SetSinkSheet(i);
67 dynamic_cast<MainWindow*>(parent())->Data()->SetTargetGroup(group_names[i].toStdString());
68 }
69 }
70 QDialog::accept();
71}
72
74{
75 if (dynamic_cast<QRadioButton*>(sender())->text()=="Target" && dynamic_cast<QRadioButton*>(sender())->isChecked())
76 {
77 for (int i=0; i<radio_buttons_sinks.count(); i++)
78 {
79 if (radio_buttons_sinks[i]!=sender())
80 {
81 radio_buttons_sinks[i]->setChecked(false);
82 radio_buttons_sources[i]->setChecked(true);
83 }
84
85 }
86 }
87}
Ui::IndicateSheetsDialog * ui
QList< QRadioButton * > radio_buttons_sinks
QList< QRadioButton * > radio_buttons_sources
void Populate_Table(const QStringList &sheets)
IndicateSheetsDialog(QWidget *parent=nullptr)
Main application window for SedSAT3 source apportionment analysis.
Definition mainwindow.h:41