-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwidget.cpp
42 lines (35 loc) · 1.29 KB
/
mainwidget.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
#include "mainwidget.h"
#include "global_consts.h"
#include <QtDebug>
MainWidget::MainWidget(QWidget *parent, Qt::WindowFlags f)
: QWidget(parent, f)
{
playerBarWidget->setMinimumHeight(100);
countdown = new Countdown(this);
countdown->move(0, (WINDOW_HEIGHT-playerBarWidget->height())/2-50);
countdown->setMinimumHeight(50);
countdown->setMinimumWidth(WINDOW_WIDTH);
messageAtTopOfScreen = new MessageAtTopOfScreen(this);
messageAtTopOfScreen->move(0, 20);
messageAtTopOfScreen->setMinimumWidth(WINDOW_WIDTH);
powerGrenadeThrowing = new PowerGrenadeThrowing(this);
powerGrenadeThrowing->move(20,10);
powerGrenadeThrowing->setMinimumWidth(300);
leaderboard = new Leaderboard(this);
leaderboard->move(0,0);
leaderboard->setMinimumWidth(WINDOW_WIDTH);
leaderboard->setMinimumHeight(WINDOW_HEIGHT - playerBarWidget->height());
mapWidget->setPowerGrenadeThrowing(powerGrenadeThrowing);
mapWidget->setLeaderboard(leaderboard);
mapWidget->setMessageAtTopOfScreen(messageAtTopOfScreen);
mapWidget->setCountdown(countdown);
setLayout(qvboxLayout);
qvboxLayout->addWidget(mapWidget);
qvboxLayout->addWidget(playerBarWidget);
}
MainWidget::~MainWidget()
{
delete qvboxLayout;
delete playerBarWidget;
delete mapWidget;
}