-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Amine Mzoughi
committed
Jan 24, 2020
1 parent
1529e6a
commit e7e43a5
Showing
7 changed files
with
281 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef EXPORTDIALOG_H | ||
#define EXPORTDIALOG_H | ||
|
||
#include <QDialog> | ||
|
||
class ExportDialog : public QDialog | ||
{ | ||
Q_OBJECT | ||
typedef QDialog Superclass; | ||
|
||
public: | ||
explicit ExportDialog(QWidget* const parent = nullptr); | ||
~ExportDialog() override; | ||
|
||
bool getExportWaterfallCurve() const; | ||
bool getExportHorizontalCurve() const; | ||
bool getExportVerticalCurve() const; | ||
|
||
private: | ||
Q_DISABLE_COPY(ExportDialog) | ||
|
||
struct Internals; | ||
Internals* m_Internals; | ||
}; | ||
|
||
#endif // EXPORTDIALOG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>ExportDialog</class> | ||
<widget class="QDialog" name="ExportDialog"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Plots to export</string> | ||
</property> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<item> | ||
<widget class="QListWidget" name="PlotsList"/> | ||
</item> | ||
<item> | ||
<widget class="QDialogButtonBox" name="ButtonBox"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="standardButtons"> | ||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections> | ||
<connection> | ||
<sender>ButtonBox</sender> | ||
<signal>accepted()</signal> | ||
<receiver>ExportDialog</receiver> | ||
<slot>accept()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>248</x> | ||
<y>254</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>157</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>ButtonBox</sender> | ||
<signal>rejected()</signal> | ||
<receiver>ExportDialog</receiver> | ||
<slot>reject()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>316</x> | ||
<y>260</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>286</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
</connections> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.