-
Notifications
You must be signed in to change notification settings - Fork 0
/
front.cpp
70 lines (59 loc) · 1.37 KB
/
front.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
#include "front.h"
#include "ui_front.h"
front::front(QWidget* parent) :
QWidget(parent),
ui(new Ui::front)
{
ui->setupUi(this);
setFixedSize(1280, 720);
connect(&loginForm, SIGNAL(returnFront(int,int)), this, SLOT(fromLogin(int,int)));
connect(&helpForm, SIGNAL(returnFront(int,int)), this, SLOT(fromHelp(int,int)));
}
front::~front()
{
delete ui;
}
void front::closeEvent(QCloseEvent*)
{
}
void front::on_pBtnLogin_clicked() //从主界面转到登录界面
{
this->hide();
loginForm.move(x(), y());
loginForm.update();
loginForm.show();
}
void front::fromLogin(int _x, int _y) //从登录界面返回主界面
{
if (systemclose) this->close();
else {
systemclose = true;
this->move(_x, _y);
this->show();
}
}
void front::on_pBtnHelp_clicked() //从主界面转到帮助界面
{
this->hide();
helpForm.move(x(), y());
helpForm.show();
}
void front::fromHelp(int _x, int _y) //从帮助界面返回主界面
{
if (systemclose) this->close();
else {
systemclose = true;
this->move(_x, _y);
this->show();
}
}
void front::on_pBtnVersion_clicked() //显示版本界面
{
versionForm.setWindowModality(Qt::ApplicationModal);
versionForm.move(x() + 440, y() + 170);
versionForm.show();
}
void front::on_pBtnExit_clicked() //退出游戏
{
this->close();
}