-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcampaign.cpp
53 lines (43 loc) · 1.22 KB
/
campaign.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
#include "campaign.h"
#include "multiplesnake.h"
#include <QApplication>
#include <QWidget>
#include <QPushButton>
campaign::campaign(QWindow *parent) :
QWindow(parent)
, m_backingStore(new QBackingStore(this))
{
w.resize(306, 388);
b1.setParent(&w);
b2.setParent(&w);
b3.setParent(&w);
b4.setParent(&w);
b1.setText("2 PLAYERS");
b2.setText("3 PLAYERS");
b3.setText("4 PLAYERS");
b4.setText("QUIT");
b1.setGeometry(80, 40, 121, 41);
b2.setGeometry(80, 110, 121, 41);
b3.setGeometry(80, 180, 121, 41);
b4.setGeometry(80, 250, 121, 41);
QObject::connect(&b1, SIGNAL(clicked()), this, SLOT(on_pushButton_clicked()));
QObject::connect(&b2, SIGNAL(clicked()), this, SLOT(on_pushButton_2_clicked()));
QObject::connect(&b3, SIGNAL(clicked()), this, SLOT(on_pushButton_3_clicked()));
QObject::connect(&b4, SIGNAL(clicked()), &w, SLOT(close()));
w.show();
}
void campaign::on_pushButton_clicked()
{
m = new multipleSnake(2);
m->RasterWindow::show();
}
void campaign::on_pushButton_2_clicked()
{
m = new multipleSnake(3);
m->RasterWindow::show();
}
void campaign::on_pushButton_3_clicked()
{
m = new multipleSnake(4);
m->RasterWindow::show();
}