-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.cpp
More file actions
46 lines (33 loc) · 760 Bytes
/
main.cpp
File metadata and controls
46 lines (33 loc) · 760 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
44
45
46
#include "mainwindow.h"
#include <QApplication>
#include <QDebug>
#include "myeventfilter.h"
int isBig()
{
QByteArray ba;
ba.push_back(0x22);
ba.push_back(0x11);
quint16 *num = (quint16*)ba.data();
qDebug() << *num << 0x1122;
int a = 0x12345678;
char b = *(char*)&a;
for(int i = 0; i < 4; i++)
{
qDebug() << QString::number(*((uchar *)&a + i), 16);
}
if (0x12 == b)
{
return 0;
}
return -1;
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MyEventFilter evtFilter;
a.installNativeEventFilter(&evtFilter);
qDebug() << "is big:" << isBig();
MainWindow w;
w.show();
return a.exec();
}