5
5
Coordinator::Coordinator (QObject *parent) : QObject(parent) {
6
6
myWindow = new SignInScreen ();
7
7
myWindow2 = new registerscreen ();
8
- myWindow3 = new Schedule ();
9
8
popUpWindow = new settingsWindow ();
10
- menuWin = new menuWindow ();
11
9
gradeWin = new gradesWindow ();
12
10
abscWin = new absenceWindow ();
13
11
absencePopUp = new inputAbsence ();
14
12
15
13
QObject::connect (abscWin, &absenceWindow::scheduleAbsenceOpened, this , &Coordinator::sendScheduleAbsence);
16
-
17
- QObject::connect (this , &Coordinator::sendScheduleAbsence, myWindow3, [&](){
18
- myWindow3->onSomething ();
19
- });
20
14
}
21
15
22
16
Coordinator::~Coordinator () {}
@@ -27,11 +21,16 @@ void Coordinator::showSignInScreen() {
27
21
28
22
29
23
void Coordinator::showMenuWindow () {
24
+ if (!menuWin) {
25
+ menuWin = new menuWindow ();
26
+ }
30
27
menuWin->show ();
31
28
}
32
29
33
30
void Coordinator::showAbsenceWindow () {
34
31
menuWin->hide ();
32
+ // menuWin->deleteLater();
33
+ // menuWin = nullptr;
35
34
abscWin->show ();
36
35
}
37
36
@@ -54,7 +53,14 @@ void Coordinator::showSettingsWindow() {
54
53
}
55
54
56
55
void Coordinator::showSchedule () {
56
+ abscWin->hide ();
57
57
absencePopUp->hide ();
58
- menuWin->hide ();
58
+ hideAllScreenExcept ();
59
+ // menuWin->hide();
60
+ // menuWin->deleteLater();
61
+ // menuWin = nullptr;
62
+ if (!myWindow3) {
63
+ myWindow3 = new Schedule ();
64
+ }
59
65
myWindow3->show ();
60
66
}
0 commit comments