{"id":13417904,"url":"https://github.com/arturadib/node-qt","last_synced_at":"2025-05-16T00:03:23.266Z","repository":{"id":2533576,"uuid":"3510440","full_name":"arturadib/node-qt","owner":"arturadib","description":"C++ Qt bindings for Node.js","archived":false,"fork":false,"pushed_at":"2014-06-15T15:35:50.000Z","size":16625,"stargazers_count":1619,"open_issues_count":22,"forks_count":171,"subscribers_count":76,"default_branch":"master","last_synced_at":"2025-05-09T10:06:57.880Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://documentup.com/arturadib/node-qt","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arturadib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-22T01:49:24.000Z","updated_at":"2025-04-18T18:59:06.000Z","dependencies_parsed_at":"2022-07-12T14:57:51.343Z","dependency_job_id":null,"html_url":"https://github.com/arturadib/node-qt","commit_stats":{"total_commits":17,"total_committers":4,"mean_commits":4.25,"dds":"0.17647058823529416","last_synced_commit":"d4106a11f1ec88fdb404c2d56fb14efe0dec7d35"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturadib%2Fnode-qt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturadib%2Fnode-qt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturadib%2Fnode-qt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturadib%2Fnode-qt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arturadib","download_url":"https://codeload.github.com/arturadib/node-qt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442854,"owners_count":22071877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T22:00:55.159Z","updated_at":"2025-05-16T00:03:18.241Z","avatar_url":"https://github.com/arturadib.png","language":"C++","funding_links":[],"categories":["TODO scan for Android support in followings","Node.js","C++"],"sub_categories":[],"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\nFor a translation of Qt's APIs into HTML5 APIs, see [Node-Five](http://github.com/arturadib/node-five).\n\nSupported platforms: **Mac OS X** | **Windows** | **Linux**\n\n\n#### Hello world\n\nEver wanted to create native apps directly from Node? Here's a simple example illustrating how to create a native window via `QWidget()` and draw via `QPainter()`:\n\n![Screenshot](https://github.com/arturadib/node-qt/raw/master/examples/helloworld.png)\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\nAlternatively, to use the latest development version from Github:\n\n```\n$ npm install git://github.com/arturadib/node-qt.git\n```\n\nThis will download and build 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# Build requirements\n\nNode-Qt was designed to build seamlessly with minimal dependencies on most platforms. The necessary platform-dependent Qt binaries are bundled with the module (due to heterogeneous dependencies, Linux is an exception).\n\nFor all platforms: Node \u003e= **0.6.14**\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, pkg-config, and Qt 4.7+. To install pkg-config and Qt on Ubuntu: `$ sudo apt-get install pkg-config qt-sdk`.\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-\u003ePrototypeTemplate()` 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)-\u003eSet()` 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farturadib%2Fnode-qt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farturadib%2Fnode-qt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farturadib%2Fnode-qt/lists"}