-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
28 lines (21 loc) · 694 Bytes
/
main.cpp
File metadata and controls
28 lines (21 loc) · 694 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
#include "mainwindow.h"
#include <QApplication>
#include <QKeyEvent>
#include "appeventfilter.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QIcon icon(":/icons/mainIcon");
a.setWindowIcon(icon);
AppEventFilter filter;
a.installEventFilter(&filter);
MainWindow w;
QObject::connect(&filter,&AppEventFilter::openRecentFiles,
&w,&MainWindow::recentFilesHandler);
QObject::connect(&a, &QApplication::focusChanged, [&](QWidget *old, QWidget *now) {
QKeyEvent *event = new QKeyEvent(QKeyEvent::KeyRelease, Qt::Key_Alt, Qt::AltModifier);
a.sendEvent(&a,event);
});
w.show();
return a.exec();
}