-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.cpp
More file actions
102 lines (91 loc) · 2.49 KB
/
Copy pathMenu.cpp
File metadata and controls
102 lines (91 loc) · 2.49 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include "Menu.h"
Menu::Menu(QWidget *parent) : QMainWindow(parent), ui(new Ui::Menu) {
ui->setupUi(this);
this->setWindowFlags(Qt::FramelessWindowHint);
connect(ui->PbNavig, &QPushButton::clicked, this, &Menu::Navig);
connect(ui->PbInfo, &QPushButton::clicked, this, &Menu::Info);
connect(ui->PbPartners, &QPushButton::clicked, this, &Menu::Partners);
connect(ui->PbHeader, &QPushButton::clicked, this, &Menu::Description);
connect(ui->PbTimetable, &QPushButton::clicked, this, &Menu::Timetable);
connect(ui->PbCamera, &QPushButton::clicked, this, &Menu::Hide);
connect(ui->PbReg, &QPushButton::clicked, this, &Menu::Register);
nav = new class Navig();
reg = new class RegForm();
info = new class InfoView();
prtn = new class Partners();
descr = new class Description();
tmtbl = new class Timetable();
rb = new class RButton();
rb->setGeometry((this->size().width() - rb->size().width() - 10), 10, 60,
60);
rb->move((info->size().width() - rb->size().width() - 10), 10);
rb->menu = this;
rb->nav = nav;
rb->info = info;
rb->prtn = prtn;
rb->descr = descr;
rb->tmtbl = tmtbl;
rb->reg = reg;
}
void Menu::keyPressEvent(QKeyEvent *event) {
if (event->key() == Qt::Key_Delete) {
this->close();
} else {
QWidget::keyPressEvent(event);
}
}
void Menu::Navig() {
rb->show();
nav->show();
this->hide();
auto scene = new QGraphicsScene;
nav->ui->GvNames->setScene(scene);
scene->clear();
QString str;
str = QFileInfo("Euclase").absolutePath();
str += "/Materials/Names.jpg";
LogPrint(str);
QPixmap Map3(str);
qDebug() << this->size().height();
QSize MapSize(400, this->size().height());
qDebug() << MapSize.width() << ' ' << MapSize.height();
Map3 = Map3.scaled(MapSize, Qt::KeepAspectRatio);
scene->addPixmap(Map3);
}
void Menu::Info() {
rb->show();
info->show();
this->hide();
}
void Menu::Partners() {
rb->show();
prtn->show();
this->hide();
}
void Menu::Description() {
rb->show();
descr->show();
this->hide();
}
void Menu::Timetable() {
rb->show();
tmtbl->show();
this->hide();
}
void Menu::Hide() {
rb->show();
this->hide();
}
void Menu::Register() {
rb->show();
reg->showFullScreen();
this->hide();
}
Menu::~Menu() {
// Deleting menu
delete ui;
// Deleting navigation
QFile Tfile("FSave.Etnm");
Tfile.remove();
delete nav->Navig::ui;
}