-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathgmchartools.cpp
More file actions
56 lines (44 loc) · 1.21 KB
/
gmchartools.cpp
File metadata and controls
56 lines (44 loc) · 1.21 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
#include "gmchartools.h"
#include "ui_gmchartools.h"
#include <QRegExp>
#include <QtGui>
GMCharTools::GMCharTools(QWidget *parent) :
QDialog(parent),
ui(new Ui::GMCharTools)
{
ui->setupUi(this);
addCBills = 0;
addXP = 0;
// QRegExp regExp("[0-9]{0,}[.][0-9]{1,2}");
QRegExp regExp("[0-9]{0,}");
ui->ToMoneyAddGm->setValidator(new QRegExpValidator(regExp,this));
ui->FromMoneyAddGm->setValidator(new QRegExpValidator(regExp,this));
QRegExp regExpXP("[0-9]{0,}");
ui->XPAddGM->setValidator(new QRegExpValidator(regExpXP,this));
// double a = 12345.12;
// double b = 54321.12;
// double c;
// c = a*b;
// QString str;
// str = QVariant(c).toString();
// qDebug() << str;
}
GMCharTools::~GMCharTools()
{
delete ui;
}
void GMCharTools::on_ToMoneyAddGm_textEdited(QString textString)
{
bool ok;
if(ui->FromValuteGm->currentText() == ui->ToValuteGm->currentText()) {
ui->FromMoneyAddGm->setText(QString::number(textString.toFloat(&ok)));
}
}
void GMCharTools::on_FromMoneyAddGm_textEdited(QString textString)
{
addCBills = textString.toInt();
}
void GMCharTools::on_XPAddGM_textEdited(QString textString)
{
addXP = textString.toInt();
}