-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEndScreen.cpp
More file actions
23 lines (18 loc) · 774 Bytes
/
EndScreen.cpp
File metadata and controls
23 lines (18 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "EndScreen.h"
EndScreen::EndScreen(QWidget *parent, QString str, int score) : QWidget(parent)
{
QVBoxLayout *layout = new QVBoxLayout(this);
QLabel *textLabel = new QLabel(str + " Your score: " + QString::number(score), this);
textLabel->setAlignment(Qt::AlignCenter);
layout->addWidget(textLabel);
QPushButton *centeredButton = new QPushButton("Play again", this);
centeredButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(centeredButton, &QPushButton::clicked, this, &EndScreen::buttonClicked);
layout->addWidget(centeredButton, 0, Qt::AlignCenter);
setLayout(layout);
this->setGeometry(0, 0, scale * board_width, scale * board_height);
}
void EndScreen::buttonClicked()
{
emit playAgain();
}