-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.cpp
More file actions
45 lines (40 loc) · 1.11 KB
/
MainWindow.cpp
File metadata and controls
45 lines (40 loc) · 1.11 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
#include "MainWindow.h"
#include "ui_MainWindow.h"
#include <QIcon>
#include <QDebug>
#include <QWindow>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
setWindowTitle(tr("Vizuális memória teszt v1.2 - ©:Voszkovenkó István"));
setWindowState(Qt::WindowMaximized);
card = new MovedCard(this);
}
MainWindow::~MainWindow()
{
delete ui;
delete card;
}
void MainWindow::keyPressEvent(QKeyEvent *e)
{
if (e->key() == Qt::Key_Escape && windowState() == Qt::WindowFullScreen)
setWindowState(Qt::WindowMaximized);
else if ((e->key() == Qt::Key_F11 && windowState() != Qt::WindowFullScreen))
setWindowState(Qt::WindowFullScreen);
else
QMainWindow::keyPressEvent(e);
}
void MainWindow::changeEvent(QEvent *e)
{
if (e)
{
if (e->type() == QEvent::LanguageChange)
{
ui->retranslateUi(this);
setWindowTitle(tr("Vizuális memória teszt v1.2 - ©:Voszkovenkó István"));
}
}
QWidget::changeEvent(e);
}