-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmathopepanel.cpp
More file actions
43 lines (37 loc) · 1.05 KB
/
mathopepanel.cpp
File metadata and controls
43 lines (37 loc) · 1.05 KB
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
#include "mathopepanel.h"
#include "ui_mathopepanel.h"
MathOpePanel::MathOpePanel(QWidget *parent, QStringList graphNames) :
QDialog(parent),
ui(new Ui::MathOpePanel)
{
// map to ui
ui->setupUi(this);
nameFormFst = ui->nameFormFst;
nameFormSnd = ui->nameFormSnd;
mathOpeEdit = ui->mathOpeEdit;
newPlotNameEdit = ui->newPlotNameEdit;
yesBtn = ui->yesBtn;
cancelBtn = ui->cancelBtn;
// connect
connect(yesBtn, SIGNAL(clicked()), this, SLOT(yesExit()));
connect(cancelBtn, SIGNAL(clicked()), this, SLOT(cancelExit()));
// init content config
nameFormFst->addItems(graphNames);
nameFormSnd->addItems(graphNames);
}
void MathOpePanel::yesExit()
{
QString func = mathOpeEdit->text();
QString newPlotName = newPlotNameEdit->text();
if(func=="" || newPlotName=="") return;
emit sendMathOpeInfo(nameFormFst->currentIndex(),nameFormSnd->currentIndex(),newPlotName,func);
this->close();
}
void MathOpePanel::cancelExit()
{
this->close();
}
MathOpePanel::~MathOpePanel()
{
delete ui;
}