-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
81 lines (69 loc) · 1.85 KB
/
mainwindow.cpp
File metadata and controls
81 lines (69 loc) · 1.85 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
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
79
80
81
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "gamewindow.h"
#include "oldmemorywindow.h"
#include "ruleintrowindow.h"
#include "teamintro.h"
#include "useintro.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QPixmap bkgnd("://res/img/main/main_bgm.png");
bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio);
QPalette palette;
palette.setBrush(QPalette::Background, bkgnd);
ui->btn_new_game->setStyleSheet("border-image: url(://res/img/main/new_game_btn.png);");
ui->btn_old_memory->setStyleSheet("border-image: url(://res/img/main/old_game_btn.png);");
ui->btn_rule_intro->setStyleSheet("border-image: url(://res/img/main/rule_intro_btn.png);");
this->setPalette(palette);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_btn_new_game_clicked()
{
GameWindow *gamewindow = new GameWindow;
gamewindow->show();
this->hide();
}
void MainWindow::on_action_new_game_triggered()
{
GameWindow *gamewindow = new GameWindow;
gamewindow->show();
this->hide();
}
void MainWindow::on_btn_old_memory_clicked()
{
OldMemoryWindow *oldmemorywindow = new OldMemoryWindow;
oldmemorywindow->show();
this->hide();
}
void MainWindow::on_action_old_memory_triggered()
{
OldMemoryWindow *oldmemorywindow = new OldMemoryWindow;
oldmemorywindow->show();
this->hide();
}
void MainWindow::on_btn_rule_intro_clicked()
{
RuleIntroWindow *ruleintrowindow = new RuleIntroWindow;
ruleintrowindow->show();
}
void MainWindow::on_action_game_intro_triggered()
{
RuleIntroWindow *ruleintrowindow = new RuleIntroWindow;
ruleintrowindow->show();
}
void MainWindow::on_action_about_us_triggered()
{
TeamIntro *teamintrowindow = new TeamIntro;
teamintrowindow->show();
}
void MainWindow::on_action_game_control_triggered()
{
UseIntro *useintrowindow = new UseIntro;
useintrowindow->show();
}