node-qtNode.js的Qt扩展
示例代码:
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);
评论