-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtomardatos.cpp
73 lines (58 loc) · 1.33 KB
/
tomardatos.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
68
69
70
71
72
#include "tomardatos.h"
#include "ui_tomardatos.h"
#include <QMessageBox>
tomarDatos::tomarDatos(QWidget *parent) :
QDialog(parent),
ui(new Ui::tomarDatos)
{
ui->setupUi(this);
ui->dateEdit->setDate(QDate::currentDate());
ui->timeEdit->setTime(QTime::currentTime());
ui->lePeso->setFocus();
llenarDatos();
}
tomarDatos::~tomarDatos()
{
delete ui;
}
void tomarDatos::on_lePeso_editingFinished()
{
llenarDatos();
}
void tomarDatos::on_leAltura_editingFinished()
{
llenarDatos();
}
void tomarDatos::on_leSist_editingFinished()
{
llenarDatos();
}
void tomarDatos::on_leDiast_editingFinished()
{
llenarDatos();
}
void tomarDatos::on_lePulso_editingFinished()
{
llenarDatos();
}
void tomarDatos::on_leEstomago_editingFinished()
{
if (ui->leEstomago->text() != "B" && ui->leEstomago->text() != "C") {
QMessageBox::information(this,"Dato erroneo","Las opciones del stómago son B o C");
ui->leEstomago->setFocus();
return;
}
llenarDatos();
}
void tomarDatos::llenarDatos()
{
datos.clear();
datos << ui->dateEdit->text();
datos << ui->timeEdit->text();
datos << ui->lePeso->text();
datos << ui->leAltura->text();
datos << ui->leSist->text();
datos << ui->leDiast->text();
datos << ui->lePulso->text();
datos << ui->leEstomago->text();
}