{"id":20843766,"url":"https://github.com/node-3d/qml-raub","last_synced_at":"2025-05-09T01:46:40.798Z","repository":{"id":16619477,"uuid":"80292661","full_name":"node-3d/qml-raub","owner":"node-3d","description":"QML interoperation for Node.js","archived":false,"fork":false,"pushed_at":"2025-01-12T19:56:21.000Z","size":486,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-09T01:46:33.000Z","etag":null,"topics":["addon","bindings","graphics","native","node-3d","offscreen-rending","qml"],"latest_commit_sha":null,"homepage":"https://github.com/node-3d/node-3d","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/node-3d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-28T15:42:54.000Z","updated_at":"2025-01-12T19:56:24.000Z","dependencies_parsed_at":"2025-01-12T19:32:45.783Z","dependency_job_id":null,"html_url":"https://github.com/node-3d/qml-raub","commit_stats":{"total_commits":205,"total_committers":3,"mean_commits":68.33333333333333,"dds":0.4585365853658536,"last_synced_commit":"d243632e5d5fb0e352b098b8289de31dce90ae37"},"previous_names":["raub/node-qml"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2Fqml-raub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2Fqml-raub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2Fqml-raub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2Fqml-raub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-3d","download_url":"https://codeload.github.com/node-3d/qml-raub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253176443,"owners_count":21866142,"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":["addon","bindings","graphics","native","node-3d","offscreen-rending","qml"],"created_at":"2024-11-18T02:06:58.574Z","updated_at":"2025-05-09T01:46:40.782Z","avatar_url":"https://github.com/node-3d.png","language":"JavaScript","readme":"# Offscreen QML for Node.js\n\nThis is a part of [Node3D](https://github.com/node-3d) project.\n\n[![NPM](https://badge.fury.io/js/qml-raub.svg)](https://badge.fury.io/js/qml-raub)\n[![ESLint](https://github.com/node-3d/qml-raub/actions/workflows/eslint.yml/badge.svg)](https://github.com/node-3d/qml-raub/actions/workflows/eslint.yml)\n[![Test](https://github.com/node-3d/qml-raub/actions/workflows/test.yml/badge.svg)](https://github.com/node-3d/qml-raub/actions/workflows/test.yml)\n[![Cpplint](https://github.com/node-3d/qml-raub/actions/workflows/cpplint.yml/badge.svg)](https://github.com/node-3d/qml-raub/actions/workflows/cpplint.yml)\n\n```console\nnpm i -s qml-raub\n```\n\n**QML (Qt 6.8.0)** interoperation addon for **Node.js**.\nSee [Qt Documentation](https://doc.qt.io/qt-6/qmlapplications.html)\nfor QML features and syntax.\n\n![Example](examples/screenshot.png)\n\n\u003e Note: this **addon uses N-API**, and therefore is ABI-compatible across different\nNode.js versions. Addon binaries are precompiled and **there is no compilation**\nstep during the `npm i` command.\n\n```js\nconst { View } = require('qml-raub');\nView.init(process.cwd(), hwnd, ctx, device);\n\nconst ui = new View({ width, height, file: 'gui.qml' });\n```\n\nThe QML engine must be initialized first. Then, new View instances can be created.\n\n* See [TypeScript declarations](/index.d.ts) for more details.\n* See [example](/examples/main.ts) for a complete setup.\n\nQML views can process input events. Mouse and keyboard events can be sent to a view.\nUnhandled (unused) events are re-emitted by the view.\nChanging the event flow from `window -\u003e app` to `window -\u003e ui -\u003e app` allows blocking\nthe handled events. For example, when a QML button is pressed, a 3D scene\nbehind the button won't receive any mouse event. Or when a QML input is\nfocused, the app's hotkeys won't be triggered by typing text.\n\n\n## View\n\nMain class that loads and manages a QML file.\n\nWhen the file is loaded and whenever the QML scene is resized a new GL\n**Texture** (id) is created and reported in an event (type 'reset').\nThen the texture can be placed onto any drawable surface.\n\nFor example a screen-sized rectangle with this texture would look as if it is\nthe app's UI, which it already almost is. Also some in-scene quads, e.g. a PC\ndisplay in the distant corner of 3d room, can be textured this way.\n\n```js\nconst ui = new View({ width, height, file: 'gui.qml' });\n```\n\nSee [TypeScript declarations](/index.d.ts) for more details.\n\nEvents:\n* `'destroy'` - emitted when the scene is destroyed.\n* `'load'` - emitted when the scene is fully loaded.\n* `'reset', textureId` - emitted when a new texture is generated.\n* \u003cANY_EVENTS\u003e - being an [EventEmitter](https://nodejs.org/api/events.html),\nviews can emit anything. On QML side, a special global\nfunction `eventEmit(type, data)` is present. Using this function any event can\nbe generated from QML side.\n\n---\n\n## Property\n\nHelper class to access QML data. Automates reading and writing QML objects. A QML object should\nhave `objectName` and the target property. The value must be serializable.\n\n```js\nconst x1 = new Property({ view, name: 'obj1', key: 'x1' });\nx1.value = 10;\n```\n\nSee [TypeScript declarations](/index.d.ts) for more details.\n\n---\n\n## Method\n\nHelper class to call a QML method. A QML object should have `objectName`\nand the target method.\n\n```js\nconst f1 = new Method({ view, name: 'obj1', key: 'f1' });\nconst y = f1(a, b, c);\n```\n\nInstances of this class are actually functions on their own. Up to 10 arguments\ncan be used for the call. Functions may immediately return a value.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-3d%2Fqml-raub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-3d%2Fqml-raub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-3d%2Fqml-raub/lists"}