nodegui 是基於qt + nodejs 的跨平台桌面開發方案,官方同時也提供了很不錯的文檔
簡單使用
使用官方的starter
- clone 代碼
git clone https://github.com/nodegui/nodegui-starter.git
- 安裝依賴
有點慢,稍等
cd nodegui-starter.
yarn
效果:
@nodegui/nodegui@0.1.8 install /Users/dalong/Documents/GitHub/nodegui-starter/node_modules/@nodegui/nodegui
> npm -v
6.9.0
> @nodegui/qode@1.0.4 postinstall /Users/dalong/Documents/GitHub/nodegui-starter/node_modules/@nodegui/qode
> node install.js
Local Qode 1.0.4 archive doesnt exists
Extracting binaries
> @nodegui/nodegui@0.1.8 postinstall /Users/dalong/Documents/GitHub/nodegui-starter/node_modules/@nodegui/nodegui
> npm run build:addon
> @nodegui/nodegui@0.1.8 build:addon /Users/dalong/Documents/GitHub/nodegui-starter/node_modules/@nodegui/nodegui
> node-gyp -j 8 configure build
CC(target) Release/obj.target/nothing/../../node-addon-api/src/nothing.o
TOUCH 8d54a0613d50a84adae49a5312f848b52b1b3ed9.intermediate
ACTION binding_gyp_qtnode_target_symlink_qt_headers 8d54a0613d50a84adae49a5312f848b52b1b3ed9.intermediate
LIBTOOL-STATIC Release/nothing.a
CXX(target) Release/obj.target/qtnode/src/cpp/main.o
CXX(target) Release/obj.target/qtnode/src/cpp/Extras/Utils/nutils.o
CXX(target) Release/obj.target/qtnode/src/cpp/core/FlexLayout/flexlayout.o
CXX(target) Release/obj.target/qtnode/src/cpp/core/FlexLayout/flexitem.o
CXX(target) Release/obj.target/qtnode/src/cpp/core/YogaWidget/nodestyle.o
CXX(target) Release/obj.target/qtnode/src/cpp/core/Events/eventsmap.o
CXX(target) Release/obj.target/qtnode/src/cpp/core/Events/eventwidget.o
CXX(target) Release/obj.target/qtnode/src/cpp/core/YogaWidget/yogawidget.o
CXX(target) Release/obj.target/qtnode/src/cpp/QtGui/QApplication/qapplication_wrap.o
CXX(target) Release/obj.target/qtnode/src/cpp/QtGui/QClipboard/qclipboard_wrap.o
CXX(target) Release/obj.target/qtnode/src/cpp/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.o
CXX(target) Release/obj.target/qtnode/src/cpp/QtGui/QPixmap/qpixmap_wrap.o
- 啟動
yarn start
- 效果
說明
nodegui 做為跨平台的桌面開發還是不錯的,性能很好,注意noodejs 的版本需要v12.0 以及以上的.同時官方也包含了一個基於react 的開發包,
而且還提供了一個跨平台的打包框架packer
參考資料
https://github.com/nodegui/nodegui
https://nodegui.github.io/nodegui/