Updates qode integration to v2.0.1
This commit is contained in:
parent
68221becbc
commit
56ee8418b8
2235
package-lock.json
generated
2235
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -19,7 +19,7 @@
|
||||
"docs": "cross-env typedoc && node ./website/docs/scripts/fixdocs.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nodegui/qode": "^2.0.0",
|
||||
"@nodegui/qode": "^2.0.1",
|
||||
"cmake-js": "^6.0.0",
|
||||
"cross-env": "^7.0.0",
|
||||
"cuid": "^2.1.6",
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#pragma once
|
||||
#include "qode-api.h"
|
||||
namespace qodeIntegration {
|
||||
void integrate();
|
||||
void integrate();
|
||||
}
|
||||
@ -3,9 +3,6 @@
|
||||
namespace qode {
|
||||
extern int qode_argc;
|
||||
extern char **qode_argv;
|
||||
typedef bool (*QodeInjectedRunLoopFunc)();
|
||||
extern QodeInjectedRunLoopFunc qode_run_uv_loop_once;
|
||||
extern QodeInjectedRunLoopFunc qode_run_gui_loop;
|
||||
extern void InjectQodeRunLoop(QodeInjectedRunLoopFunc runLoop);
|
||||
extern void InjectQodeRunUvLoopOnce(QodeInjectedRunLoopFunc runUvLoopOnce);
|
||||
typedef int (*QodeCustomRunLoopFunc)();
|
||||
extern void InjectCustomRunLoop(QodeCustomRunLoopFunc customRunLoop);
|
||||
} // namespace qode
|
||||
@ -1,9 +1,8 @@
|
||||
#include "QtGui/QApplication/qapplication_wrap.h"
|
||||
|
||||
#include "core/Integration/integration.h"
|
||||
#include "Extras/Utils/nutils.h"
|
||||
#include "QtGui/QClipboard/qclipboard_wrap.h"
|
||||
#include "QtGui/QStyle/qstyle_wrap.h"
|
||||
#include "core/Integration/qode-api.h"
|
||||
|
||||
Napi::FunctionReference QApplicationWrap::constructor;
|
||||
|
||||
|
||||
@ -1,32 +1,29 @@
|
||||
|
||||
#include "core/Integration/integration.h"
|
||||
#include "QtGui/QApplication/napplication.hpp"
|
||||
#include <QFont>
|
||||
|
||||
#include "core/Integration/integration.h"
|
||||
#include "core/Integration/qode-api.h"
|
||||
#include "QtGui/QApplication/napplication.hpp"
|
||||
namespace qodeIntegration {
|
||||
static NApplication* app;
|
||||
static NApplication* app;
|
||||
|
||||
bool QtRunLoopWrapper() {
|
||||
if(qode::qode_run_uv_loop_once){
|
||||
// Run uv loop once to start all the node integration things
|
||||
qode::qode_run_uv_loop_once();
|
||||
int QtRunLoopWrapper() {
|
||||
int exitCode = app->exec();
|
||||
// if(exitCode != 0){
|
||||
exit(exitCode);
|
||||
// }
|
||||
return 0;
|
||||
}
|
||||
int exitCode = app->exec();
|
||||
if(exitCode != 0){
|
||||
exit(exitCode);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void integrate() {
|
||||
// Bootstrap Qt
|
||||
app = new NApplication(qode::qode_argc, qode::qode_argv);
|
||||
qode::InjectQodeRunLoop(&QtRunLoopWrapper);
|
||||
// Other init settings
|
||||
QFont f = QApplication::font();
|
||||
if (f.defaultFamily().isEmpty()) {
|
||||
f.setFamily("Sans-Serif");
|
||||
QApplication::setFont(f);
|
||||
void integrate() {
|
||||
// Bootstrap Qt
|
||||
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
|
||||
Loading…
Reference in New Issue
Block a user