-
Notifications
You must be signed in to change notification settings - Fork 0
/
adddialog.cpp
30 lines (26 loc) · 911 Bytes
/
adddialog.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
#include "adddialog.h"
#include "ui_adddialog.h"
#include "QIntValidator"
AddDialog::AddDialog(QWidget *parent, Database *_database) :
QDialog(parent),
ui(new Ui::AddDialog) {
database = _database;
ui->setupUi(this);
ui->lineEdit_2->setValidator(new QIntValidator(this));
ui->lineEdit_5->setValidator(new QIntValidator(this));
}
AddDialog::~AddDialog() {
delete ui;
}
void AddDialog::on_pushButton_2_clicked() {
database->add(DatabaseNode(ui->lineEdit->text().toLocal8Bit().data(),
ui->lineEdit_2->text().toLong(),
ui->lineEdit_4->text().toLocal8Bit().data(),
ui->lineEdit_3->text().toLocal8Bit().data(),
ui->lineEdit_5->text().toShort()
));
emit(updateCallback());
}
void AddDialog::on_pushButton_clicked() {
close();
}