-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathggpage.cpp
More file actions
53 lines (48 loc) · 1.9 KB
/
Copy pathggpage.cpp
File metadata and controls
53 lines (48 loc) · 1.9 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
#include "ggpage.h"
#include <QLabel>
#include <QPushButton>
#include <QApplication>
#include <QDesktopWidget>
GGPage::GGPage(QWidget *parent):
QWidget(parent)
{
this->setFixedSize(1100,720);
QDesktopWidget *deskdop=QApplication::desktop();
move((deskdop->width()-this->width())/2, (deskdop->height()-this->height())/2);
this->setWindowFlags(Qt::FramelessWindowHint);
this->setWindowModality(Qt::ApplicationModal);
this->setStyleSheet("background-color:rgb(0,0,0)");
setAttribute(Qt::WA_DeleteOnClose);
setWindowIcon(QIcon(":/snakeIcon/snake.png"));
QLabel *gg = new QLabel(this);
gg->setText("GAME OVER");
gg->setFixedSize(1100,360);
gg->move(0,100);
gg->setAlignment(Qt::AlignTop);gg->setAlignment(Qt::AlignHCenter);
gg->setStyleSheet("QLabel{font-family:'OCR A Extended';font-size:150px;color:rgb(255,250,250);}");
gg->show();
QPushButton *exit = new QPushButton(this);
exit->setText("BACK");
exit->setFixedSize(300,90);
exit->move(400,560);
exit->setStyleSheet("QPushButton{font-family:'Bauhaus 93';font-size:50px;color:rgb(0,0,0);}\
QPushButton{background-color:rgb(255,250,250)}\
QPushButton:hover{background-color:rgb(255, 222, 173)}");
exit->show();
QPushButton *restart = new QPushButton(this);
restart->setText("RESTART");
restart->setFixedSize(300,90);
restart->move(400,400);
restart->setStyleSheet("QPushButton{font-family:'Bauhaus 93';font-size:50px;color:rgb(0,0,0);}\
QPushButton{background-color:rgb(255,250,250)}\
QPushButton:hover{background-color:rgb(255, 222, 173)}");
restart->show();
connect(exit,&QPushButton::clicked,this,[=](){
this->close();
emit Back();
});
connect(restart,&QPushButton::clicked,this,[=](){
this->close();
emit Restart();
});
}