使用nodegui 開發高性能的跨平臺桌面端應用

nodegui 是基於qt + nodejs 的跨平臺桌面開發方案,官方同時也提供了很不錯的文檔node

簡單使用

使用官方的starterreact

  • clone 代碼
git clone https://github.com/nodegui/nodegui-starter.git
  • 安裝依賴
    有點慢,稍等
 
cd nodegui-starter.
yarn 

效果:git

@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... Copying Qode from cache...
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 的開發包, 
並且還提供了一個跨平臺的打包框架packergithub

參考資料

https://github.com/nodegui/nodegui
https://nodegui.github.io/nodegui/npm

相關文章
相關標籤/搜索