-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.cpp
45 lines (35 loc) · 999 Bytes
/
mainwindow.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
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
shortcut = new QShortcut(QKeySequence(Qt::Key_Return), this);
QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(on_calculateButton_clicked()));
shortcut2 = new QShortcut(QKeySequence(Qt::Key_Enter), this);
QObject::connect(shortcut2, SIGNAL(activated()), this, SLOT(on_calculateButton_clicked()));
}
MainWindow::~MainWindow()
{
delete shortcut;
delete shortcut2;
delete ui;
}
void MainWindow::on_calculateButton_clicked()
{
ui->solutionToGet->setValue(y*gamma/omega);
ui->waterToGet->setValue(gamma-(y*gamma/omega));
}
void MainWindow::on_inputConcentration_valueChanged(double arg1)
{
omega = arg1;
}
void MainWindow::on_neededConcentration_valueChanged(double arg1)
{
y = arg1;
}
void MainWindow::on_neededSolution_valueChanged(double arg1)
{
gamma = arg1;
}