This commit is contained in:
Atul R 2019-09-21 23:26:58 +02:00
parent 7a83dda059
commit 15a48e6723
2 changed files with 10 additions and 6 deletions

View File

@ -41,6 +41,7 @@ checkbox.setObjectName("check");
checkbox.setChecked(true);
checkbox.addEventListener(QCheckBoxEvents.toggled, () => {
console.log("checkbox was toggled!");
label1.setInlineStyle("color: green;");
});
const dial = new QDial();

View File

@ -8,13 +8,16 @@
called.
This is required inorder to make the timers work nicely due to merger of event loops
*/
function wrapWithActivateUvLoop(func: any) {
return function() {
(process as any).activateUvLoop();
//@ts-ignore
return func.apply(this, arguments);
const noop = () => {};
const wrapWithActivateUvLoop = (func: Function) => {
return (...args: any[]) => {
const activateUvLoop = (process as any).activateUvLoop || noop;
activateUvLoop();
return func(...args);
};
}
};
const main = () => {
process.nextTick = wrapWithActivateUvLoop(process.nextTick);