Integration with Qode 2.0 (#400)
* Moves qt integration solely to the nodegui core addon * Adds lint fixes * moved to integration core * cleans up export snippet * revert package.json * Add exit if app->exec finishes. * lint fix * Makes QApplication custom * adds qobject to wrap of qapp * Adds working qt run looper * Adds font default * Adds qt installer * Updates qode integration to v2.0.1 * fix cpp lints * Fixes lint and deps * Adds miniqt installation * adds setup mini qt script * skips tests due to issues with jest * fix config and download path for linux and windows * Adds multiple artifact downloader * fix qt config and compilation * Fixes qode path for windows (now it can load dll's easily) * Add compilation * fix windows path setup * use scripts directly * enabled tests back * fix ubuntu deps * update to alpha release * fix workflow * adds more artifacts and funding field * change to alpha v2 * update prebuild yml * revert build action * disabling prebuild for now * switch to stable release 5.14.1 * version bump
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var path = require('path');
|
||||
var qodeConfig = require('@nodegui/qode');
|
||||
var managePath = require('manage-path');
|
||||
var qtConfig = require('../config/qtConfig');
|
||||
|
||||
var proc = require('child_process');
|
||||
|
||||
// Add Qt's bin to the path of Qode so that it can find the dll's
|
||||
var alterPath = managePath(process.env);
|
||||
alterPath.unshift(path.join(qtConfig.qtHome, 'bin'));
|
||||
|
||||
var child = proc.spawn(qodeConfig.qodePath, process.argv.slice(2), {
|
||||
stdio: 'inherit',
|
||||
windowsHide: false,
|
||||
env: process.env,
|
||||
});
|
||||
|
||||
child.on('close', function(code) {
|
||||
process.exit(code);
|
||||
});
|
||||
|
||||
const handleTerminationSignal = function(signal) {
|
||||
process.on(signal, function signalHandler() {
|
||||
if (!child.killed) {
|
||||
child.kill(signal);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
handleTerminationSignal('SIGINT');
|
||||
handleTerminationSignal('SIGTERM');
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const { setupArtifact } = require('@nodegui/artifact-installer');
|
||||
const { miniQt, useCustomQt, qtHome } = require('../config/qtConfig');
|
||||
|
||||
if (!useCustomQt) {
|
||||
console.log(`Minimal Qt ${miniQt.version} setup:`);
|
||||
} else {
|
||||
console.log(`CustomQt detected at ${qtHome} . Hence, skipping Mini Qt installation...`);
|
||||
}
|
||||
|
||||
async function setupQt() {
|
||||
return Promise.all(
|
||||
miniQt.artifacts.map(async artifact =>
|
||||
setupArtifact({
|
||||
outDir: miniQt.setupDir,
|
||||
id: 'nodegui-mini-qt',
|
||||
displayName: `${artifact.name} for Minimal Qt: ${miniQt.version} installation`,
|
||||
downloadLink: artifact.link,
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
setupQt().catch(err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
const { QApplication } = require('../../dist');
|
||||
module.exports = async () => {
|
||||
global.qApp = QApplication.instance();
|
||||
qApp.setQuitOnLastWindowClosed(false);
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = async () => {
|
||||
global.qApp.quit();
|
||||
};
|
||||
Reference in New Issue
Block a user