-
Notifications
You must be signed in to change notification settings - Fork 5
/
ExportDialog.cpp
61 lines (51 loc) · 1.63 KB
/
ExportDialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "ExportDialog.h"
#include "ui_ExportDialog.h"
struct ExportDialog::Internals
{
Ui::ExportDialog Ui;
};
ExportDialog::ExportDialog(QWidget* const parent) :
QDialog(parent),
m_Internals(new ExportDialog::Internals)
{
m_Internals->Ui.setupUi(this);
connect(m_Internals->Ui.ButtonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_Internals->Ui.ButtonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(m_Internals->Ui.PlotsList, &QListWidget::itemChanged,
this, [this](QListWidgetItem* item)
{
if (item->checkState() == Qt::Checked)
{
item->setBackgroundColor(QColor("#ffffb2"));
}
else
{
item->setBackgroundColor(QColor("#ffffff"));
}
});
QStringList plotsList;
plotsList << "Horizontal Plot" << "Vertical Plot" << "Waterfall Plot";
m_Internals->Ui.PlotsList->addItems(plotsList);
for (int i = 0; i < m_Internals->Ui.PlotsList->count(); ++i)
{
QListWidgetItem* item = m_Internals->Ui.PlotsList->item(i);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(Qt::Unchecked);
}
}
ExportDialog::~ExportDialog()
{
delete m_Internals;
}
bool ExportDialog::getExportHorizontalCurve() const
{
return m_Internals->Ui.PlotsList->item(0)->checkState() == Qt::Checked;
}
bool ExportDialog::getExportVerticalCurve() const
{
return m_Internals->Ui.PlotsList->item(1)->checkState() == Qt::Checked;
}
bool ExportDialog::getExportWaterfallCurve() const
{
return m_Internals->Ui.PlotsList->item(2)->checkState() == Qt::Checked;
}