All Projects → nodegui → Qode

nodegui / Qode

Qode is a lightly modified fork of Node.js that merges Node's event loop with Qt's event loop. It is designed to be used together with @nodegui/nodegui.

Projects that are alternatives of or similar to Qode

Nodegui Starter
A starter repo for NodeGui projects
Stars: ✭ 93 (+10.71%)
Mutual labels:  gui, qt, desktop
React Nodegui
Build performant, native and cross-platform desktop applications with native React + powerful CSS like styling.🚀
Stars: ✭ 5,914 (+6940.48%)
Mutual labels:  gui, qt, desktop
Vue Nodegui
Build performant, native and cross-platform desktop applications with native Vue + powerful CSS like styling.🚀
Stars: ✭ 575 (+584.52%)
Mutual labels:  gui, qt, desktop
React Nodegui Starter
Starter repository for react based native desktop apps using react-nodegui
Stars: ✭ 132 (+57.14%)
Mutual labels:  gui, qt, desktop
Nodegui
A library for building cross-platform native desktop applications with Node.js and CSS 🚀. React NodeGui : https://react.nodegui.org and Vue NodeGui: https://vue.nodegui.org
Stars: ✭ 7,324 (+8619.05%)
Mutual labels:  gui, qt, desktop
Phantomstyle
Cross-platform QStyle for traditionalists
Stars: ✭ 179 (+113.1%)
Mutual labels:  gui, qt, desktop
Qt.go
Qt binding for Go (Golang) aims get Go's compile speed again.
Stars: ✭ 487 (+479.76%)
Mutual labels:  gui, qt
Kotlin Libui
Kotlin/Native interop to libui: a portable GUI library
Stars: ✭ 512 (+509.52%)
Mutual labels:  gui, desktop
Qtsharp
Mono/.NET bindings for Qt
Stars: ✭ 532 (+533.33%)
Mutual labels:  gui, qt
Cutelog
GUI for logging
Stars: ✭ 386 (+359.52%)
Mutual labels:  gui, qt
Qdirstat
QDirStat - Qt-based directory statistics (KDirStat without any KDE - from the original KDirStat author)
Stars: ✭ 912 (+985.71%)
Mutual labels:  gui, qt
Lqt
Lua Binding for Qt5
Stars: ✭ 30 (-64.29%)
Mutual labels:  gui, qt
Azul
Azul is a library for creating graphical user interfaces in Rust and C. It mixes paradigms from functional, reactive and data-oriented programming with an API suitable for developing cross-platform desktop applications. The two core principles of Azul is to not render objects that aren't visible and to use composition of DOM trees over inheritance.
Stars: ✭ 4,937 (+5777.38%)
Mutual labels:  gui, desktop
Nheko
No longer maintained - Desktop client for the Matrix protocol (active fork https://github.com/Nheko-Reborn)
Stars: ✭ 410 (+388.1%)
Mutual labels:  qt, desktop
Compose Jb
Jetpack Compose for Desktop and Web, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
Stars: ✭ 7,562 (+8902.38%)
Mutual labels:  gui, desktop
Guitar
Git GUI Client
Stars: ✭ 1,136 (+1252.38%)
Mutual labels:  gui, qt
Mlde.d.moonlightde
Modular and Qt5 light new behavior desktop environment
Stars: ✭ 40 (-52.38%)
Mutual labels:  qt, desktop
Nitroshare Desktop
Network file transfer application for Windows, OS X, & Linux
Stars: ✭ 1,150 (+1269.05%)
Mutual labels:  gui, qt
Ariang Native
A better aria2 desktop frontend than AriaNg, containing all features of AriaNg and more features for desktop.
Stars: ✭ 1,176 (+1300%)
Mutual labels:  gui, desktop
Jqview
simplest possible native GUI for inspecting JSON objects with jq
Stars: ✭ 355 (+322.62%)
Mutual labels:  gui, qt

Qode

Qode is a lightly modified fork of Node.js that allows Node's event loop to be merged with Qt's or any other Gui event loop. It is designed to be used together with @nodegui/nodegui. Qode achieves this by allowing message loop injection via a NodeJS addon.

logo

Changes in v2.0

In version 2.0, Qode no longer depends on Qt as a dependency.

This makes it easier to upgrade Qt and also allows devs to use their own version of Qt. Technically this means its possible to integrate with another Gui system (not Qt) aswell.

Another benefit is that it helps in avoiding issues with 3rd party plugin development because of qt version mismatch.

Now, Qode essentially becomes nodejs + <some code changes to allow message loop injection via an addon>

Note:

Qode is published as a NPM module as @nodegui/qode. For more details on the npm module visit: npm/README.md The changes to node are visible in the qode-v12.x branches in https://github.com/nodegui/node

Changes to Node.js

  • The event loop remains the same as that of NodeJs until a new Gui message loop is injected via the qode api. See below for details on the api.
  • When a Gui message loop is injected, qode will use it as the primary event loop and will process NodeJs requests on the main thread as an when it arrives by listening to the libuv's events.
  • Note: Make sure to use a binary compatible version of nodejs when using alongside qode. For example is qode has node version of 12.x then use Node version 12.x when developing apps with qode.

Currently only 64bit OS's are supported.

Steps for Windows

====================

Use Powershell in windows (possibly with git bash or similar installed)

  1. Do a git clone for this repo

  2. Install Visual Studio Community 2017. Download the Visual studio Installer and install Visual Studio Community 2017/2019. Make sure to choose "Desktop development with C++ " workload and install it.

  3. Building Qode. Run node build.js

Steps for Linux

==================

  1. Do a git clone for this repo

  2. Install GTK headers and patchelf:

sudo apt install libgtk-3-dev patchelf
  1. Building Qode. Run node build.js

Steps for MacOS

==================

  1. Do a git clone for this repo

  2. Building Qode. Run node build.js

Common build errors:

  1. if you get an error similar to:

     fatal error: gtk/gtk.h: No such file or directory
     #include <gtk/gtk.h>
    

    Make sure you have installed gtk headers as mentioned above.

  2. If you get an error similar to: ./qode: error while loading shared libraries: cannot open shared object file: No such file or directory.

    Check the shared libraries used by qode by running ldd ./qode. Then you can provide the path where qode could find the libraries like this:

    LD_LIBRARY_PATH=<path_to_lib>:$LD_LIBRARY_PATH ./qode

And make sure you have installed gtk3 headers also for time being.

  1. Yoga crashes when using with Qode. Make sure that node version you are using to compile nodegui is binary compatible with node version of Qode. or make sure you compile addons with Qode instead of Node.

Usage

The prebuilt binaries can be found in the Releases page, modules installed by npm can be used directly in qode. Qode can also be installed via npm.

Note that it is strong recommended to install the official Node.js with the same version of qode, otherwise native modules installed by npm may not work correctly in qode.

Build

TARGET_ARCH=[x64|ia32] HOST_ARCH=[x64|ia32] node ./build.js

or

`cmd /C "set TARGET_ARCH=[x64|ia32] && set HOST_ARCH=[x64|ia32] && node build.js"`

PS: I havent tested ia32 builds

The output of the build will be present at node/out/Release/qode

Configurations (Available from qode v1.0.3)

Additional configurations can be done via a qode.json file in the same directory as that of the qode binary.

qode.json

{
  distPath: "./dist/index.js" // This will try to load the index.js inside dist folder when qode.exe is run.
}

Troubleshooting

  • If you face python cant open file 'configure' - This means the git submodules have not been synced. So either manually sync your git submodules or set the environment variable SYNC_GIT_SUBMODULE=true before running build. See https://github.com/nodegui/qode/issues/7

Message Loop injection api

The NodeGui core addon uses the following api exposed by qode binary to inject Qt's event loop into nodejs

https://github.com/nodegui/node/blob/43e31129fc27f738b171dca3d744a0e4245dcc6d/src/qode_shared.h#L12

#pragma once
// From Qode headers
namespace qode {
    extern int qode_argc;
    extern char **qode_argv;
    typedef int (*QodeCustomRunLoopFunc)();
    extern void InjectCustomRunLoop(QodeCustomRunLoopFunc customRunLoop);
}  // namespace qode

License

The MIT license.

Thanks

The idea of Qode is derived from yode and electron. Infact Qode is a heavily modified fork of yode. I thank Cheng Zhao for yode and many of the ideas behind integration of GUI based libraries with NodeJS.

Checklist before publishing

  • Make sure to build on all platforms.
  • Make sure to update Qode version in qode.cc
  • Create github release
  • publish on npm

Qode - Node version table

Qode Node
v2.1.0 v14.2.0
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].