-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobalapplication.cpp
More file actions
43 lines (35 loc) · 989 Bytes
/
globalapplication.cpp
File metadata and controls
43 lines (35 loc) · 989 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "globalapplication.h"
#include <QDebug>
GlobalApplication::GlobalApplication(int &argc,char **argv):
QApplication(argc,argv)
{
}
GlobalApplication::~GlobalApplication()
{
}
void GlobalApplication::setWindowInstance(QWidget *wnd)
{
widget = wnd;
}
bool GlobalApplication::notify(QObject *obj, QEvent *e)
{
const QMetaObject* objMeta = obj->metaObject();
QString clName = objMeta->className();
if(e->type() == QEvent::KeyPress)
{
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(e);
if(keyEvent->key() == Qt::Key_F1)
{
// qDebug() << clName;
// qDebug() << "F1";
}
}
else if(e->type() == QEvent::MouseButtonPress || e->type() == QEvent::MouseButtonDblClick)
{
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(e);
if(mouseEvent->buttons() == Qt::LeftButton)
{
}
}
return QApplication::notify(obj,e);
}