-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.cpp
60 lines (47 loc) · 1.3 KB
/
menu.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
53
54
55
56
57
58
59
60
#include "menu.h"
FenMenu::FenMenu()
{
nomMenu = new QLabel;
btnPropose = new QPushButton;
btnAleatoire = new QPushButton;
btnQuitter = new QPushButton;
layout = new QVBoxLayout;
nomMenu->setText(QString::fromUtf8("Le Mot Mystère"));
btnPropose->setText(QString::fromUtf8("Choix du mot mystère"));
btnAleatoire->setText(QString::fromUtf8("Mot mystère aléatoire"));
btnQuitter->setText(QString::fromUtf8("Quitter"));
layout->addWidget(nomMenu);
layout->addWidget(btnPropose);
layout->addWidget(btnAleatoire);
layout->addWidget(btnQuitter);
setLayout(layout);
QObject::connect(btnPropose, SIGNAL(released()), this, SLOT(Propose()));
QObject::connect(btnAleatoire, SIGNAL(released()), this, SLOT(Aleatoire()));
QObject::connect(btnQuitter, SIGNAL(released()), qApp, SLOT(quit()));
}
FenMenu::~FenMenu()
{
delete nomMenu;
delete btnPropose;
delete btnAleatoire;
delete btnQuitter;
delete layout;
}
void FenMenu::Propose()
{
this->hide();
FenMotMystere *motMystere = new FenMotMystere(1);
motMystere->exec();
Recommence();
}
void FenMenu::Aleatoire()
{
this->hide();
FenMotMystere *motMystere = new FenMotMystere(2);
motMystere->exec();
Recommence();
}
void FenMenu::Recommence()
{
this->show();
}