-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.cpp
More file actions
63 lines (61 loc) · 2.22 KB
/
Copy pathstart.cpp
File metadata and controls
63 lines (61 loc) · 2.22 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
#include "start.h"
#include<QPalette>
#include<QPixmap>
#include<QPainter>
#include<QPaintEvent>
Start::Start(QWidget *parent) : QWidget(parent)
{
this->setAttribute(Qt::WA_DeleteOnClose,true);
this->w=new MainWindow;
setWindowFlags(windowFlags()&~Qt::WindowMaximizeButtonHint); //禁止最大化
this->setGeometry(600,70,700,800);
setFixedSize(this->width(),this->height()); //禁止拖动窗口大小
this->setAutoFillBackground(true);
QPalette palette;
QPixmap pixmap(":/bg/pic/nkjinnan.gif");
palette.setBrush(QPalette::Window, QBrush(pixmap));
this->setPalette(palette);
this->label=new QLabel("Please Choose the Map",this);
this->label->setStyleSheet("font-size:30px");
this->label->setGeometry(200,100,400,50);
this->label->show();
this->button[0]=new QPushButton("Balitai Campus",this);
this->button[0]->setGeometry(230,250,250,50);
this->button[0]->setStyleSheet("background-image:url(:/bg/pic/background1.png)");
this->button[1]=new QPushButton("Jinnan Campus",this);
this->button[1]->setGeometry(230,400,250,50);
this->button[1]->setStyleSheet("background-image:url(:/bg/pic/background2.png)");
this->button[2]=new QPushButton("Taida Campus",this);
this->button[2]->setGeometry(230,550,250,50);
this->button[2]->setStyleSheet("background-image:url(:/bg/pic/background3.png)");
for(int i=0;i<3;i++){
this->button[i]->show();
}
connect(this->button[0], &QPushButton::clicked,
[=]()
{
this->w->getScene()->map1();
this->w->show();
this->w->MapChoose=0;
w->sc->setProps();
this->hide();
});
connect(this->button[1], &QPushButton::clicked,
[=]()
{
this->hide();
this->w->getScene()->map2();
this->w->show();
this->w->MapChoose=1;
w->sc->setProps();
});
connect(this->button[2], &QPushButton::clicked,
[=]()
{
this->hide();
this->w->getScene()->map3();
this->w->show();
this->w->MapChoose=2;
w->sc->setProps();
});
}