Node.js的Qt扩展 node-qt
openkk
12年前
Node.js的Qt扩展 node-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);