-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpages.cpp
executable file
·67 lines (56 loc) · 1.67 KB
/
pages.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
62
63
64
65
66
67
#include"pages.h"
#include <QLabel>
#include <QLineEdit>
#include <QFont>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QSettings>
extern double A ;
extern double B ;
FormulaWidget::FormulaWidget(QWidget *parent)
:QWidget(parent)
{
QVBoxLayout* mainLayout = new QVBoxLayout(this);
QHBoxLayout* hLayout1 = new QHBoxLayout(this);
QHBoxLayout* hLayout2 = new QHBoxLayout(this);
QLabel* label = new QLabel(this);
QFont font;
font.setPointSize(20);
label->setFont(font);
label->setText("Formula: A-B*log(SUM(F));");
QLabel* label_2 = new QLabel(this);
label_2->setFont(font);
label_2->setText("A:");
QLineEdit* lineEdit = new QLineEdit(this);
QLineEdit* lineEdit_2 = new QLineEdit(this);
QLabel* label_3 = new QLabel(this);
label_3->setFont(font);
label_3->setText("B:");
lineEdit->setText(QString("%1").arg(A));
lineEdit_2->setText(QString("%1").arg(B));
mainLayout->addWidget(label);
hLayout1->addWidget(label_2);
hLayout1->addWidget(lineEdit);
hLayout2->addWidget(label_3);
hLayout2->addWidget(lineEdit_2);
mainLayout->addLayout(hLayout1);
mainLayout->addLayout(hLayout2);
connect(lineEdit,SIGNAL(textChanged(QString)),this,SLOT(lineEditAChanged(QString)));
connect(lineEdit_2,SIGNAL(textChanged(QString)),this,SLOT(lineEditBChanged(QString)));
}
void FormulaWidget::lineEditAChanged(QString var)
{
A = var.toDouble();
QSettings set ;
set.setValue("A",A);
}
void FormulaWidget::lineEditBChanged(QString var)
{
B = var.toDouble();
QSettings set ;
set.setValue("B",B);
}
CustomCurveWidget::CustomCurveWidget(QWidget *parent)
:QWidget(parent)
{
}