-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.cpp
More file actions
28 lines (22 loc) · 775 Bytes
/
Menu.cpp
File metadata and controls
28 lines (22 loc) · 775 Bytes
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
// Author: R. Schiffers
#include "Menu.h"
Menu::Menu (int width, int height) : QGraphicsScene ()
{
QPixmap* pix = new QPixmap (":res/images/Menu.jpg");
*pix = pix->scaledToWidth (width);
this->setBackgroundBrush (*new QBrush (*pix));
QPixmap* buttonPix = new QPixmap (":res/images/StartButton.png");
QPalette* palette = new QPalette ();
palette->setColor (QPalette::Button, Qt::black);
startButton = new QPushButton ();
startButton->setPalette (*palette);
startButton->setIcon (*buttonPix);
startButton->setIconSize (startButton->size ());
startButton->setGeometry (0, height - height * 0.12, width * 0.97, height * 0.1);
addWidget (startButton);
}
QPushButton*
Menu::getStartButton ()
{
return this->startButton;
}