forked from Lucky-spirit/Financial-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevgrow.cpp
More file actions
112 lines (93 loc) · 2.05 KB
/
evgrow.cpp
File metadata and controls
112 lines (93 loc) · 2.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#include "evgrow.h"
// Supporting comment
#include <iostream>
EvgRow::EvgRow(QWidget *parent) :
QWidget(parent)
{
}
EvgRow::~EvgRow()
{
if (pIdCoefficient)
{
delete pIdCoefficient;
pIdCoefficient = NULL;
}
if (pCoefficientValue)
{
delete pCoefficientValue;
pCoefficientValue = NULL;
}
if (pDefinitionCoefficient)
{
delete pDefinitionCoefficient;
pDefinitionCoefficient = NULL;
}
}
void EvgRow::init()
{
pIdCoefficient = new QLabel("", this);
pDefinitionCoefficient = new QLabel("", this);
createSpinBox();
}
void EvgRow::createSpinBox()
{
pCoefficientValue = new QDoubleSpinBox(this);
pCoefficientValue->setMaximum(99999.9999);
pCoefficientValue->setMinimum(-99999.9999);
pCoefficientValue->setDecimals(4);
pCoefficientValue->setReadOnly(TRUE);
}
void EvgRow::settingLayout()
{
QHBoxLayout *layoutHor = new QHBoxLayout;
layoutHor->addStretch(1);
layoutHor->addWidget(pIdCoefficient);
layoutHor->addWidget(pCoefficientValue);
layoutHor->addWidget(pDefinitionCoefficient, 2);
layoutHor->addStretch(1);
this->setLayout(layoutHor);
}
void EvgRow::setIdText(int newId)
{
QString foo;
foo.setNum(newId);
foo.insert(0, "x<sub>");
foo.append("</sub>");
pIdCoefficient->setText(foo);
}
void EvgRow::changeIdToText(QString &)
{
qDebug("EvgRow::%s error! V-Table.", __FUNCTION__);
}
void EvgRow::setStringByState(TypeState state)
{
qDebug("EvgRow::%s error! V-Table.", __FUNCTION__);
}
void EvgRow::setTextDefinition(QString newText)
{
pDefinitionCoefficient->setText(newText);
}
double EvgRow::getValue() const
{
return pCoefficientValue->value();
}
void EvgRow::setValue(float value)
{
pCoefficientValue->setValue(value);
}
void EvgRow::setEditable(bool yes)
{
pCoefficientValue->setReadOnly(!yes);
}
QLabel *EvgRow::labelId()
{
return pIdCoefficient;
}
QDoubleSpinBox *EvgRow::spinBoxRow()
{
return pCoefficientValue;
}
QLabel *EvgRow::labelDefinition()
{
return pDefinitionCoefficient;
}