{"_id":"node-qt","_rev":"16-7c1603cad5110d6ec39127029854e8e0","name":"node-qt","description":"Qt bindings for Node.js","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"node-qt","version":"0.0.1","author":{"name":"Artur Adib","email":"arturadib@gmail.com"},"description":"Qt bindings for Node.js","repository":{"type":"git","url":"git://github.com/arturadib/node-qt.git"},"homepage":"http://github.com/arturadib/node-qt","main":"./lib/qt.js","keywords":["qt","gui","ui","graphics","audio","webkit"],"dependencies":{"shelljs":"0.0.5pre4","node-gyp":"0.3.11"},"_npmUser":{"name":"artur","email":"arturadib@gmail.com"},"_id":"node-qt@0.0.1","scripts":{"install":"node-gyp rebuild"},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"9fc209e04d3ee4dc8d46e3940ce614a2fadb1c6b","tarball":"https://registry.npmjs.org/node-qt/-/node-qt-0.0.1.tgz","integrity":"sha512-M48Ssc58MDbFLrRMtj9ryNrTkqaisbUhKT6+hbkMQV9a09/Gx2altH02/U1/leBHQrlhsEu1+IjV838TdQOYuA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmEiY6cTJWsZBD0ltIcK+CeNGh6CbPd5r0toKO+tYAVgIgecxJbMxTrnM2fmkbazgvR5tNU95CIZpUzo5MKpJyaeI="}]},"maintainers":[{"name":"artur","email":"arturadib@gmail.com"}],"directories":{}},"0.0.2":{"name":"node-qt","version":"0.0.2","author":{"name":"Artur Adib","email":"arturadib@gmail.com"},"description":"Qt bindings for Node.js","repository":{"type":"git","url":"git://github.com/arturadib/node-qt.git"},"homepage":"http://github.com/arturadib/node-qt","main":"./lib/qt.js","keywords":["qt","gui","ui","graphics","audio","webkit"],"engines":{"node":">=0.6.14"},"dependencies":{"shelljs":"0.0.5pre4"},"scripts":{"install":"node-gyp rebuild"},"devDependencies":{},"optionalDependencies":{},"_npmUser":{"name":"artur","email":"arturadib@gmail.com"},"_id":"node-qt@0.0.2","_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"811ec246957fc2d54bd27f417849b6479e6386e5","tarball":"https://registry.npmjs.org/node-qt/-/node-qt-0.0.2.tgz","integrity":"sha512-RJrU1i0Fc82JaWCbhmbkpALkWw3IkP3vKSnVZJ996PD+WV/Hm6WdwyOjtbVScOhFjMoaR0TasbjbJD3LqATB/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFBB83GwGZ9Nf/Fpr56nLIEJG7tV/PZPxcPKD6bGWTUzAiBR3Uf9K4evd/OyJcPOW6hrOjEif8MccV9LjoTgCggyKw=="}]},"maintainers":[{"name":"artur","email":"arturadib@gmail.com"}],"directories":{}}},"readme":"# Node-Qt\n\nNode-Qt provides native bindings to the [Qt library](http://developer.qt.nokia.com/doc/qt-4.8/) as a [Node.js addon](http://nodejs.org/docs/latest/api/addons.html). The focus is on graphics and audio bindings; there is no need to duplicate the functionality of the Node API and its modules.\n\nWe try to follow [Qt's API](http://developer.qt.nokia.com/doc/qt-4.8/) as closely as possible, but sometimes quirks are inevitable (for example, virtual methods that handle events are translated into callback setters). See the header files in `src/` for a list of available bindings, and comments in `.cc` files for possible API differences.\n\nSupported platforms: **Mac OS X** | **Windows** | **Linux**\n\n\n#### Hello world\n\n```javascript\nvar qt = require('node-qt'),\n    app = new qt.QApplication,\n    window = new qt.QWidget;\n\n// Prevent objects from being GC'd\nglobal.app = app;\nglobal.window = window;\n\n// Quirk: the virtual method paintEvent() is mapped into a callback setter\nwindow.paintEvent(function() {\n  var p = new qt.QPainter();\n  p.begin(window);\n  p.drawText(20, 30, 'hello node, hello qt');\n  p.end();\n});\n\nwindow.resize(300, 150);\nwindow.show();\n\n// Join Node's event loop\nsetInterval(app.processEvents, 0);\n```\n\n\n\n\n\n\n\n\n\n\n\n# Getting started\n\nFrom your project directory, run (see below for requirements):\n\n```\n$ npm install node-qt\n```\n\nThis will download and build the latest release of Node-Qt in `node_modules/`. Then create a new file, say `helloworld.js`, copy the example above and run Node as usual:\n\n```\n$ node helloworld\n```\n\nSee the [examples/](https://github.com/arturadib/node-qt/tree/master/examples) directory for other simple use cases.\n\n\n\n\n\n\n\n\n\n\n\n# Requirements\n\nNode-Qt was designed to build seamlessly on a standard development box. The necessary platform-dependent Qt binaries are bundled with the module (due to heterogeneous dependencies, Linux is an exception).\n\n+ **Mac:** Python, Make, and GCC.\n+ **Windows:** Python and MSVC++ (either [free](http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express) or commercial).\n+ **Linux:** Python, Make, GCC, and Qt 4.7+. To install Qt on Ubuntu: `$ sudo apt-get install pkg-config qt-sdk`.\n\nNode-Qt has been tested with Node 0.6.x.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# Contributing\n\n\n\n## Building and testing\n\nTo download and build the development version:\n\n```\n$ git clone git://github.com/arturadib/node-qt.git\n$ cd node-qt\n$ npm install\n```\n\nTo run the unit tests:\n\n```\n$ node make test\n```\n\n(Ignore the image regression errors - they are based on snapshots that are platform- and backend-dependent).\n\n\n\n## Creating new bindings\n\nPlease provide a test case for every new binding added. See `test/` for examples of unit tests.\n\n#### Binding to new classes\n\n1. Create your files (e.g. `qclass.h`, `qclass.cc`) from the provided templates `src/template.h`, `src/template.cc`\n2. `qclass.*`: search and replace all occurrences of `__Template__`, `__TEMPLATE__`, and `__template__` with the corresponding class name\n3. `node-qt.gyp`: Add qclass.cc to sources list\n4. `qt.cc`: Include `qclass.h`\n5. `qt.cc`: Add `QClass::Initialize()` to `Initialize()`\n\n#### Binding to new methods\n\n1. `qclass.h`: Declare static method as per `Example()` method in `template.h`\n2. `qclass.cc`: Implement method as per `Example()` in `template.cc`\n3. `qclass.cc`: Expose method to JavaScript via `tpl->PrototypeTemplate()` call in `Initialize()`. Again see template.cc.\n\n\n## Common errors\n\nThis is a list of common errors when experimenting with Node addons, and their possible solutions:\n\n_\"Out of memory\"_\n\n`name` in `NODE_MODULE(name, ...)` does not match target name?\n\n_\"Unable to load shared library\"_\n\n`(v8 object)->Set()` called to register a method, but method implementation \nis missing?\n\n_\"Segmentation fault\"_\n\nTough luck :) Did you forget to `new` a wrapped object?\n","maintainers":[{"name":"artur","email":"arturadib@gmail.com"}],"time":{"modified":"2024-04-14T18:41:49.480Z","created":"2012-04-06T19:54:46.321Z","0.0.1":"2012-04-06T19:54:46.666Z","0.0.2":"2012-04-09T23:41:44.949Z"},"author":{"name":"Artur Adib","email":"arturadib@gmail.com"},"repository":{"type":"git","url":"git://github.com/arturadib/node-qt.git"},"users":{"solidco2":true,"pdedkov":true}}