-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwelcome.cpp
78 lines (66 loc) · 2.08 KB
/
welcome.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
73
74
75
76
77
78
#include "welcome.h"
#include "ui_welcome.h"
welcome::welcome(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::welcome)
{
ui->setupUi(this);
qDebug() << "constructor";
update_screen();
ui->pushButton->setStyleSheet(
"background-color: green;"
"border-style: outset;"
"border-width: 2px;"
"border-radius: 15px;"
"border-color: beige;"
"font: bold 24px;"
"padding: 6px;"
);
}
welcome::~welcome()
{
delete ui;
}
void welcome::registrationInServer(QString postData)
{
QNetworkAccessManager *pManager = new QNetworkAccessManager();
connect(pManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinish(QNetworkReply*)));
pManager->post(QNetworkRequest(QUrl("http://192.168.1.168/registration?")), postData.toUtf8());
}
void welcome::on_pushButton_clicked()
{
qDebug() << "next button clicked";
if(HUMAN == "unDefined") return;
PHONE_NUMBER = ui->phoneNumber->text();
NAME = ui->lineEdit->text();
//registrationInServer(QString("human=" + HUMAN + "&name=" + NAME + "&phone=" + PHONE_NUMBER));
emit next_button();
this->hide();
}
void welcome::update_screen()
{
h = screenH; //QApplication::primaryScreen()->size().height();
w = screenW; //QApplication::primaryScreen()->size().width();
ui->gridLayoutWidget->setGeometry(QRect(0, 0, w, h));
//this->setGeometry(QRect(0, 0, w, h));
}
void welcome::replyFinish(QNetworkReply *reply)
{
qDebug() << QString(reply->readAll());
}
void welcome::on_phoneNumber_editingFinished()
{
ui->phoneNumber->deselect();
}
void welcome::on_pushButton_2_clicked()
{
ui->pushButton_3->setDisabled(false);
ui->pushButton_2->setDisabled(true);
HUMAN = "driver";
}
void welcome::on_pushButton_3_clicked()
{
ui->pushButton_3->setDisabled(true);
ui->pushButton_2->setDisabled(false);
HUMAN = "passanger";
}