-
Notifications
You must be signed in to change notification settings - Fork 9
/
cxapplication_qt.cpp
75 lines (47 loc) · 1.12 KB
/
cxapplication_qt.cpp
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include "cxapplication_qt.h"
CxApplicationReceiver f_applicationReceiver;
CxApplicationReceiver::CxApplicationReceiver(QObject *parent)
: QObject(parent)
{
}
CxApplicationReceiver::~CxApplicationReceiver()
{
}
bool CxApplicationReceiver::event(QEvent * oEvent)
{
CxApplication::runProcessCallBacks();
return true;
}
//*CxApplicationQt
int fn_doLoopEvents_qt(int iTag)
{
return QApplication::exec();
}
void fn_signalMainThread_qt()
{
QApplication::postEvent(& f_applicationReceiver, new QEvent(QEvent::User));
}
void fn_doProcessEvents_qt()
{
QApplication::processEvents();
}
void fn_doExit_qt()
{
QApplication::exit();
}
void fn_reset_qt()
{
}
void CxApplicationQt::init(int argc, const char *argv[], int iProjectType)
{
CxApplication::setFnCore(fn_doLoopEvents_qt,
fn_signalMainThread_qt,
fn_doProcessEvents_qt,
fn_doExit_qt,
fn_reset_qt);
CxApplication::init(argc, argv, iProjectType);
}
int CxApplicationQt::exec(int iTag)
{
return CxApplication::exec(iTag);
}