程序员必上的开发者服务平台 —— DevStoreQt bindings for Node js 示例代码: var qt = require(node-qt), app = new qt QApplication, window = new qt QWidget; Prevent objects from being GCd global app = app; global window = window; Quirk: the virtual method paintEvent() is mapped into a callback setter window paintEvent(function() { var p = new qt QPainter(); p begin(window); p drawText(20, 30, hello node, hello qt); p end(); }); window resize(300, 150); window show(); Join Nodes event loop setInterval(app processEvents, 0);

程序员必上的开发者服务平台 —— DevStore

Qt bindings for Node.js

Screenshot

示例代码:

var qt = require('node-qt'),
    app = new qt.QApplication,
    window = new qt.QWidget;

// Prevent objects from being GC'd
global.app = app;
global.window = window;

// Quirk: the virtual method paintEvent() is mapped into a callback setter
window.paintEvent(function() {
  var p = new qt.QPainter();
  p.begin(window);
  p.drawText(20, 30, 'hello node, hello qt');
  p.end();
});

window.resize(300, 150);
window.show();

// Join Node's event loop
setInterval(app.processEvents, 0);

关键字标签:

上一篇:手机开发框架 The-M-Project
下一篇:jQuery语法着色插件 Chili