forked from nodegui/nodegui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintegration.cpp
More file actions
32 lines (27 loc) · 786 Bytes
/
integration.cpp
File metadata and controls
32 lines (27 loc) · 786 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
#include "core/Integration/integration.h"
#include <QFont>
#include "QtGui/QApplication/napplication.hpp"
#include "core/Integration/qode-api.h"
namespace qodeIntegration {
static NApplication* app;
int QtRunLoopWrapper() {
int exitCode = app->exec();
// if(exitCode != 0){
exit(exitCode);
// }
return 0;
}
void integrate() {
// Bootstrap Qt
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
app = new NApplication(qode::qode_argc, qode::qode_argv);
qode::InjectCustomRunLoop(&QtRunLoopWrapper);
// Other init settings
QFont f = QApplication::font();
if (f.defaultFamily().isEmpty()) {
f.setFamily("Sans-Serif");
QApplication::setFont(f);
}
}
} // namespace qodeIntegration