forked from xcj2012/Configuration-61850
-
Notifications
You must be signed in to change notification settings - Fork 0
/
datadescchange.cpp.bak
64 lines (55 loc) · 1.6 KB
/
datadescchange.cpp.bak
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
#include "datadescchange.h"
DataDescChange::DataDescChange(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);
ui.label_Desc->setText(tr("Desc"));
ui.label_DU->setText(tr("dU"));
ui.pushButton_Apply->setText(tr("Apply"));
ui.pushButton_Cancel->setText(tr("Cancel"));
connect(ui.lineEdit_Desc1,SIGNAL(textChanged(QString)),this,SLOT(TextChange1(QString)));
connect(ui.lineEdit_Desc2,SIGNAL(textChanged(QString)),this,SLOT(TextChange2(QString)));
connect(ui.pushButton_Apply,SIGNAL(clicked(bool)),this,SLOT(Pushbutton_Apply()));
connect(ui.pushButton_Cancel,SIGNAL(clicked(bool)),this,SLOT(Pushbutton_Cancel()));
}
DataDescChange::~DataDescChange()
{
}
void DataDescChange::Display(QString Desc1, QString Desc2, QString DU1, QString DU2)
{
ui.lineEdit_Desc1->setText(Desc1);
if (Desc2.isEmpty())
{
ui.lineEdit_Desc2->hide();
ui.lineEdit_dU2->hide();
ui.lineEdit_dU1->setEnabled(false);
ui.lineEdit_dU1->setText(DU1);
}else
{
ui.lineEdit_Desc2->setText(Desc2);
ui.lineEdit_dU1->setEnabled(false);
ui.lineEdit_dU1->setText(DU1);
ui.lineEdit_dU2->setEnabled(false);
ui.lineEdit_dU2->setText(DU2);
}
}
void DataDescChange::Pushbutton_Apply()
{
strDesc1 = ui.lineEdit_Desc1->text();
strDesc2 = ui.lineEdit_Desc2->text();
strDU1 = ui.lineEdit_dU1->text();
strDU2 = ui.lineEdit_dU2->text();
accept();
}
void DataDescChange::Pushbutton_Cancel()
{
reject();
}
void DataDescChange::TextChange1(QString text)
{
ui.lineEdit_dU1->setText(text);
}
void DataDescChange::TextChange2(QString text)
{
ui.lineEdit_dU2->setText(text);
}