You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 9, 2021. It is now read-only.
> In version 2.0, Qode no longer depends on Qt as a dependency.
12
+
>
13
+
> 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.
14
+
>
15
+
> Another benefit is that it helps in avoiding issues with 3rd party plugin development because of qt version mismatch.
16
+
>
17
+
> Now, Qode essentially becomes nodejs + `<some code changes to allow message loop injection via an addon>`
18
+
19
+
8
20
### Note:
9
21
10
22
Qode is published as a NPM module as `@nodegui/qode`.
11
23
For more details on the npm module visit: `npm/README.md`
24
+
The changes to node are visible in the `qode-v12.x` branches in `https://github.com/nodegui/node`
12
25
13
26
## Changes to Node.js
14
27
15
-
- The event loop is replaced with QT's GUI message loop.
16
-
- The process will quit when **BOTH** the QT message loop and Node.js event
17
-
loop have quit. So if there are still Node.js requests pending, the process
18
-
will wait until all of them have finished.
19
-
- There are new `process.versions.qode` property added - This mentions the qode version.
20
-
- There are new `process.versions.qt(runtime)` property added - This mentions the version of qt shared library you are using on runtime.
21
-
- There are new `process.versions.qt(compiled)` property added - This mentions the version of qt used while compiling qode. Ideally both runtime and compile time versions should be same but binary compatible versions could work too.
22
-
- 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.
28
+
- 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.
29
+
- 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.
30
+
- 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.
23
31
24
32
Currently only 64bit OS's are supported.
25
33
@@ -31,11 +39,9 @@ Use Powershell in windows (possibly with git bash or similar installed)
31
39
32
40
1. Do a git clone for this repo
33
41
34
-
2. Install Visual Studio Community 2017. Download the Visual studio Installer and install Visual Studio Community 2017. Make sure to choose "Desktop development with C++ " workload and install it. PS: Visual Studio 2019 will not work since NodeJS build toolchain doesnt support it aswell.
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.
37
43
38
-
4. Building Qode. Run `cmd /C "set QT_INSTALL_DIR=C:\path\to\qt\5.13.0\msvc2017_64&& node build.js"`
44
+
3. Building Qode. Run `node build.js`
39
45
40
46
## Steps for Linux
41
47
@@ -49,73 +55,35 @@ Use Powershell in windows (possibly with git bash or similar installed)
And make sure you have installed gtk3 headers also for time being.
118
-
Make sure you add LD_LIBRARY_PATH to the path to qt and then run the built executable
119
87
120
88
4. 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.
`cmd /C "set QT_INSTALL_DIR=<path_to_qt_install_directory> && set TARGET_ARCH=[x64|ia32] && set HOST_ARCH=[x64|ia32] && node build.js"`
108
+
`cmd /C "set TARGET_ARCH=[x64|ia32] && set HOST_ARCH=[x64|ia32] && node build.js"`
141
109
```
142
110
143
111
_PS: I havent tested ia32 builds_
144
112
145
-
The output of the build will be present at qode/node/out/Release/<platform> (platform is darwin, win32 or linux)
113
+
The output of the build will be present at node/out/Release/qode
146
114
147
115
## Configurations (Available from qode v1.0.3)
148
116
@@ -152,16 +120,32 @@ Additional configurations can be done via a qode.json file in the same directory
152
120
153
121
```javascript
154
122
{
155
-
libraryPaths: [], //Specify extra library paths to load dlls from
156
-
hideConsole:false, //If true it will hide the console window as soon as application is launched.
157
-
distPath:"./dist/index.js"// This will try to load the index.js inside dist folder when qode.exe is run. Internally it just adds NODE_OPTIONS="--require ./dist/index.js"
123
+
distPath:"./dist/index.js"// This will try to load the index.js inside dist folder when qode.exe is run.
158
124
}
159
125
```
160
126
161
127
## Troubleshooting
162
128
163
129
- 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
164
130
131
+
## Message Loop injection api
132
+
133
+
The NodeGui core addon uses the following api exposed by qode binary to inject Qt's event loop into nodejs
0 commit comments