当前位置: 软件>C/C++软件
Node.js的Qt扩展 node-qt
本文导语: Qt bindings for Node.js 示例代码: 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.paintEv...
示例代码:
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);