Compare commits
240 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f41edc2ea4 | ||
|
|
30ab4442cf | ||
|
|
90e556be6e | ||
|
|
e9ff6a93fb | ||
|
|
5879ad7ec4 | ||
|
|
731d186b01 | ||
|
|
47d98500cf | ||
|
|
2561fd92f9 | ||
|
|
9129cdef0d | ||
|
|
613ee337aa | ||
|
|
bd6595e40a | ||
|
|
d827e51ba4 | ||
|
|
77fd5c5a3f | ||
|
|
a2e5b73107 | ||
|
|
4e42f61faa | ||
|
|
3a04d14872 | ||
|
|
e18e912d11 | ||
|
|
15478751db | ||
|
|
d715a4299d | ||
|
|
09d450aef4 | ||
|
|
e5fd79e4c1 | ||
|
|
86fc6689fb | ||
|
|
d6ba15df55 | ||
|
|
86e9447dd0 | ||
|
|
29e919caad | ||
|
|
88e5149a9f | ||
|
|
33c0b24731 | ||
|
|
d4c443607e | ||
|
|
6422d7faca | ||
|
|
1468612a78 | ||
|
|
bbb0951525 | ||
|
|
47083b4a86 | ||
|
|
5a51e2748b | ||
|
|
93dbf25938 | ||
|
|
898c7f58c9 | ||
|
|
b7d503fd39 | ||
|
|
95da509b83 | ||
|
|
34c8f511d9 | ||
|
|
3f0d00c83c | ||
|
|
79433a5c83 | ||
|
|
abc1d2cf64 | ||
|
|
f7c4d5dfae | ||
|
|
2305b7072b | ||
|
|
643eff4a90 | ||
|
|
e2e06ca027 | ||
|
|
a7df290d58 | ||
|
|
123524d126 | ||
|
|
28b98b055a | ||
|
|
76743cd414 | ||
|
|
9fcc5e99d3 | ||
|
|
4a55d9ec45 | ||
|
|
7d690dc75d | ||
|
|
2ece6d5375 | ||
|
|
421929c147 | ||
|
|
755156c19a | ||
|
|
43deec1c9e | ||
|
|
e20517430e | ||
|
|
16940eca53 | ||
|
|
37d000ee44 | ||
|
|
0db724d40c | ||
|
|
1da7ae6de3 | ||
|
|
1b3478e0cb | ||
|
|
11bf45466d | ||
|
|
b36caeddd2 | ||
|
|
f606ebdd72 | ||
|
|
0f9ad1e028 | ||
|
|
fcdbfb07c3 | ||
|
|
06637c6c0f | ||
|
|
c28fd5d5c3 | ||
|
|
d450841001 | ||
|
|
5191892950 | ||
|
|
bfa531f1f4 | ||
|
|
6aa3f00fa3 | ||
|
|
f3d7d73acc | ||
|
|
880ea7c998 | ||
|
|
bc9bf12e11 | ||
|
|
02f901ddf1 | ||
|
|
cbb3f99dfa | ||
|
|
7bf97ef618 | ||
|
|
1d92cc8f3e | ||
|
|
9faf63d5d3 | ||
|
|
7dcbc32540 | ||
|
|
387555f3c0 | ||
|
|
10ebd00cde | ||
|
|
fda93e9dd5 | ||
|
|
23759b1aaa | ||
|
|
165bb820bc | ||
|
|
83e9c09690 | ||
|
|
b7476a4ea1 | ||
|
|
38b12759c6 | ||
|
|
c6d30f8f9f | ||
|
|
4f40510248 | ||
|
|
c733a41d10 | ||
|
|
81c31f4de3 | ||
|
|
ac1c118ae3 | ||
|
|
7d2dfc1cf2 | ||
|
|
0c2cf50362 | ||
|
|
a485be9c1e | ||
|
|
e2ccec9ba3 | ||
|
|
7d8fb77481 | ||
|
|
4c5ccadfc7 | ||
|
|
69d0e2e3cd | ||
|
|
733c24e6cd | ||
|
|
4155a1f586 | ||
|
|
34ce565bb8 | ||
|
|
d805c7c66d | ||
|
|
3291216bbb | ||
|
|
eb6754fe8a | ||
|
|
b4c9c0d51b | ||
|
|
8058433031 | ||
|
|
c877a2814e | ||
|
|
2865212937 | ||
|
|
ed7da32952 | ||
|
|
a0b53f2e0c | ||
|
|
714bdcbdbb | ||
|
|
a2fd884543 | ||
|
|
93c6c121f6 | ||
|
|
dab7eee4ad | ||
|
|
f90ae67864 | ||
|
|
ddb560abbf | ||
|
|
5de4210cfb | ||
|
|
daf730efd5 | ||
|
|
c61c9c085d | ||
|
|
e0dfc94363 | ||
|
|
9b451ecac3 | ||
|
|
26736d06c8 | ||
|
|
01d3c03fb2 | ||
|
|
b783bbe6d6 | ||
|
|
640c77dd56 | ||
|
|
b6ae8ad1cc | ||
|
|
c5e2485e0e | ||
|
|
de2ce99fdd | ||
|
|
0867b96302 | ||
|
|
78895a002f | ||
|
|
9f9e61289b | ||
|
|
69dea9c4c8 | ||
|
|
94ce790891 | ||
|
|
21ed97037a | ||
|
|
1ab7d13b96 | ||
|
|
47b3d514bb | ||
|
|
e653c3ad1d | ||
|
|
0e33e39759 | ||
|
|
d11ed993ee | ||
|
|
8d4a7f2d00 | ||
|
|
06528cdd67 | ||
|
|
0d71db9b24 | ||
|
|
05a5fdd539 | ||
|
|
b35f386e46 | ||
|
|
59a4f4abb4 | ||
|
|
7ae4a5cb7e | ||
|
|
2dc8319b50 | ||
|
|
eea4f6fe30 | ||
|
|
c44d40b2e5 | ||
|
|
88b2fcbcd1 | ||
|
|
f7f86d5cfa | ||
|
|
2b2d2a65b2 | ||
|
|
123123605c | ||
|
|
710cfa3d31 | ||
|
|
05c690dcd9 | ||
|
|
fa52c674ef | ||
|
|
8ce6dde45b | ||
|
|
bfd45b3a54 | ||
|
|
8ddc4172cd | ||
|
|
81eeaa3a20 | ||
|
|
47c00fabc1 | ||
|
|
3bbb7da6e7 | ||
|
|
c4d9a93e56 | ||
|
|
f92bd65407 | ||
|
|
c91856641c | ||
|
|
3479606f83 | ||
|
|
797835ad79 | ||
|
|
96b3cbe594 | ||
|
|
3ada99b201 | ||
|
|
bd6b127358 | ||
|
|
481062423e | ||
|
|
328dcea8c8 | ||
|
|
f8ed7d3a78 | ||
|
|
12d79a62da | ||
|
|
c7b2e4c8b7 | ||
|
|
91d652ed84 | ||
|
|
590385339c | ||
|
|
44bb1e5f0e | ||
|
|
a4a961666a | ||
|
|
7af718b834 | ||
|
|
8060a631b1 | ||
|
|
01096abede | ||
|
|
8110982412 | ||
|
|
4429959fed | ||
|
|
920e64404d | ||
|
|
87af1db2bc | ||
|
|
391971f80b | ||
|
|
5aab3ed97d | ||
|
|
e6f838375a | ||
|
|
907acb5ad2 | ||
|
|
b6fc24d6e0 | ||
|
|
1b399ef5be | ||
|
|
c3c597df4d | ||
|
|
25f529757e | ||
|
|
edf437f056 | ||
|
|
8c79f3d093 | ||
|
|
55217146ae | ||
|
|
456824c504 | ||
|
|
4f0f64884d | ||
|
|
1f11f1cf8b | ||
|
|
d81b781d1f | ||
|
|
053fc9dc65 | ||
|
|
11c33771c2 | ||
|
|
5fd23f0ba3 | ||
|
|
c209fe2adc | ||
|
|
940351acbe | ||
|
|
f7a4a4d3d1 | ||
|
|
e81b5ae658 | ||
|
|
588093519a | ||
|
|
3a83a7fe62 | ||
|
|
b5a9f30d34 | ||
|
|
25026a55f7 | ||
|
|
467231d4b7 | ||
|
|
3aeb4b09bf | ||
|
|
9eed41ecd8 | ||
|
|
25e0d61e01 | ||
|
|
080bb3626d | ||
|
|
c26a194694 | ||
|
|
a577689cd4 | ||
|
|
d3f6d6d092 | ||
|
|
87e6531c65 | ||
|
|
faa6adcb23 | ||
|
|
880a8433cb | ||
|
|
f319a24ad3 | ||
|
|
17462abae7 | ||
|
|
978526c4e6 | ||
|
|
2901d09d01 | ||
|
|
af64c4820f | ||
|
|
0d01354737 | ||
|
|
d04364a186 | ||
|
|
4a66c65034 | ||
|
|
4eebad6f5f | ||
|
|
281a89508b | ||
|
|
f38c50724d | ||
|
|
76d737340e | ||
|
|
6edf90ee97 |
@ -22,6 +22,7 @@ module.exports = {
|
|||||||
'@typescript-eslint/camelcase': 0,
|
'@typescript-eslint/camelcase': 0,
|
||||||
'@typescript-eslint/no-var-requires': 0,
|
'@typescript-eslint/no-var-requires': 0,
|
||||||
'@typescript-eslint/no-explicit-any': 0,
|
'@typescript-eslint/no-explicit-any': 0,
|
||||||
|
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
4
.github/workflows/docs.yml
vendored
4
.github/workflows/docs.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '14.x'
|
node-version: '16.x'
|
||||||
- name: Add key to allow access to repository
|
- name: Add key to allow access to repository
|
||||||
env:
|
env:
|
||||||
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
||||||
@ -33,7 +33,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config --global user.email "actions@gihub.com"
|
git config --global user.email "actions@gihub.com"
|
||||||
git config --global user.name "gh-actions"
|
git config --global user.name "gh-actions"
|
||||||
npm install --ignore-scripts
|
yarn install --ignore-scripts
|
||||||
npm run docs
|
npm run docs
|
||||||
cd website
|
cd website
|
||||||
if [ -e yarn.lock ]; then
|
if [ -e yarn.lock ]; then
|
||||||
|
|||||||
11
.github/workflows/latest.yml
vendored
11
.github/workflows/latest.yml
vendored
@ -7,17 +7,20 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-18.04]
|
os: [ubuntu-20.04]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '14.x'
|
node-version: '16.x'
|
||||||
|
- name: Install ubuntu deps
|
||||||
|
if: contains(matrix.os, 'ubuntu-20.04')
|
||||||
|
run: sudo apt install mesa-common-dev libglu1-mesa-dev libegl1 libopengl-dev
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: npm install --ignore-scripts
|
run: npm install
|
||||||
- name: Build nodegui
|
- name: Build nodegui
|
||||||
run: npx tsc
|
run: npm run build
|
||||||
- name: Archive using npm pack
|
- name: Archive using npm pack
|
||||||
run: npm --no-git-tag-version version 0.0.0-latest-master && npm pack
|
run: npm --no-git-tag-version version 0.0.0-latest-master && npm pack
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
|
|||||||
82
.github/workflows/release.yml
vendored
82
.github/workflows/release.yml
vendored
@ -5,17 +5,93 @@ on:
|
|||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
precompile:
|
||||||
|
if: contains(github.event.release.tag_name, 'v0.0.0-latest-master') == false
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
platform: linux
|
||||||
|
arch: x64
|
||||||
|
- os: windows-latest
|
||||||
|
platform: win32
|
||||||
|
arch: x64
|
||||||
|
- os: macos-latest
|
||||||
|
platform: darwin
|
||||||
|
arch: x64
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
env:
|
||||||
|
ARCHIVE_FILENAME: nodegui-binary-${{github.event.release.tag_name}}-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '16.x'
|
||||||
|
|
||||||
|
- name: Install ubuntu deps
|
||||||
|
if: contains(matrix.os, 'ubuntu-20.04')
|
||||||
|
run: sudo apt install mesa-common-dev libglu1-mesa-dev libegl1 libopengl-dev
|
||||||
|
|
||||||
|
- name: Install deps
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Build nodegui
|
||||||
|
run: npm run build
|
||||||
|
env:
|
||||||
|
CMAKE_BUILD_PARALLEL_LEVEL: 8
|
||||||
|
|
||||||
|
- name: Compress files
|
||||||
|
if: ${{!contains(matrix.os, 'windows-latest')}}
|
||||||
|
uses: a7ul/tar-action@v1.0.2
|
||||||
|
id: compress
|
||||||
|
with:
|
||||||
|
command: c
|
||||||
|
cwd: ./build/Release
|
||||||
|
files: |
|
||||||
|
./nodegui_core.node
|
||||||
|
outPath: ${{ env.ARCHIVE_FILENAME }}
|
||||||
|
|
||||||
|
- name: Compress files (Windows)
|
||||||
|
if: contains(matrix.os, 'windows-latest')
|
||||||
|
uses: a7ul/tar-action@v1.0.2
|
||||||
|
id: compress-windows
|
||||||
|
with:
|
||||||
|
command: c
|
||||||
|
cwd: ./build/Release
|
||||||
|
files: |
|
||||||
|
./nodegui_core.node
|
||||||
|
./nodegui_core.lib
|
||||||
|
./nodegui_core.exp
|
||||||
|
outPath: ${{ env.ARCHIVE_FILENAME }}
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: ${{ env.ARCHIVE_FILENAME }}
|
||||||
|
path: ${{ env.ARCHIVE_FILENAME }}
|
||||||
|
|
||||||
|
- name: Upload release binaries
|
||||||
|
uses: alexellis/upload-assets@0.2.2
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
with:
|
||||||
|
asset_paths: '["${{ env.ARCHIVE_FILENAME }}"]'
|
||||||
|
|
||||||
publish-npm-package:
|
publish-npm-package:
|
||||||
|
needs: precompile
|
||||||
if: contains(github.event.release.tag_name, 'v0.0.0-latest-master') == false
|
if: contains(github.event.release.tag_name, 'v0.0.0-latest-master') == false
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '14.x'
|
node-version: '16.x'
|
||||||
- name: Install ubuntu deps
|
- name: Install ubuntu deps
|
||||||
run: sudo apt install mesa-common-dev libglu1-mesa-dev
|
run: sudo apt update
|
||||||
|
- run: sudo apt install mesa-common-dev libglu1-mesa-dev
|
||||||
- run: npm install
|
- run: npm install
|
||||||
|
- run: echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
|
||||||
- run: npm publish --access=public
|
- run: npm publish --access=public
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||||
|
CMAKE_BUILD_PARALLEL_LEVEL: 8
|
||||||
|
|||||||
10
.github/workflows/test.yml
vendored
10
.github/workflows/test.yml
vendored
@ -6,20 +6,22 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-18.04, windows-latest, macos-latest]
|
os: [ubuntu-20.04, windows-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '14.x'
|
node-version: '16.x'
|
||||||
- name: Install ubuntu deps
|
- name: Install ubuntu deps
|
||||||
if: contains(matrix.os, 'ubuntu')
|
if: contains(matrix.os, 'ubuntu-20.04')
|
||||||
run: sudo apt install mesa-common-dev libglu1-mesa-dev
|
run: sudo apt install mesa-common-dev libglu1-mesa-dev libegl1 libopengl-dev
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: npm install
|
run: npm install
|
||||||
- name: Build nodegui
|
- name: Build nodegui
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
env:
|
||||||
|
CMAKE_BUILD_PARALLEL_LEVEL: 8
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm run test
|
run: npm run test
|
||||||
- name: Run linters for cpp
|
- name: Run linters for cpp
|
||||||
|
|||||||
@ -11,6 +11,10 @@ set(CORE_WIDGETS_ADDON "nodegui_core")
|
|||||||
|
|
||||||
project(${CORE_WIDGETS_ADDON})
|
project(${CORE_WIDGETS_ADDON})
|
||||||
|
|
||||||
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
|
||||||
|
|
||||||
|
# Note: CMake+moc also use this list when finding files which `moc` applied.
|
||||||
|
|
||||||
add_library(${CORE_WIDGETS_ADDON} SHARED
|
add_library(${CORE_WIDGETS_ADDON} SHARED
|
||||||
"${CMAKE_JS_SRC}"
|
"${CMAKE_JS_SRC}"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/main.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/main.cpp"
|
||||||
@ -24,6 +28,8 @@ add_library(${CORE_WIDGETS_ADDON} SHARED
|
|||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/Events/eventsmap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/Events/eventsmap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/Events/eventwidget.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/Events/eventwidget.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/YogaWidget/yogawidget.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/YogaWidget/yogawidget.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/core/WrapperCache/wrappercache.h"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/core/WrapperCache/wrappercache.cpp"
|
||||||
# core deps
|
# core deps
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/deps/yoga/log.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/deps/yoga/log.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/deps/yoga/Utils.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/deps/yoga/Utils.cpp"
|
||||||
@ -46,15 +52,21 @@ add_library(${CORE_WIDGETS_ADDON} SHARED
|
|||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QDrag/qdrag_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QDrag/qdrag_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QMouseEvent/qmouseevent_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QMouseEvent/qmouseevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QMoveEvent/qmoveevent_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QWheelEvent/qwheelevent_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QWheelEvent/qwheelevent_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QNativeGestureEvent/qnativegestureevent_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QNativeGestureEvent/qnativegestureevent_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QPaintEvent/qpaintevent_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QPaintEvent/qpaintevent_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QTabletEvent/qtabletevent_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QTabletEvent/qtabletevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QTimerEvent/qtimerevent_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QDropEvent/qdropevent_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QDropEvent/qdropevent_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QDragMoveEvent/qdragmoveevent_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QDragMoveEvent/qdragmoveevent_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QDragLeaveEvent/qdragleaveevent_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QDragLeaveEvent/qdragleaveevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QResizeEvent/qresizeevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QInputMethodEvent/qinputmethodevent_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QEvent/QInputMethodQueryEvent/qinputmethodqueryevent_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QFontDatabase/qfontdatabase_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QFontDatabase/qfontdatabase_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QFontMetrics/qfontmetrics_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QFontMetrics/qfontmetrics_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QFontMetricsF/qfontmetricsf_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QPicture/qpicture_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QPicture/qpicture_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QPixmap/qpixmap_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QPixmap/qpixmap_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QIcon/qicon_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QIcon/qicon_wrap.cpp"
|
||||||
@ -63,13 +75,19 @@ add_library(${CORE_WIDGETS_ADDON} SHARED
|
|||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QCursor/qcursor_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QCursor/qcursor_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QKeySequence/qkeysequence_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QKeySequence/qkeysequence_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QMovie/qmovie_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QMovie/qmovie_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QPalette/qpalette_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QScreen/qscreen_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QStyle/qstyle_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QStyle/qstyle_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtGui/QWindow/qwindow_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QAbstractItemModel/qabstractitemmodel_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QDate/qdate_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QDate/qdate_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QDateTime/qdatetime_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QDateTime/qdatetime_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QItemSelectionModel/qitemselectionmodel_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QModelIndex/qmodelindex_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QModelIndex/qmodelindex_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QObject/qobject_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QObject/qobject_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QVariant/qvariant_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QVariant/qvariant_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QSize/qsize_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QSize/qsize_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QSizeF/qsizef_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QSettings/qsettings_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QSettings/qsettings_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QRect/qrect_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QRect/qrect_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QRectF/qrectf_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtCore/QRectF/qrectf_wrap.cpp"
|
||||||
@ -93,6 +111,7 @@ add_library(${CORE_WIDGETS_ADDON} SHARED
|
|||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QFrame/qframe_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QFrame/qframe_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QGraphicsBlurEffect/qgraphicsblureffect_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QGraphicsBlurEffect/qgraphicsblureffect_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QGraphicsDropShadowEffect/qgraphicsdropshadoweffect_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QGraphicsDropShadowEffect/qgraphicsdropshadoweffect_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QHeaderView/qheaderview_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QListView/qlistview_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QListView/qlistview_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QListWidget/qlistwidget_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QListWidget/qlistwidget_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QListWidgetItem/qlistwidgetitem_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QListWidgetItem/qlistwidgetitem_wrap.cpp"
|
||||||
@ -141,8 +160,12 @@ add_library(${CORE_WIDGETS_ADDON} SHARED
|
|||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QStandardItemModel/qstandarditemmodel_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QStandardItemModel/qstandarditemmodel_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QStandardItem/qstandarditem_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QStandardItem/qstandarditem_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QSvgWidget/qsvgwidget_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QSvgWidget/qsvgwidget_wrap.cpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QDesktopWidget/qdesktopwidget_wrap.cpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QStyleFactory/qstylefactory_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QSplitter/qsplitter_wrap.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/QtWidgets/QAbstractItemDelegate/qabstractitemdelegate_wrap.cpp"
|
||||||
# Custom widgets (include them for automoc since they contain Q_OBJECT)
|
# Custom widgets (include them for automoc since they contain Q_OBJECT)
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtCore/QAbstractItemModel/nabstractitemmodel.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtCore/QItemSelectionModel/nitemselectionmodel.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtCore/QObject/nobject.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtCore/QObject/nobject.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/core/FlexLayout/flexlayout.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/core/FlexLayout/flexlayout.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtGui/QMovie/nmovie.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtGui/QMovie/nmovie.hpp"
|
||||||
@ -204,7 +227,13 @@ add_library(${CORE_WIDGETS_ADDON} SHARED
|
|||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QTextBrowser/ntextbrowser.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QTextBrowser/ntextbrowser.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QTextEdit/ntextedit.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QTextEdit/ntextedit.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QSvgWidget/nsvgwidget.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QSvgWidget/nsvgwidget.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QDesktopWidget/nqdesktopwidget.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QHeaderView/nheaderview.hpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtWidgets/QSplitter/nsplitter.hpp"
|
||||||
|
|
||||||
|
# Test
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/test/CacheTestQObject.h"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/test/CacheTestQObject.cpp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cpp/lib/test/cachetestqobject_wrap.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
AddCommonConfig(${CORE_WIDGETS_ADDON})
|
AddCommonConfig(${CORE_WIDGETS_ADDON})
|
||||||
@ -227,14 +256,28 @@ if (WIN32)
|
|||||||
target_compile_definitions(${CORE_WIDGETS_ADDON} PRIVATE
|
target_compile_definitions(${CORE_WIDGETS_ADDON} PRIVATE
|
||||||
ENABLE_DLL_EXPORT=1
|
ENABLE_DLL_EXPORT=1
|
||||||
)
|
)
|
||||||
target_compile_options(${CORE_WIDGETS_ADDON} PRIVATE "/MP4")
|
target_compile_options(${CORE_WIDGETS_ADDON} PRIVATE "/MP")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (UNIX AND NOT APPLE)
|
||||||
|
# Set the RPATH in the binary to a relative one to allow it to find our Qt
|
||||||
|
# libraries regardless of where the base installation directory is.
|
||||||
|
file(RELATIVE_PATH QT_LIBRARY_REL_PATH "${CMAKE_BINARY_DIR}/Release" "${QT_CMAKE_HOME_DIR}/../..")
|
||||||
|
set_target_properties(${CORE_WIDGETS_ADDON} PROPERTIES INSTALL_RPATH "\$ORIGIN/${QT_LIBRARY_REL_PATH}")
|
||||||
|
set_target_properties(${CORE_WIDGETS_ADDON} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
set(CMAKE_MACOSX_RPATH ON)
|
||||||
|
file(RELATIVE_PATH QT_LIBRARY_REL_PATH "${CMAKE_BINARY_DIR}/Release" "${QT_CMAKE_HOME_DIR}/../..")
|
||||||
|
set_target_properties(${CORE_WIDGETS_ADDON} PROPERTIES INSTALL_RPATH "@loader_path/${QT_LIBRARY_REL_PATH}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(${CORE_WIDGETS_ADDON} PRIVATE
|
target_link_libraries(${CORE_WIDGETS_ADDON} PRIVATE
|
||||||
"${CMAKE_JS_LIB}"
|
"${CMAKE_JS_LIB}"
|
||||||
Qt5::Widgets
|
Qt6::Widgets
|
||||||
Qt5::Core
|
Qt6::Core
|
||||||
Qt5::Gui
|
Qt6::Gui
|
||||||
Qt5::Svg
|
Qt6::Svg
|
||||||
|
Qt6::SvgWidgets
|
||||||
)
|
)
|
||||||
|
|||||||
176
README.md
176
README.md
@ -1,14 +1,13 @@
|
|||||||
# NodeGui
|
# NodeGui
|
||||||
|
|
||||||
[](https://spectrum.chat/nodegui)
|
[](#contributors)
|
||||||
[](#contributors)
|
|
||||||
[](https://changelog.com/jsparty/96)
|
[](https://changelog.com/jsparty/96)
|
||||||
|
|
||||||
[](https://github.com/nodegui/nodegui/actions)
|
[](https://github.com/nodegui/nodegui/actions)
|
||||||
|
[](https://github.com/nodegui/nodegui/discussions)
|
||||||
|
|
||||||
Build **performant**, **native** and **cross-platform** desktop applications with **Node.js** and **CSS like styling**.🚀
|
Build **performant**, **native** and **cross-platform** desktop applications with **Node.js** and **CSS like styling**.🚀
|
||||||
|
|
||||||
NodeGUI is powered by **Qt5** 💚 which makes it CPU and memory efficient as compared to other chromium based solutions like electron.
|
NodeGUI is powered by **Qt6** 💚 which makes it CPU and memory efficient as compared to other chromium based solutions like Electron.
|
||||||
|
|
||||||
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/React-icon.svg/1024px-React-icon.svg.png" alt="" width="25"> If you are looking for **React** based version, check out: **[React NodeGUI](https://github.com/nodegui/react-nodegui)**.
|
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/React-icon.svg/1024px-React-icon.svg.png" alt="" width="25"> If you are looking for **React** based version, check out: **[React NodeGUI](https://github.com/nodegui/react-nodegui)**.
|
||||||
|
|
||||||
@ -16,7 +15,7 @@ NodeGUI is powered by **Qt5** 💚 which makes it CPU and memory efficient as co
|
|||||||
|
|
||||||
<img src="https://github.com/sveltejs/branding/raw/master/svelte-logo.png" alt="" width="25" /> If you are looking for **Svelte** based version, check out: **[Svelte NodeGUI](https://github.com/nodegui/svelte-nodegui)**
|
<img src="https://github.com/sveltejs/branding/raw/master/svelte-logo.png" alt="" width="25" /> If you are looking for **Svelte** based version, check out: **[Svelte NodeGUI](https://github.com/nodegui/svelte-nodegui)**
|
||||||
|
|
||||||
Visit: https://nodegui.github.io/nodegui for docs.
|
Visit https://nodegui.github.io/nodegui for docs.
|
||||||
|
|
||||||
<img alt="logo" src="https://github.com/nodegui/nodegui/raw/master/extras/logo/nodegui.png" height="200" />
|
<img alt="logo" src="https://github.com/nodegui/nodegui/raw/master/extras/logo/nodegui.png" height="200" />
|
||||||
|
|
||||||
@ -31,9 +30,7 @@ Visit: https://nodegui.github.io/nodegui for docs.
|
|||||||
<div style="display:inline; margin: 0 auto;"><img alt="kitchen" src="https://github.com/nodegui/nodegui/raw/master/extras/assets/kitchen.png" height="280" /><img alt="demo_mac" src="https://github.com/nodegui/examples/raw/master/react-nodegui/weather-app-widget/weather_widget_mac.png" height="280" /><img alt="demo_win" src="https://github.com/nodegui/examples/raw/master/react-nodegui/image-view/image_view_win.jpg" height="280" />
|
<div style="display:inline; margin: 0 auto;"><img alt="kitchen" src="https://github.com/nodegui/nodegui/raw/master/extras/assets/kitchen.png" height="280" /><img alt="demo_mac" src="https://github.com/nodegui/examples/raw/master/react-nodegui/weather-app-widget/weather_widget_mac.png" height="280" /><img alt="demo_win" src="https://github.com/nodegui/examples/raw/master/react-nodegui/image-view/image_view_win.jpg" height="280" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
**More screenshots?**
|
### Code Examples
|
||||||
|
|
||||||
### More Examples:
|
|
||||||
|
|
||||||
https://github.com/nodegui/examples
|
https://github.com/nodegui/examples
|
||||||
|
|
||||||
@ -41,17 +38,17 @@ https://github.com/nodegui/examples
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- 🧬 Cross platform. Should work on major Linux flavours, Windows and MacOS.
|
- 🧬 **Cross platform.** Works on major Linux flavours, Windows, and MacOS.
|
||||||
- 📉 Low CPU and memory footprint. Current CPU stays at 0% on idle and memory usage is under 20mb for a hello world program.
|
- 📉 **Low CPU and memory** footprint. Current CPU stays at 0% on idle and memory usage is under 20MB for a Hello World program.
|
||||||
- 💅 Styling with CSS (includes actual cascading). Also has full support for Flexbox layout (thanks to Yoga).
|
- 💅 **Styling with CSS** (includes actual cascading). Also has full support for Flexbox layout (thanks to Yoga).
|
||||||
- ✅ Complete Nodejs api support (Currently runs on Node v12.x - and is easily upgradable). Hence has access to all nodejs compatible npm modules.
|
- ✅ **Complete Nodejs API support** (Currently runs on Node v16.x - and is easily upgradable). Hence has access to all Nodejs compatible NPM modules.
|
||||||
- 🎪 Native widget event listener support. Supports all events available from Qt / NodeJs.
|
- 🎪 **Native widget event listener support.** Supports all events available from Qt / NodeJs.
|
||||||
- 💸 Can be used for Commercial applications.
|
- 💸 **Can be used for Commercial applications.**
|
||||||
- 🕵️♂️ Good Devtools support.
|
- 🕵️♂️ **Good Devtools support.**
|
||||||
- 📚 Good documentation and website.
|
- 📚 **Good documentation and website.**
|
||||||
- 🧙♂️ Good documentation for contributors.
|
- 🧙♂️ **Good documentation for contributors.**
|
||||||
- 🦹🏻♀️ Good support for dark mode (Thanks to Qt).
|
- 🦹🏻♀️ **Good support for dark mode (Thanks to Qt).**
|
||||||
- 🏅First class Typescript support. (Works on regular JS projects too 😉).
|
- 🏅**First class Typescript support.** (Works on regular JS projects too 😉).
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
@ -60,48 +57,16 @@ https://github.com/nodegui/examples
|
|||||||
- Checkout the examples: https://github.com/nodegui/examples .
|
- Checkout the examples: https://github.com/nodegui/examples .
|
||||||
- [Tutorial: Build a native Meme Search Desktop app with Javascript (NodeGui) and Giphy API](https://www.sitepoint.com/build-native-desktop-gif-searcher-app-using-nodegui/)
|
- [Tutorial: Build a native Meme Search Desktop app with Javascript (NodeGui) and Giphy API](https://www.sitepoint.com/build-native-desktop-gif-searcher-app-using-nodegui/)
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
NodeGui requires CMake and Compilation Tools as it is a wrapper for a native C++ widget toolkit QT.
|
To install latest stable release:
|
||||||
Detailed instructions here: https://www.sitepoint.com/build-native-desktop-gif-searcher-app-using-nodegui/
|
|
||||||
|
|
||||||
TL;DR:
|
|
||||||
MacOS
|
|
||||||
|
|
||||||
```
|
|
||||||
brew install cmake
|
|
||||||
brew install make
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
Windows
|
|
||||||
https://cmake.org/download/
|
|
||||||
|
|
||||||
Linux (Debian/Ubuntu)
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo apt-get install pkg-config build-essential
|
|
||||||
sudo apt-get install cmake make
|
|
||||||
sudo apt-get install mesa-common-dev libglu1-mesa-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Linux (Fedora/RHEL/CentOS)
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo dnf groupinstall "Development Tools" "Development Libraries"
|
|
||||||
sudo dnf groupinstall "C Development Tools and Libraries"
|
|
||||||
sudo dnf install mesa-libGL mesa-libGL-devel
|
|
||||||
```
|
|
||||||
|
|
||||||
Then install NodeGui from your command line:
|
|
||||||
|
|
||||||
#### To install latest stable release:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
npm install @nodegui/nodegui
|
npm install @nodegui/nodegui
|
||||||
```
|
```
|
||||||
|
|
||||||
#### To install the latest version available on master branch:
|
To install the latest version available on master branch:
|
||||||
|
|
||||||
```
|
```
|
||||||
npm install https://github.com/nodegui/nodegui/releases/download/v0.0.0-latest-master/nodegui-master.tgz
|
npm install https://github.com/nodegui/nodegui/releases/download/v0.0.0-latest-master/nodegui-master.tgz
|
||||||
@ -124,7 +89,82 @@ npm install @nodegui/nodegui
|
|||||||
See [FAQs](https://github.com/nodegui/nodegui/tree/master/website/docs/faq.md#why-does-installation-fail-at-minimal-qt-setup) for more details.
|
See [FAQs](https://github.com/nodegui/nodegui/tree/master/website/docs/faq.md#why-does-installation-fail-at-minimal-qt-setup) for more details.
|
||||||
|
|
||||||
|
|
||||||
#### Using your own custom Qt installation (Optional)
|
|
||||||
|
## Community guides
|
||||||
|
|
||||||
|
- [Tutorial: Build a native Meme Search Desktop app with Javascript (NodeGui) and Giphy API](https://www.sitepoint.com/build-native-desktop-gif-searcher-app-using-nodegui/)
|
||||||
|
- https://blog.logrocket.com/electron-alternatives-exploring-nodegui-and-react-nodegui/ - Electron alternatives: Exploring NodeGUI and React NodeGUI by [Siegfried Grimbeek](https://blog.logrocket.com/author/siegfriedgrimbeek/).
|
||||||
|
- https://hibbard.eu/node-gui/ - Excellent guide from [James Hibbard](https://github.com/jameshibbard).
|
||||||
|
|
||||||
|
## Talks/Podcasts
|
||||||
|
|
||||||
|
- [NodeGui and React NodeGui at KarmaJS Nov 2019 meetup: https://www.youtube.com/watch?v=8jH5gaEEDv4](https://www.youtube.com/watch?v=8jH5gaEEDv4)
|
||||||
|
|
||||||
|
- <audio data-theme="night" data-src="https://changelog.com/jsparty/96/embed" src="https://cdn.changelog.com/uploads/jsparty/96/js-party-96.mp3" preload="none" class="changelog-episode" controls></audio><p><a href="https://changelog.com/jsparty/96">JS Party 96: Performant Node desktop apps with NodeGUI</a> – Listen on <a href="https://changelog.com/">Changelog.com</a></p>
|
||||||
|
|
||||||
|
## Docs for contributing
|
||||||
|
|
||||||
|
```
|
||||||
|
It is easier than you think, try it
|
||||||
|
```
|
||||||
|
|
||||||
|
Looking to contribute? If you wish to implement a new widget/add more features and need help understanding the codebase, you can start here: [Contributing developer docs](https://github.com/nodegui/nodegui/tree/master/website/docs/development).
|
||||||
|
|
||||||
|
Please read https://github.com/nodegui/.github/blob/master/CONTRIBUTING.md
|
||||||
|
|
||||||
|
|
||||||
|
## Building from source
|
||||||
|
|
||||||
|
This section is useful for those wanting to work on NodeGui itself.
|
||||||
|
|
||||||
|
### Required tooling
|
||||||
|
|
||||||
|
NodeGui requires CMake and Compilation Tools as it is a wrapper for a native C++ widget toolkit QT.
|
||||||
|
Detailed instructions here: https://www.sitepoint.com/build-native-desktop-gif-searcher-app-using-nodegui/
|
||||||
|
|
||||||
|
TL;DR:
|
||||||
|
|
||||||
|
**MacOS**
|
||||||
|
|
||||||
|
```
|
||||||
|
brew install cmake
|
||||||
|
brew install make
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
**Windows**
|
||||||
|
|
||||||
|
https://cmake.org/download/
|
||||||
|
|
||||||
|
**Linux (Debian/Ubuntu)**
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo apt-get install pkg-config build-essential
|
||||||
|
sudo apt-get install cmake make
|
||||||
|
sudo apt-get install mesa-common-dev libglu1-mesa-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
**Linux (Fedora/RHEL/CentOS)**
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo dnf groupinstall "Development Tools" "Development Libraries"
|
||||||
|
sudo dnf groupinstall "C Development Tools and Libraries"
|
||||||
|
sudo dnf install mesa-libGL mesa-libGL-devel
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building
|
||||||
|
|
||||||
|
Once you have cloned this git repository, run this to build:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
The last step will takes some time to run as it builds the C++ binaries at the core of NodeGui.
|
||||||
|
|
||||||
|
|
||||||
|
### Using your own custom Qt installation (Optional)
|
||||||
|
|
||||||
**Compiling Qt from source**
|
**Compiling Qt from source**
|
||||||
|
|
||||||
@ -162,34 +202,15 @@ Now just `rm -rf node_modules` and do `npm install` again.
|
|||||||
|
|
||||||
The logs should say something like `CustomQt detected at <your qt path>. Hence, skipping Mini Qt installation`.
|
The logs should say something like `CustomQt detected at <your qt path>. Hence, skipping Mini Qt installation`.
|
||||||
|
|
||||||
**Community guides**
|
|
||||||
|
|
||||||
- [Tutorial: Build a native Meme Search Desktop app with Javascript (NodeGui) and Giphy API](https://www.sitepoint.com/build-native-desktop-gif-searcher-app-using-nodegui/)
|
### Running example programs
|
||||||
- https://blog.logrocket.com/electron-alternatives-exploring-nodegui-and-react-nodegui/ - Electron alternatives: Exploring NodeGUI and React NodeGUI by [Siegfried Grimbeek](https://blog.logrocket.com/author/siegfriedgrimbeek/).
|
|
||||||
- https://hibbard.eu/node-gui/ - Excellent guide from [James Hibbard](https://github.com/jameshibbard).
|
|
||||||
|
|
||||||
**Talks/Podcasts**
|
A number of small programs to show different parts of the Qt API are in `src/examples`. They can be run directly with:
|
||||||
|
|
||||||
- [NodeGui and React NodeGui at KarmaJS Nov 2019 meetup: https://www.youtube.com/watch?v=8jH5gaEEDv4](https://www.youtube.com/watch?v=8jH5gaEEDv4)
|
|
||||||
|
|
||||||
- <audio data-theme="night" data-src="https://changelog.com/jsparty/96/embed" src="https://cdn.changelog.com/uploads/jsparty/96/js-party-96.mp3" preload="none" class="changelog-episode" controls></audio><p><a href="https://changelog.com/jsparty/96">JS Party 96: Performant Node desktop apps with NodeGUI</a> – Listen on <a href="https://changelog.com/">Changelog.com</a></p>
|
|
||||||
|
|
||||||
## Docs for contributing
|
|
||||||
|
|
||||||
```
|
```
|
||||||
It is easier than you think, try it
|
npm run qode dist/examples/modelview_1_readonly.js
|
||||||
```
|
```
|
||||||
|
|
||||||
Looking to contribute? If you wish to implement a new widget/add more features and need help understanding the codebase, you can start here: [Contributing developer docs](https://github.com/nodegui/nodegui/tree/master/website/docs/development).
|
|
||||||
|
|
||||||
Please read https://github.com/nodegui/.github/blob/master/CONTRIBUTING.md
|
|
||||||
|
|
||||||
## Building
|
|
||||||
|
|
||||||
`npm run build`
|
|
||||||
|
|
||||||
Optionally set `QT_INSTALL_DIR='/path/to/qt'` environment variable to build using your own version of Qt.
|
|
||||||
|
|
||||||
## Updating docs
|
## Updating docs
|
||||||
|
|
||||||
`npm run docs`
|
`npm run docs`
|
||||||
@ -242,6 +263,7 @@ People maintaining this project.
|
|||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center"><a href="https://blog.atulr.com"><img src="https://avatars2.githubusercontent.com/u/4029423?v=4" width="100px;" alt="Atul R"/><br /><sub><b>Atul R</b></sub></a></td>
|
<td align="center"><a href="https://blog.atulr.com"><img src="https://avatars2.githubusercontent.com/u/4029423?v=4" width="100px;" alt="Atul R"/><br /><sub><b>Atul R</b></sub></a></td>
|
||||||
|
<td align="center"><a href="https://github.com/sedwards2009"><img src="https://avatars.githubusercontent.com/u/6926644?v=4" width="100px;" alt="Simon Edwards"/><br /><sub><b>Simon Edwards</b></sub></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|||||||
@ -9,11 +9,13 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum OS X deployment ve
|
|||||||
|
|
||||||
function(AddCommonConfig addonName)
|
function(AddCommonConfig addonName)
|
||||||
target_compile_features(${addonName} PRIVATE
|
target_compile_features(${addonName} PRIVATE
|
||||||
|
cxx_constexpr
|
||||||
cxx_inheriting_constructors
|
cxx_inheriting_constructors
|
||||||
cxx_lambdas
|
cxx_lambdas
|
||||||
cxx_auto_type
|
cxx_auto_type
|
||||||
cxx_variadic_templates
|
cxx_variadic_templates
|
||||||
cxx_variable_templates
|
cxx_variable_templates
|
||||||
|
cxx_std_17
|
||||||
)
|
)
|
||||||
|
|
||||||
if(napi_build_version)
|
if(napi_build_version)
|
||||||
|
|||||||
@ -16,7 +16,7 @@ macro(AddQodeSupport addonName)
|
|||||||
message(STATUS "Using Qode installation for ${addonName} QODE_BINARY_DIR:${QODE_BINARY_DIR}")
|
message(STATUS "Using Qode installation for ${addonName} QODE_BINARY_DIR:${QODE_BINARY_DIR}")
|
||||||
|
|
||||||
target_link_libraries(${CORE_WIDGETS_ADDON} PRIVATE
|
target_link_libraries(${CORE_WIDGETS_ADDON} PRIVATE
|
||||||
"${QODE_BINARY_DIR}\\qode.lib"
|
"${QODE_BINARY_DIR}\\node.lib"
|
||||||
)
|
)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -17,9 +17,9 @@ macro(AddQtSupport addonName)
|
|||||||
string(REPLACE "\n" "" QT_CMAKE_HOME_DIR "${QT_CMAKE_HOME_DIR}")
|
string(REPLACE "\n" "" QT_CMAKE_HOME_DIR "${QT_CMAKE_HOME_DIR}")
|
||||||
string(REPLACE "\"" "" QT_CMAKE_HOME_DIR "${QT_CMAKE_HOME_DIR}")
|
string(REPLACE "\"" "" QT_CMAKE_HOME_DIR "${QT_CMAKE_HOME_DIR}")
|
||||||
|
|
||||||
message(STATUS "Using QT installation for ${addonName} QT_CMAKE_HOME_DIR:${QT_CMAKE_HOME_DIR}")
|
message(STATUS "Using Qt installation for ${addonName} QT_CMAKE_HOME_DIR:${QT_CMAKE_HOME_DIR}")
|
||||||
|
|
||||||
set(Qt5_DIR ${QT_CMAKE_HOME_DIR})
|
list(APPEND CMAKE_PREFIX_PATH "${QT_CMAKE_HOME_DIR}/../../..")
|
||||||
find_package(Qt5 COMPONENTS Widgets Gui Core Svg REQUIRED)
|
find_package(Qt6 REQUIRED COMPONENTS Widgets Gui Core Svg SvgWidgets)
|
||||||
|
|
||||||
endmacro(AddQtSupport addonName)
|
endmacro(AddQtSupport addonName)
|
||||||
|
|||||||
@ -3,7 +3,7 @@ const path = require('path');
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
const SETUP_DIR = path.resolve(__dirname, '..', 'miniqt');
|
const SETUP_DIR = path.resolve(__dirname, '..', 'miniqt');
|
||||||
const QT_VERSION = '5.14.1';
|
const QT_VERSION = '6.4.1';
|
||||||
const MIRROR = Boolean(process.env.QT_LINK_MIRROR) ? process.env.QT_LINK_MIRROR : 'https://download.qt.io';
|
const MIRROR = Boolean(process.env.QT_LINK_MIRROR) ? process.env.QT_LINK_MIRROR : 'https://download.qt.io';
|
||||||
|
|
||||||
const checkIfExists = (fullPath) => {
|
const checkIfExists = (fullPath) => {
|
||||||
@ -13,60 +13,46 @@ const checkIfExists = (fullPath) => {
|
|||||||
function getMiniQtConfig() {
|
function getMiniQtConfig() {
|
||||||
switch (os.platform()) {
|
switch (os.platform()) {
|
||||||
case 'darwin': {
|
case 'darwin': {
|
||||||
if (os.arch() === 'arm64') {
|
const qtHome = path.resolve(SETUP_DIR, QT_VERSION, 'macos');
|
||||||
const qtHome = path.resolve(SETUP_DIR, 'Qt-5.15.3');
|
|
||||||
return {
|
|
||||||
qtHome,
|
|
||||||
artifacts: [
|
|
||||||
{
|
|
||||||
name: 'Mini Qt Bundle',
|
|
||||||
link: `https://github.com/nodegui/nodegui/releases/download/miniQtm1-5153/Qt-5.15.3.zip`,
|
|
||||||
skipSetup: checkIfExists(path.resolve(qtHome, 'plugins', 'platforms', 'libqcocoa.dylib')),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
const qtHome = path.resolve(SETUP_DIR, QT_VERSION, 'clang_64');
|
|
||||||
return {
|
|
||||||
qtHome,
|
|
||||||
artifacts: [
|
|
||||||
{
|
|
||||||
name: 'Qt Base',
|
|
||||||
link: `${MIRROR}/online/qtsdkrepository/mac_x64/desktop/qt5_5141/qt.qt5.5141.clang_64/5.14.1-0-202001241000qtbase-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64.7z`,
|
|
||||||
skipSetup: checkIfExists(path.resolve(qtHome, 'plugins', 'platforms', 'libqcocoa.dylib')),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Qt Svg',
|
|
||||||
link: `${MIRROR}/online/qtsdkrepository/mac_x64/desktop/qt5_5141/qt.qt5.5141.clang_64/5.14.1-0-202001241000qtsvg-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64.7z`,
|
|
||||||
skipSetup: checkIfExists(path.resolve(qtHome, 'lib', 'QtSvg.framework', 'QtSvg')),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Qt Tools',
|
|
||||||
link: `${MIRROR}/online/qtsdkrepository/mac_x64/desktop/qt5_5141/qt.qt5.5141.clang_64/5.14.1-0-202001241000qttools-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64.7z`,
|
|
||||||
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'macdeployqt')),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 'win32': {
|
|
||||||
const qtHome = path.resolve(SETUP_DIR, QT_VERSION, 'msvc2017_64');
|
|
||||||
return {
|
return {
|
||||||
qtHome,
|
qtHome,
|
||||||
artifacts: [
|
artifacts: [
|
||||||
{
|
{
|
||||||
name: 'Qt Base',
|
name: 'Qt Base',
|
||||||
link: `${MIRROR}/online/qtsdkrepository/windows_x86/desktop/qt5_5141/qt.qt5.5141.win64_msvc2017_64/5.14.1-0-202001240957qtbase-Windows-Windows_10-MSVC2017-Windows-Windows_10-X86_64.7z`,
|
link: `${MIRROR}/online/qtsdkrepository/mac_x64/desktop/qt6_641/qt.qt6.641.clang_64/6.4.1-0-202211101256qtbase-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z`,
|
||||||
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'Qt5Core.dll')),
|
skipSetup: checkIfExists(path.resolve(qtHome, 'plugins', 'platforms', 'libqcocoa.dylib')),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Qt SVG',
|
name: 'Qt Svg',
|
||||||
link: `${MIRROR}/online/qtsdkrepository/windows_x86/desktop/qt5_5141/qt.qt5.5141.win64_msvc2017_64/5.14.1-0-202001240957qtsvg-Windows-Windows_10-MSVC2017-Windows-Windows_10-X86_64.7z`,
|
link: `${MIRROR}/online/qtsdkrepository/mac_x64/desktop/qt6_641/qt.qt6.641.clang_64/6.4.1-0-202211101256qtsvg-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z`,
|
||||||
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'Qt5Svg.dll')),
|
skipSetup: checkIfExists(path.resolve(qtHome, 'lib', 'QtSvg.framework', 'QtSvg')),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Qt Tools',
|
name: 'Qt Tools',
|
||||||
link: `${MIRROR}/online/qtsdkrepository/windows_x86/desktop/qt5_5141/qt.qt5.5141.win64_msvc2017_64/5.14.1-0-202001240957qttools-Windows-Windows_10-MSVC2017-Windows-Windows_10-X86_64.7z`,
|
link: `${MIRROR}/online/qtsdkrepository/mac_x64/desktop/qt6_641/qt.qt6.641.clang_64/6.4.1-0-202211101256qttools-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z`,
|
||||||
|
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'macdeployqt')),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
case 'win32': {
|
||||||
|
const qtHome = path.resolve(SETUP_DIR, QT_VERSION, 'msvc2019_64');
|
||||||
|
return {
|
||||||
|
qtHome,
|
||||||
|
artifacts: [
|
||||||
|
{
|
||||||
|
name: 'Qt Base',
|
||||||
|
link: `${MIRROR}/online/qtsdkrepository/windows_x86/desktop/qt6_641/qt.qt6.641.win64_msvc2019_64/6.4.1-0-202211101254qtbase-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64.7z`,
|
||||||
|
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'Qt6Core.dll')),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Qt SVG',
|
||||||
|
link: `${MIRROR}/online/qtsdkrepository/windows_x86/desktop/qt6_641/qt.qt6.641.win64_msvc2019_64/6.4.1-0-202211101254qtsvg-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64.7z`,
|
||||||
|
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'Qt6Svg.dll')),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Qt Tools',
|
||||||
|
link: `${MIRROR}/online/qtsdkrepository/windows_x86/desktop/qt6_641/qt.qt6.641.win64_msvc2019_64/6.4.1-0-202211101254qttools-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64.7z`,
|
||||||
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'windeployqt.exe')),
|
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'windeployqt.exe')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -79,17 +65,17 @@ function getMiniQtConfig() {
|
|||||||
artifacts: [
|
artifacts: [
|
||||||
{
|
{
|
||||||
name: 'Qt Base',
|
name: 'Qt Base',
|
||||||
link: `${MIRROR}/online/qtsdkrepository/linux_x64/desktop/qt5_5141/qt.qt5.5141.gcc_64/5.14.1-0-202001240953qtbase-Linux-RHEL_7_6-GCC-Linux-RHEL_7_6-X86_64.7z`,
|
link: `${MIRROR}/online/qtsdkrepository/linux_x64/desktop/qt6_641/qt.qt6.641.gcc_64/6.4.1-0-202211101305qtbase-Linux-RHEL_8_4-GCC-Linux-RHEL_8_4-X86_64.7z`,
|
||||||
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'moc')),
|
skipSetup: checkIfExists(path.resolve(qtHome, 'bin', 'moc')),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Qt SVG',
|
name: 'Qt SVG',
|
||||||
link: `${MIRROR}/online/qtsdkrepository/linux_x64/desktop/qt5_5141/qt.qt5.5141.gcc_64/5.14.1-0-202001240953qtsvg-Linux-RHEL_7_6-GCC-Linux-RHEL_7_6-X86_64.7z`,
|
link: `${MIRROR}/online/qtsdkrepository/linux_x64/desktop/qt6_641/qt.qt6.641.gcc_64/6.4.1-0-202211101305qtsvg-Linux-RHEL_8_4-GCC-Linux-RHEL_8_4-X86_64.7z`,
|
||||||
skipSetup: checkIfExists(path.resolve(qtHome, 'lib', 'libQt5Svg.so')),
|
skipSetup: checkIfExists(path.resolve(qtHome, 'lib', 'libQt6Svg.so')),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Qt ICU',
|
name: 'Qt ICU',
|
||||||
link: `${MIRROR}/online/qtsdkrepository/linux_x64/desktop/qt5_5141/qt.qt5.5141.gcc_64/5.14.1-0-202001240953icu-linux-Rhel7.2-x64.7z`,
|
link: `${MIRROR}/online/qtsdkrepository/linux_x64/desktop/qt6_641/qt.qt6.641.gcc_64/6.4.1-0-202211101305icu-linux-Rhel7.2-x64.7z`,
|
||||||
skipSetup: checkIfExists(path.resolve(qtHome, 'lib', 'libicuuc.so')),
|
skipSetup: checkIfExists(path.resolve(qtHome, 'lib', 'libicuuc.so')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -106,7 +92,7 @@ const miniQt = {
|
|||||||
|
|
||||||
const useCustomQt = Boolean(process.env.QT_INSTALL_DIR);
|
const useCustomQt = Boolean(process.env.QT_INSTALL_DIR);
|
||||||
const qtHome = useCustomQt ? process.env.QT_INSTALL_DIR : miniQt.qtHome;
|
const qtHome = useCustomQt ? process.env.QT_INSTALL_DIR : miniQt.qtHome;
|
||||||
const qtCmakeDir = path.resolve(qtHome, 'lib', 'cmake', 'Qt5');
|
const qtCmakeDir = path.resolve(qtHome, 'lib', 'cmake', 'Qt6');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
qtHome,
|
qtHome,
|
||||||
|
|||||||
14863
package-lock.json
generated
14863
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
66
package.json
66
package.json
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@nodegui/nodegui",
|
"name": "@nodegui/nodegui",
|
||||||
"version": "0.33.2",
|
"version": "0.59.0",
|
||||||
"description": "A cross platform library to build native desktop apps.",
|
"description": "A cross-platform library to build native desktop apps.",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
"author": "Atul R <atulanand94@gmail.com>",
|
"author": "Atul R <atulanand94@gmail.com>",
|
||||||
@ -14,17 +14,19 @@
|
|||||||
"url": "https://github.com/sponsors/a7ul"
|
"url": "https://github.com/sponsors/a7ul"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "cross-env npm run build && node ./scripts/qode.js dist/demo.js",
|
"dev": "npm run build && node ./scripts/qode.js dist/demo.js",
|
||||||
"build": "cross-env tsc && npm run build:addon",
|
"demo": "node ./scripts/qode.js dist/demo.js",
|
||||||
"postinstall": "cross-env npm run setupqt && (node ./scripts/skip.js || npm run build:addon)",
|
"build": "tsc && npm run build:addon",
|
||||||
"setupqt": "cross-env node ./scripts/setupMiniQt.js",
|
"install": "npm run setupqt && (node ./scripts/skip.js || npm run setupbinary || npm run build:addon)",
|
||||||
|
"setupqt": "node ./scripts/setupMiniQt.js",
|
||||||
|
"setupbinary": "node ./scripts/setupBinary.js",
|
||||||
"build:addon": "cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile",
|
"build:addon": "cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile",
|
||||||
"test": "node ./scripts/qode.js ./node_modules/jest/bin/jest -i",
|
"test": "node ./scripts/qode.js ./node_modules/jest/bin/jest -i",
|
||||||
"lint:cpp": "cross-env clang-format -i --glob=src/cpp/**/*.[h,c]*",
|
"lint:cpp": "clang-format -i --glob=src/cpp/**/*.[h,c]*",
|
||||||
"lint:ts": "cross-env tsc --noEmit && cross-env eslint './src/**/*.{ts,tsx,js,jsx}' --fix",
|
"lint:ts": "tsc --noEmit && eslint ./src --fix",
|
||||||
"docs": "cross-env typedoc && node ./website/docs/scripts/fixdocs.js",
|
"docs": "typedoc && node ./website/docs/scripts/fixdocs.js",
|
||||||
"qode": "cross-env node ./scripts/qode.js",
|
"qode": "node ./scripts/qode.js",
|
||||||
"prepublishOnly": "cross-env npm run build"
|
"prepublishOnly": "npm run build"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.x.x"
|
"node": ">=14.x.x"
|
||||||
@ -32,36 +34,38 @@
|
|||||||
"engineStrict": false,
|
"engineStrict": false,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodegui/artifact-installer": "^1.1.0",
|
"@nodegui/artifact-installer": "^1.1.0",
|
||||||
"@nodegui/qode": "^2.1.0",
|
"@nodegui/qode": "^18.12.1",
|
||||||
"cmake-js": "^6.1.0",
|
"cmake-js": "^6.2.1",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"cuid": "^2.1.6",
|
"cuid": "^2.1.8",
|
||||||
"manage-path": "^2.0.0",
|
"manage-path": "^2.0.0",
|
||||||
"memoize-one": "^5.1.1",
|
"memoize-one": "^5.2.1",
|
||||||
"node-addon-api": "^3.1.0",
|
"node-addon-api": "^4.0.0",
|
||||||
"postcss-nodegui-autoprefixer": "0.0.7"
|
"postcss": "^7.0.17",
|
||||||
|
"postcss-nodegui-autoprefixer": "0.0.7",
|
||||||
|
"tar": "^6.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bindings": "^1.5.0",
|
"@types/bindings": "^1.5.1",
|
||||||
"@types/jest": "^26.0.20",
|
"@types/jest": "29.2.4",
|
||||||
"@types/node": "^14.14.22",
|
"@types/node": "^16.4.13",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.13.0",
|
"@typescript-eslint/eslint-plugin": "^4.29.0",
|
||||||
"@typescript-eslint/parser": "^4.13.0",
|
"@typescript-eslint/parser": "^4.29.0",
|
||||||
"clang-format": "^1.5.0",
|
"clang-format": "^1.5.0",
|
||||||
"eslint": "^6.6.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-config-prettier": "^6.15.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
"eslint-plugin-prettier": "^3.4.0",
|
||||||
"husky": "^4.3.8",
|
"husky": "^7.0.1",
|
||||||
"jest": "^25.5.4",
|
"jest": "29.3.1",
|
||||||
"prettier": "^2.2.1",
|
"prettier": "^2.3.2",
|
||||||
"ts-jest": "^25.5.1",
|
"ts-jest": "29.0.3",
|
||||||
"typedoc": "^0.17.8",
|
"typedoc": "^0.17.8",
|
||||||
"typedoc-plugin-markdown": "^2.4.2",
|
"typedoc-plugin-markdown": "^2.4.2",
|
||||||
"typescript": "^4.1.3"
|
"typescript": "^4.3.5"
|
||||||
},
|
},
|
||||||
"binary": {
|
"binary": {
|
||||||
"napi_versions": [
|
"napi_versions": [
|
||||||
3
|
4
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
var os = require('os');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var qodeConfig = require('@nodegui/qode');
|
var qodeConfig = require('@nodegui/qode');
|
||||||
var managePath = require('manage-path');
|
var managePath = require('manage-path');
|
||||||
@ -11,6 +12,12 @@ var proc = require('child_process');
|
|||||||
var alterPath = managePath(process.env);
|
var alterPath = managePath(process.env);
|
||||||
alterPath.unshift(path.join(qtConfig.qtHome, 'bin'));
|
alterPath.unshift(path.join(qtConfig.qtHome, 'bin'));
|
||||||
|
|
||||||
|
// Add Qt's lib to LD_LIBRARY_PATH so linux can find the libs when bundled with webpack
|
||||||
|
if(os.platform == 'linux') {
|
||||||
|
var oldLD_PATH = process.env.LD_LIBRARY_PATH ?? "";
|
||||||
|
process.env.LD_LIBRARY_PATH = oldLD_PATH + ":" + path.join(qtConfig.qtHome, 'lib');
|
||||||
|
}
|
||||||
|
|
||||||
var child = proc.spawn(qodeConfig.qodePath, process.argv.slice(2), {
|
var child = proc.spawn(qodeConfig.qodePath, process.argv.slice(2), {
|
||||||
stdio: 'inherit',
|
stdio: 'inherit',
|
||||||
windowsHide: false,
|
windowsHide: false,
|
||||||
|
|||||||
39
scripts/setupBinary.js
Normal file
39
scripts/setupBinary.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const os = require('os');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
const { setupArtifact } = require('@nodegui/artifact-installer');
|
||||||
|
const tar = require('tar');
|
||||||
|
const SETUP_DIR = path.resolve(__dirname, '..', 'build', 'Release');
|
||||||
|
const packageJson = require('../package');
|
||||||
|
|
||||||
|
async function setupBinary() {
|
||||||
|
const packageVersion = packageJson.version;
|
||||||
|
const tarballName = `nodegui-binary-v${packageVersion}-${os.platform()}-${os.arch()}.tar.gz`;
|
||||||
|
const url = `https://github.com/nodegui/nodegui/releases/download/v${packageVersion}/${tarballName}`;
|
||||||
|
|
||||||
|
await setupArtifact({
|
||||||
|
outDir: SETUP_DIR,
|
||||||
|
id: 'nodegui-core',
|
||||||
|
displayName: `Precompiled NodeGui binary`,
|
||||||
|
downloadLink: url,
|
||||||
|
skipSetup: () => false,
|
||||||
|
});
|
||||||
|
const tarPath = path.join(SETUP_DIR, tarballName.slice(0, -3));
|
||||||
|
tar.extract({
|
||||||
|
cwd: SETUP_DIR,
|
||||||
|
file: tarPath,
|
||||||
|
sync: true,
|
||||||
|
});
|
||||||
|
fs.unlinkSync(tarPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
setupBinary()
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
process.exit(1);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
@ -13,14 +13,14 @@ namespace extrautils {
|
|||||||
DLL_EXPORT QVariant* convertToQVariant(Napi::Env& env, Napi::Value& value);
|
DLL_EXPORT QVariant* convertToQVariant(Napi::Env& env, Napi::Value& value);
|
||||||
DLL_EXPORT bool isNapiValueInt(Napi::Env& env, Napi::Value& num);
|
DLL_EXPORT bool isNapiValueInt(Napi::Env& env, Napi::Value& num);
|
||||||
DLL_EXPORT std::string getNapiObjectClassName(Napi::Object& object);
|
DLL_EXPORT std::string getNapiObjectClassName(Napi::Object& object);
|
||||||
DLL_EXPORT void* configureQWidget(QWidget* widget, YGNodeRef node,
|
DLL_EXPORT void* configureQWidget(QWidget* widget, bool isLeafNode = false);
|
||||||
bool isLeafNode = false);
|
|
||||||
DLL_EXPORT void* configureQObject(QObject* object);
|
DLL_EXPORT void* configureQObject(QObject* object);
|
||||||
DLL_EXPORT void* configureComponent(void* component);
|
DLL_EXPORT void* configureComponent(void* component);
|
||||||
|
DLL_EXPORT uint64_t hashPointerTo53bit(const void* input);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void safeDelete(QPointer<T>& component) {
|
void safeDelete(QPointer<T>& component) {
|
||||||
if (!component.isNull()) {
|
if (!component.isNull() && component->QObject::parent() == nullptr) {
|
||||||
delete component;
|
delete component;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,217 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <QAbstractItemModel>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtCore/QModelIndex/qmodelindex_wrap.h"
|
||||||
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
#include "core/NodeWidget/nodewidget.h"
|
||||||
|
#include "napi.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT NAbstractItemModel : public QAbstractItemModel,
|
||||||
|
public EventWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
EVENTWIDGET_IMPLEMENTATIONS(QAbstractItemModel)
|
||||||
|
public:
|
||||||
|
Napi::FunctionReference dispatchOnNode;
|
||||||
|
|
||||||
|
virtual void connectSignalsToEventEmitter(){
|
||||||
|
// Qt Connects: Implement all signal connects here
|
||||||
|
QOBJECT_SIGNALS}
|
||||||
|
|
||||||
|
QModelIndex index(int row, int column,
|
||||||
|
const QModelIndex& parent = QModelIndex()) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto parentModelIndexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(parent))});
|
||||||
|
Napi::Value modelIndexNapiWrap = this->dispatchOnNode.Call(
|
||||||
|
{Napi::String::New(env, "index"), Napi::Value::From(env, row),
|
||||||
|
Napi::Value::From(env, column), parentModelIndexWrap});
|
||||||
|
|
||||||
|
QModelIndexWrap* modelIndexWrap = Napi::ObjectWrap<QModelIndexWrap>::Unwrap(
|
||||||
|
modelIndexNapiWrap.As<Napi::Object>());
|
||||||
|
QModelIndex* newIndex = modelIndexWrap->getInternalInstance();
|
||||||
|
return *newIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
QObject* parent() const { return nullptr; }
|
||||||
|
|
||||||
|
QModelIndex parent(const QModelIndex& child) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto childModelIndexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(child))});
|
||||||
|
Napi::Value modelIndexNapiWrap = this->dispatchOnNode.Call(
|
||||||
|
{Napi::String::New(env, "parent"), childModelIndexWrap});
|
||||||
|
|
||||||
|
QModelIndexWrap* modelIndexWrap = Napi::ObjectWrap<QModelIndexWrap>::Unwrap(
|
||||||
|
modelIndexNapiWrap.As<Napi::Object>());
|
||||||
|
QModelIndex* parentIndex = modelIndexWrap->getInternalInstance();
|
||||||
|
return *parentIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
int rowCount(const QModelIndex& parent = QModelIndex()) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto modelIndexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(parent))});
|
||||||
|
Napi::Value result = this->dispatchOnNode.Call(
|
||||||
|
{Napi::String::New(env, "rowCount"), modelIndexWrap});
|
||||||
|
|
||||||
|
return result.As<Napi::Number>().Int32Value();
|
||||||
|
}
|
||||||
|
|
||||||
|
int columnCount(const QModelIndex& parent = QModelIndex()) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto modelIndexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(parent))});
|
||||||
|
Napi::Value result = this->dispatchOnNode.Call(
|
||||||
|
{Napi::String::New(env, "columnCount"), modelIndexWrap});
|
||||||
|
return result.As<Napi::Number>().Int32Value();
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant data(const QModelIndex& index,
|
||||||
|
int role = Qt::DisplayRole) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto modelIndexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(index))});
|
||||||
|
auto roleValue = Napi::Value::From(env, role);
|
||||||
|
Napi::Value variantJsObject = this->dispatchOnNode.Call(
|
||||||
|
{Napi::String::New(env, "data"), modelIndexWrap, roleValue});
|
||||||
|
|
||||||
|
QVariantWrap* variantWrap = Napi::ObjectWrap<QVariantWrap>::Unwrap(
|
||||||
|
variantJsObject.As<Napi::Object>());
|
||||||
|
QVariant* variant = variantWrap->getInternalInstance();
|
||||||
|
return *variant;
|
||||||
|
}
|
||||||
|
|
||||||
|
Qt::ItemFlags flags(const QModelIndex& index) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto modelIndexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(index))});
|
||||||
|
Napi::Value numberJs = this->dispatchOnNode.Call(
|
||||||
|
{Napi::String::New(env, "flags"), modelIndexWrap});
|
||||||
|
|
||||||
|
auto result =
|
||||||
|
static_cast<Qt::ItemFlags>(numberJs.As<Napi::Number>().Uint32Value());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant headerData(int section, Qt::Orientation orientation,
|
||||||
|
int role = Qt::DisplayRole) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto sectionValue = Napi::Value::From(env, static_cast<int>(section));
|
||||||
|
auto orientationValue =
|
||||||
|
Napi::Value::From(env, static_cast<int>(orientation));
|
||||||
|
auto roleValue = Napi::Value::From(env, static_cast<int>(role));
|
||||||
|
|
||||||
|
Napi::Value variantJsObject =
|
||||||
|
this->dispatchOnNode.Call({Napi::String::New(env, "headerData"),
|
||||||
|
sectionValue, orientationValue, roleValue});
|
||||||
|
|
||||||
|
QVariantWrap* variantWrap = Napi::ObjectWrap<QVariantWrap>::Unwrap(
|
||||||
|
variantJsObject.As<Napi::Object>());
|
||||||
|
QVariant* variant = variantWrap->getInternalInstance();
|
||||||
|
return *variant;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool setData(const QModelIndex& index, const QVariant& value,
|
||||||
|
int role = Qt::EditRole) override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto modelIndexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(index))});
|
||||||
|
auto valueWrap = QVariantWrap::constructor.New(
|
||||||
|
{Napi::External<QVariant>::New(env, new QVariant(value))});
|
||||||
|
auto roleValue = Napi::Value::From(env, role);
|
||||||
|
|
||||||
|
Napi::Value booleanJs =
|
||||||
|
this->dispatchOnNode.Call({Napi::String::New(env, "setData"),
|
||||||
|
modelIndexWrap, valueWrap, roleValue});
|
||||||
|
|
||||||
|
return booleanJs.As<Napi::Boolean>().Value();
|
||||||
|
}
|
||||||
|
|
||||||
|
QModelIndex _protected_createIndex(int row, int column) const {
|
||||||
|
return createIndex(row, column);
|
||||||
|
}
|
||||||
|
|
||||||
|
QModelIndex buddy(const QModelIndex& index) const override {
|
||||||
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
|
||||||
|
auto indexWrap = QModelIndexWrap::constructor.New(
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(index))});
|
||||||
|
Napi::Value buddyIndexNapiWrap =
|
||||||
|
this->dispatchOnNode.Call({Napi::String::New(env, "buddy"), indexWrap});
|
||||||
|
|
||||||
|
QModelIndexWrap* buddyIndexWrap = Napi::ObjectWrap<QModelIndexWrap>::Unwrap(
|
||||||
|
buddyIndexNapiWrap.As<Napi::Object>());
|
||||||
|
QModelIndex* buddyIndex = buddyIndexWrap->getInternalInstance();
|
||||||
|
return *buddyIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
void _protected_beginResetModel() { beginResetModel(); }
|
||||||
|
|
||||||
|
void _protected_endResetModel() { endResetModel(); }
|
||||||
|
|
||||||
|
void _protected_beginInsertColumns(const QModelIndex& parent, int first,
|
||||||
|
int last) {
|
||||||
|
beginInsertColumns(parent, first, last);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _protected_beginInsertRows(const QModelIndex& parent, int first,
|
||||||
|
int last) {
|
||||||
|
beginInsertRows(parent, first, last);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _protected_beginMoveColumns(const QModelIndex& sourceParent,
|
||||||
|
int sourceFirst, int sourceLast,
|
||||||
|
const QModelIndex& destinationParent,
|
||||||
|
int destinationChild) {
|
||||||
|
return beginMoveColumns(sourceParent, sourceFirst, sourceLast,
|
||||||
|
destinationParent, destinationChild);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _protected_beginMoveRows(const QModelIndex& sourceParent,
|
||||||
|
int sourceFirst, int sourceLast,
|
||||||
|
const QModelIndex& destinationParent,
|
||||||
|
int destinationChild) {
|
||||||
|
return beginMoveRows(sourceParent, sourceFirst, sourceLast,
|
||||||
|
destinationParent, destinationChild);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _protected_beginRemoveColumns(const QModelIndex& parent, int first,
|
||||||
|
int last) {
|
||||||
|
beginRemoveColumns(parent, first, last);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _protected_beginRemoveRows(const QModelIndex& parent, int first,
|
||||||
|
int last) {
|
||||||
|
beginRemoveRows(parent, first, last);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _protected_endInsertColumns() { endInsertColumns(); }
|
||||||
|
|
||||||
|
void _protected_endInsertRows() { endInsertRows(); }
|
||||||
|
|
||||||
|
void _protected_endMoveColumns() { endMoveColumns(); }
|
||||||
|
|
||||||
|
void _protected_endMoveRows() { endMoveRows(); }
|
||||||
|
|
||||||
|
void _protected_endRemoveColumns() { endRemoveColumns(); }
|
||||||
|
|
||||||
|
void _protected_endRemoveRows() { endRemoveRows(); }
|
||||||
|
};
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
#include "nabstractitemmodel.hpp"
|
||||||
|
|
||||||
|
class DLL_EXPORT QAbstractItemModelWrap
|
||||||
|
: public Napi::ObjectWrap<QAbstractItemModelWrap> {
|
||||||
|
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPointer<NAbstractItemModel> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QAbstractItemModelWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QAbstractItemModelWrap();
|
||||||
|
NAbstractItemModel* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value initNodeDispatcher(const Napi::CallbackInfo& info);
|
||||||
|
|
||||||
|
Napi::Value hasIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value createIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value _super_flags(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value emitDataChanged(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value checkIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value _super_buddy(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value beginInsertColumns(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value beginInsertRows(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value beginMoveColumns(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value beginMoveRows(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value beginRemoveColumns(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value beginRemoveRows(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value beginResetModel(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value endResetModel(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value endInsertColumns(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value endInsertRows(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value endMoveColumns(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value endMoveRows(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value endRemoveColumns(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value endRemoveRows(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <QItemSelectionModel>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
#include "core/NodeWidget/nodewidget.h"
|
||||||
|
#include "napi.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT NItemSelectionModel : public QItemSelectionModel,
|
||||||
|
public EventWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
EVENTWIDGET_IMPLEMENTATIONS(QItemSelectionModel)
|
||||||
|
public:
|
||||||
|
Napi::FunctionReference dispatchOnNode;
|
||||||
|
|
||||||
|
virtual void connectSignalsToEventEmitter() {
|
||||||
|
// Qt Connects: Implement all signal connects here
|
||||||
|
QOBJECT_SIGNALS
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
#include "nitemselectionmodel.hpp"
|
||||||
|
|
||||||
|
class DLL_EXPORT QItemSelectionModelWrap
|
||||||
|
: public Napi::ObjectWrap<QItemSelectionModelWrap> {
|
||||||
|
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPointer<QItemSelectionModel> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QItemSelectionModelWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QItemSelectionModelWrap();
|
||||||
|
QItemSelectionModel* getInternalInstance();
|
||||||
|
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value columnIntersectsSelection(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value currentIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value hasSelection(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isColumnSelected(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isRowSelected(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isSelected(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value rowIntersectsSelection(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value clear(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value clearCurrentIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value clearSelection(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value reset(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value select(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setCurrentIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value selectedColumns(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value selectedIndexes(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value selectedRows(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -5,13 +5,13 @@
|
|||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
|
|
||||||
#include "Extras/Export/export.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QMimeDataWrap : public Napi::ObjectWrap<QMimeDataWrap> {
|
class DLL_EXPORT QMimeDataWrap : public Napi::ObjectWrap<QMimeDataWrap> {
|
||||||
COMPONENT_WRAPPED_METHODS_DECLARATION
|
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<QMimeData> instance;
|
QPointer<QMimeData> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
|||||||
@ -12,5 +12,5 @@ class DLL_EXPORT NObject : public QObject, public EventWidget {
|
|||||||
public:
|
public:
|
||||||
using QObject::QObject;
|
using QObject::QObject;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() { QOBJECT_SIGNALS }
|
virtual void connectSignalsToEventEmitter() { QOBJECT_SIGNALS }
|
||||||
};
|
};
|
||||||
|
|||||||
@ -5,28 +5,33 @@
|
|||||||
#include "Extras/Utils/nutils.h"
|
#include "Extras/Utils/nutils.h"
|
||||||
#include "QtCore/QVariant/qvariant_wrap.h"
|
#include "QtCore/QVariant/qvariant_wrap.h"
|
||||||
#include "core/Events/eventwidget_macro.h"
|
#include "core/Events/eventwidget_macro.h"
|
||||||
/*
|
#include "core/WrapperCache/wrappercache.h"
|
||||||
|
|
||||||
This macro adds common QObject exported methods
|
/*
|
||||||
The exported methods are taken into this macro to avoid writing them in each
|
This macro adds common QObject exported methods
|
||||||
and every widget we export.
|
The exported methods are taken into this macro to avoid writing them in each
|
||||||
|
and every widget we export.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QOBJECT_WRAPPED_METHODS_DECLARATION
|
#ifndef QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE
|
||||||
#define QOBJECT_WRAPPED_METHODS_DECLARATION \
|
#define QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE(source) \
|
||||||
\
|
\
|
||||||
EVENTWIDGET_WRAPPED_METHODS_DECLARATION \
|
EVENTWIDGET_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE(source) \
|
||||||
\
|
\
|
||||||
|
Napi::Value __id__(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
return Napi::Value::From( \
|
||||||
|
env, extrautils::hashPointerTo53bit( \
|
||||||
|
static_cast<QObject*>(this->instance.data()))); \
|
||||||
|
} \
|
||||||
Napi::Value inherits(const Napi::CallbackInfo& info) { \
|
Napi::Value inherits(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
Napi::String className = info[0].As<Napi::String>(); \
|
Napi::String className = info[0].As<Napi::String>(); \
|
||||||
bool doesIt = this->instance->inherits(className.Utf8Value().c_str()); \
|
bool doesIt = this->instance->inherits(className.Utf8Value().c_str()); \
|
||||||
return Napi::Value::From(env, doesIt); \
|
return Napi::Value::From(env, doesIt); \
|
||||||
} \
|
} \
|
||||||
Napi::Value setProperty(const Napi::CallbackInfo& info) { \
|
Napi::Value setProperty(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
Napi::String name = info[0].As<Napi::String>(); \
|
Napi::String name = info[0].As<Napi::String>(); \
|
||||||
Napi::Value value = info[1]; \
|
Napi::Value value = info[1]; \
|
||||||
auto variant = \
|
auto variant = \
|
||||||
@ -37,7 +42,6 @@
|
|||||||
} \
|
} \
|
||||||
Napi::Value property(const Napi::CallbackInfo& info) { \
|
Napi::Value property(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
Napi::String name = info[0].As<Napi::String>(); \
|
Napi::String name = info[0].As<Napi::String>(); \
|
||||||
Napi::Value value = info[1]; \
|
Napi::Value value = info[1]; \
|
||||||
QVariant* variant = \
|
QVariant* variant = \
|
||||||
@ -48,7 +52,6 @@
|
|||||||
} \
|
} \
|
||||||
Napi::Value setObjectName(const Napi::CallbackInfo& info) { \
|
Napi::Value setObjectName(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
Napi::String objectName = info[0].As<Napi::String>(); \
|
Napi::String objectName = info[0].As<Napi::String>(); \
|
||||||
this->instance->setObjectName( \
|
this->instance->setObjectName( \
|
||||||
QString::fromStdString(objectName.Utf8Value())); \
|
QString::fromStdString(objectName.Utf8Value())); \
|
||||||
@ -56,29 +59,120 @@
|
|||||||
} \
|
} \
|
||||||
Napi::Value objectName(const Napi::CallbackInfo& info) { \
|
Napi::Value objectName(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
QString objectName = this->instance->objectName(); \
|
QString objectName = this->instance->objectName(); \
|
||||||
return Napi::String::New(env, objectName.toStdString()); \
|
return Napi::String::New(env, objectName.toStdString()); \
|
||||||
|
} \
|
||||||
|
Napi::Value dumpObjectTree(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
this->instance->dumpObjectTree(); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value dumpObjectInfo(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
this->instance->dumpObjectInfo(); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value __external_qobject__(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
return Napi::External<QObject>::New( \
|
||||||
|
env, static_cast<QObject*>(this->instance)); \
|
||||||
|
} \
|
||||||
|
Napi::Value startTimer(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int interval = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
|
Qt::TimerType timerType = \
|
||||||
|
static_cast<Qt::TimerType>(info[1].As<Napi::Number>().Int32Value()); \
|
||||||
|
int result = this->instance->startTimer(interval, timerType); \
|
||||||
|
return Napi::Value::From(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value killTimer(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int id = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
|
this->instance->killTimer(id); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value parent(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QObject* parent = this->instance->parent(); \
|
||||||
|
if (parent) { \
|
||||||
|
return WrapperCache::instance.getWrapper(env, parent); \
|
||||||
|
} else { \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
Napi::Value deleteLater(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
this->instance->deleteLater(); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value deleteObject(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
delete static_cast<QObject*>(this->instance); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value children(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QObjectList children = this->instance->children(); \
|
||||||
|
Napi::Array resultArrayNapi = Napi::Array::New(env, children.size()); \
|
||||||
|
for (int i = 0; i < children.size(); i++) { \
|
||||||
|
resultArrayNapi[i] = \
|
||||||
|
WrapperCache::instance.getWrapper(env, children[i]); \
|
||||||
|
} \
|
||||||
|
return resultArrayNapi; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ideally this macro below should go in
|
||||||
|
// QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE but some wrappers
|
||||||
|
// need their own setParent()` implementation which handles different
|
||||||
|
// arguments.
|
||||||
|
#define QOBJECT_SET_PARENT_IMPL \
|
||||||
|
Napi::Value setParent(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
if (info[0].IsNull()) { \
|
||||||
|
this->instance->setParent(nullptr); \
|
||||||
|
} else { \
|
||||||
|
QObject* parentObject = info[0].As<Napi::External<QObject>>().Data(); \
|
||||||
|
this->instance->setParent(parentObject); \
|
||||||
|
} \
|
||||||
|
return env.Null(); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE
|
||||||
|
|
||||||
|
#ifndef QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
|
#define QOBJECT_WRAPPED_METHODS_DECLARATION \
|
||||||
|
QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE(this->instance.data()) \
|
||||||
|
QOBJECT_SET_PARENT_IMPL
|
||||||
#endif // QOBJECT_WRAPPED_METHODS_DECLARATION
|
#endif // QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
#ifndef QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE
|
#ifndef QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
#define QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE(ComponentWrapName) \
|
#define QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE(ComponentWrapName) \
|
||||||
\
|
\
|
||||||
EVENTWIDGET_WRAPPED_METHODS_EXPORT_DEFINE(ComponentWrapName) \
|
EVENTWIDGET_WRAPPED_METHODS_EXPORT_DEFINE(ComponentWrapName) \
|
||||||
\
|
\
|
||||||
InstanceMethod("inherits", &ComponentWrapName::inherits), \
|
InstanceMethod("__id__", &ComponentWrapName::__id__), \
|
||||||
InstanceMethod("setProperty", &ComponentWrapName::setProperty), \
|
InstanceMethod("__external_qobject__", \
|
||||||
InstanceMethod("property", &ComponentWrapName::property), \
|
&ComponentWrapName::__external_qobject__), \
|
||||||
InstanceMethod("setObjectName", &ComponentWrapName::setObjectName), \
|
InstanceMethod("inherits", &ComponentWrapName::inherits), \
|
||||||
InstanceMethod("objectName", &ComponentWrapName::objectName),
|
InstanceMethod("setProperty", &ComponentWrapName::setProperty), \
|
||||||
|
InstanceMethod("property", &ComponentWrapName::property), \
|
||||||
|
InstanceMethod("setObjectName", &ComponentWrapName::setObjectName), \
|
||||||
|
InstanceMethod("objectName", &ComponentWrapName::objectName), \
|
||||||
|
InstanceMethod("dumpObjectTree", &ComponentWrapName::dumpObjectTree), \
|
||||||
|
InstanceMethod("dumpObjectInfo", &ComponentWrapName::dumpObjectInfo), \
|
||||||
|
InstanceMethod("setParent", &ComponentWrapName::setParent), \
|
||||||
|
InstanceMethod("startTimer", &ComponentWrapName::startTimer), \
|
||||||
|
InstanceMethod("killTimer", &ComponentWrapName::killTimer), \
|
||||||
|
InstanceMethod("parent", &ComponentWrapName::parent), \
|
||||||
|
InstanceMethod("deleteLater", &ComponentWrapName::deleteLater), \
|
||||||
|
InstanceMethod("delete", &ComponentWrapName::deleteObject), \
|
||||||
|
InstanceMethod("children", &ComponentWrapName::children),
|
||||||
|
|
||||||
#endif // QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE
|
#endif // QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
|
|
||||||
#ifndef QOBJECT_SIGNALS
|
#ifndef QOBJECT_SIGNALS_ON_TARGET
|
||||||
#define QOBJECT_SIGNALS \
|
#define QOBJECT_SIGNALS_ON_TARGET(target) \
|
||||||
QObject::connect(this, &QObject::objectNameChanged, \
|
QObject::connect(target, &QObject::objectNameChanged, \
|
||||||
[=](const QString& objectName) { \
|
[=](const QString& objectName) { \
|
||||||
Napi::Env env = this->emitOnNode.Env(); \
|
Napi::Env env = this->emitOnNode.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
Napi::HandleScope scope(env); \
|
||||||
@ -86,5 +180,28 @@
|
|||||||
{Napi::String::New(env, "objectNameChanged"), \
|
{Napi::String::New(env, "objectNameChanged"), \
|
||||||
Napi::Value::From(env, objectName.toStdString())}); \
|
Napi::Value::From(env, objectName.toStdString())}); \
|
||||||
});
|
});
|
||||||
|
#endif // QOBJECT_SIGNALS_ON_TARGET
|
||||||
|
|
||||||
|
#ifndef QOBJECT_SIGNALS
|
||||||
|
#define QOBJECT_SIGNALS QOBJECT_SIGNALS_ON_TARGET(this)
|
||||||
#endif // QOBJECT_SIGNALS
|
#endif // QOBJECT_SIGNALS
|
||||||
|
|
||||||
|
/*
|
||||||
|
Macro to register a function to wrap QObject pointers of a
|
||||||
|
given subclass to wrapper instances. First parameter is the
|
||||||
|
plain name of the QObject subclass (no quotes), seconds is the
|
||||||
|
name of the wrapper class.
|
||||||
|
*/
|
||||||
|
#ifndef QOBJECT_REGISTER_WRAPPER
|
||||||
|
#define QOBJECT_REGISTER_WRAPPER(qobjectType, ComponentWrapName) \
|
||||||
|
WrapperCache::instance.registerWrapper( \
|
||||||
|
QString(#qobjectType), \
|
||||||
|
[](Napi::Env env, QObject* qobject) -> Napi::Object { \
|
||||||
|
qobjectType* exactQObject = dynamic_cast<qobjectType*>(qobject); \
|
||||||
|
Napi::Object wrapper = ComponentWrapName::constructor.New( \
|
||||||
|
{Napi::External<QObject>::New(env, exactQObject)}); \
|
||||||
|
return wrapper; \
|
||||||
|
});
|
||||||
|
#endif // QOBJECT_REGISTER_WRAPPER
|
||||||
|
|
||||||
|
#include "QtCore/QObject/qobject_wrap.h"
|
||||||
|
|||||||
@ -11,14 +11,15 @@
|
|||||||
class DLL_EXPORT QObjectWrap : public Napi::ObjectWrap<QObjectWrap> {
|
class DLL_EXPORT QObjectWrap : public Napi::ObjectWrap<QObjectWrap> {
|
||||||
QOBJECT_WRAPPED_METHODS_DECLARATION
|
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NObject> instance;
|
QPointer<QObject> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QObjectWrap(const Napi::CallbackInfo& info);
|
QObjectWrap(const Napi::CallbackInfo& info);
|
||||||
~QObjectWrap();
|
~QObjectWrap();
|
||||||
NObject* getInternalInstance();
|
QObject* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
|
static Napi::Object wrapFunc(Napi::Env env, QObject* qobject);
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
};
|
};
|
||||||
|
|||||||
@ -19,9 +19,18 @@ class DLL_EXPORT QSizeWrap : public Napi::ObjectWrap<QSizeWrap> {
|
|||||||
~QSizeWrap();
|
~QSizeWrap();
|
||||||
QSize* getInternalInstance();
|
QSize* getInternalInstance();
|
||||||
// Wrapped methods
|
// Wrapped methods
|
||||||
|
Napi::Value boundedTo(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value expandedTo(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value height(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isEmpty(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isNull(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isValid(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scale(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scaled(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setHeight(const Napi::CallbackInfo& info);
|
Napi::Value setHeight(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setWidth(const Napi::CallbackInfo& info);
|
Napi::Value setWidth(const Napi::CallbackInfo& info);
|
||||||
Napi::Value height(const Napi::CallbackInfo& info);
|
Napi::Value transpose(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value transposed(const Napi::CallbackInfo& info);
|
||||||
Napi::Value width(const Napi::CallbackInfo& info);
|
Napi::Value width(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
40
src/cpp/include/nodegui/QtCore/QSizeF/qsizef_wrap.h
Normal file
40
src/cpp/include/nodegui/QtCore/QSizeF/qsizef_wrap.h
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QSizeF>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QSizeFWrap : public Napi::ObjectWrap<QSizeFWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
private:
|
||||||
|
std::unique_ptr<QSizeF> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QSizeFWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QSizeFWrap();
|
||||||
|
QSizeF* getInternalInstance();
|
||||||
|
// Wrapped methods
|
||||||
|
Napi::Value boundedTo(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value expandedTo(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value height(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isEmpty(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isNull(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isValid(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scale(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scaled(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setHeight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setWidth(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value toSize(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value transpose(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value transposed(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value width(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace StaticQSizeFWrapMethods {
|
||||||
|
DLL_EXPORT Napi::Value fromQVariant(const Napi::CallbackInfo& info);
|
||||||
|
} // namespace StaticQSizeFWrapMethods
|
||||||
@ -22,9 +22,10 @@ class DLL_EXPORT QVariantWrap : public Napi::ObjectWrap<QVariantWrap> {
|
|||||||
Napi::Value toInt(const Napi::CallbackInfo& info);
|
Napi::Value toInt(const Napi::CallbackInfo& info);
|
||||||
Napi::Value toDouble(const Napi::CallbackInfo& info);
|
Napi::Value toDouble(const Napi::CallbackInfo& info);
|
||||||
Napi::Value toBool(const Napi::CallbackInfo& info);
|
Napi::Value toBool(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value toStringList(const Napi::CallbackInfo& info);
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace StaticQVariantWrapMethods {
|
namespace StaticQVariantWrapMethods {
|
||||||
DLL_EXPORT Napi::Value converToQVariant(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value convertToQVariant(const Napi::CallbackInfo& info);
|
||||||
} // namespace StaticQVariantWrapMethods
|
} // namespace StaticQVariantWrapMethods
|
||||||
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include "Extras/Export/export.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "QtCore/QObject/qobject_macro.h"
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
#include "QtGui/QScreen/qscreen_wrap.h"
|
||||||
|
#include "core/WrapperCache/wrappercache.h"
|
||||||
#include "napi.h"
|
#include "napi.h"
|
||||||
|
|
||||||
class DLL_EXPORT NApplication : public QApplication, public EventWidget {
|
class DLL_EXPORT NApplication : public QApplication, public EventWidget {
|
||||||
@ -12,15 +14,54 @@ class DLL_EXPORT NApplication : public QApplication, public EventWidget {
|
|||||||
EVENTWIDGET_IMPLEMENTATIONS(QApplication)
|
EVENTWIDGET_IMPLEMENTATIONS(QApplication)
|
||||||
public:
|
public:
|
||||||
using QApplication::QApplication; // inherit all constructors of QApplication
|
using QApplication::QApplication; // inherit all constructors of QApplication
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
QOBJECT_SIGNALS
|
QOBJECT_SIGNALS
|
||||||
|
|
||||||
|
QObject::connect(
|
||||||
|
this, &QGuiApplication::applicationDisplayNameChanged, [=]() {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call(
|
||||||
|
{Napi::String::New(env, "applicationDisplayNameChanged")});
|
||||||
|
});
|
||||||
|
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
this, &QGuiApplication::focusWindowChanged, [=](QWindow* focusWindow) {
|
this, &QGuiApplication::focusWindowChanged, [=](QWindow* focusWindow) {
|
||||||
Napi::Env env = this->emitOnNode.Env();
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
Napi::HandleScope scope(env);
|
Napi::HandleScope scope(env);
|
||||||
this->emitOnNode.Call({Napi::String::New(env, "focusWindowChanged")});
|
this->emitOnNode.Call({Napi::String::New(env, "focusWindowChanged")});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QObject::connect(this, &QGuiApplication::lastWindowClosed, [=]() {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call({Napi::String::New(env, "lastWindowClosed")});
|
||||||
|
});
|
||||||
|
|
||||||
|
QObject::connect(
|
||||||
|
this, &QGuiApplication::primaryScreenChanged, [=](QScreen* screen) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
auto instance = WrapperCache::instance.getWrapper(env, screen, true);
|
||||||
|
this->emitOnNode.Call(
|
||||||
|
{Napi::String::New(env, "primaryScreenChanged"), instance});
|
||||||
|
});
|
||||||
|
|
||||||
|
QObject::connect(this, &QGuiApplication::screenAdded, [=](QScreen* screen) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
auto instance = WrapperCache::instance.getWrapper(env, screen, true);
|
||||||
|
this->emitOnNode.Call({Napi::String::New(env, "screenAdded"), instance});
|
||||||
|
});
|
||||||
|
|
||||||
|
QObject::connect(
|
||||||
|
this, &QGuiApplication::screenRemoved, [=](QScreen* screen) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
auto instance = WrapperCache::instance.getWrapper(env, screen, true);
|
||||||
|
this->emitOnNode.Call(
|
||||||
|
{Napi::String::New(env, "screenRemoved"), instance});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -28,10 +28,16 @@ class DLL_EXPORT QApplicationWrap : public Napi::ObjectWrap<QApplicationWrap> {
|
|||||||
Napi::Value exit(const Napi::CallbackInfo& info);
|
Napi::Value exit(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setQuitOnLastWindowClosed(const Napi::CallbackInfo& info);
|
Napi::Value setQuitOnLastWindowClosed(const Napi::CallbackInfo& info);
|
||||||
Napi::Value quitOnLastWindowClosed(const Napi::CallbackInfo& info);
|
Napi::Value quitOnLastWindowClosed(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value palette(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setStyleSheet(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value devicePixelRatio(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace StaticQApplicationWrapMethods {
|
namespace StaticQApplicationWrapMethods {
|
||||||
DLL_EXPORT Napi::Value instance(const Napi::CallbackInfo& info);
|
|
||||||
DLL_EXPORT Napi::Value clipboard(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value clipboard(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value instance(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value primaryScreen(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value screens(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value setStyle(const Napi::CallbackInfo& info);
|
||||||
DLL_EXPORT Napi::Value style(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value style(const Napi::CallbackInfo& info);
|
||||||
} // namespace StaticQApplicationWrapMethods
|
} // namespace StaticQApplicationWrapMethods
|
||||||
|
|||||||
@ -3,21 +3,30 @@
|
|||||||
#include <napi.h>
|
#include <napi.h>
|
||||||
|
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
#include "Extras/Export/export.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QClipboardWrap : public Napi::ObjectWrap<QClipboardWrap> {
|
class DLL_EXPORT QClipboardWrap : public Napi::ObjectWrap<QClipboardWrap>,
|
||||||
COMPONENT_WRAPPED_METHODS_DECLARATION
|
public EventWidget {
|
||||||
|
QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE(this)
|
||||||
|
// Note: We don't use EVENTWIDGET_IMPLEMENTATIONS() here because this class
|
||||||
|
// doesn't handle any QEvents.
|
||||||
|
QOBJECT_SET_PARENT_IMPL
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QClipboard* instance;
|
QPointer<QClipboard> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
|
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QClipboardWrap(const Napi::CallbackInfo& info);
|
QClipboardWrap(const Napi::CallbackInfo& info);
|
||||||
QClipboard* getInternalInstance();
|
QClipboard* getInternalInstance();
|
||||||
|
|
||||||
|
virtual void connectSignalsToEventEmitter();
|
||||||
|
|
||||||
// Wrapped methods
|
// Wrapped methods
|
||||||
Napi::Value clear(const Napi::CallbackInfo& info);
|
Napi::Value clear(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setText(const Napi::CallbackInfo& info);
|
Napi::Value setText(const Napi::CallbackInfo& info);
|
||||||
|
|||||||
@ -27,6 +27,8 @@ class DLL_EXPORT QColorWrap : public Napi::ObjectWrap<QColorWrap> {
|
|||||||
Napi::Value blue(const Napi::CallbackInfo& info);
|
Napi::Value blue(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setAlpha(const Napi::CallbackInfo& info);
|
Napi::Value setAlpha(const Napi::CallbackInfo& info);
|
||||||
Napi::Value alpha(const Napi::CallbackInfo& info);
|
Napi::Value alpha(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value rgb(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value rgba(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace StaticQColorWrapMethods {
|
namespace StaticQColorWrapMethods {
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class DLL_EXPORT NDrag : public QDrag, public EventWidget {
|
|||||||
public:
|
public:
|
||||||
using QDrag::QDrag;
|
using QDrag::QDrag;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
QOBJECT_SIGNALS
|
QOBJECT_SIGNALS
|
||||||
QObject::connect(this, &QDrag::actionChanged, [=](Qt::DropAction action) {
|
QObject::connect(this, &QDrag::actionChanged, [=](Qt::DropAction action) {
|
||||||
Napi::Env env = this->emitOnNode.Env();
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
|||||||
@ -22,13 +22,13 @@ class DLL_EXPORT QDragWrap : public Napi::ObjectWrap<QDragWrap> {
|
|||||||
// except that it is automatically cleared when the referenced object is
|
// except that it is automatically cleared when the referenced object is
|
||||||
// destroyed (unlike normal C++ pointers, which become "dangling pointers" in
|
// destroyed (unlike normal C++ pointers, which become "dangling pointers" in
|
||||||
// such cases). T must be a subclass of QObject.
|
// such cases). T must be a subclass of QObject.
|
||||||
QPointer<NDrag> instance;
|
QPointer<QDrag> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QDragWrap(const Napi::CallbackInfo& info);
|
QDragWrap(const Napi::CallbackInfo& info);
|
||||||
~QDragWrap();
|
~QDragWrap();
|
||||||
NDrag* getInternalInstance();
|
QDrag* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
#ifndef QINPUTEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
#define QINPUTEVENT_WRAPPED_METHODS_DECLARATION \
|
||||||
|
Napi::Value modifiers(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
uint v = static_cast<uint>(this->instance->modifiers()); \
|
||||||
|
return Napi::Number::From(env, v); \
|
||||||
|
} \
|
||||||
|
Napi::Value timestamp(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
ulong timestamp = this->instance->timestamp(); \
|
||||||
|
return Napi::Number::From(env, timestamp); \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef QINPUTEVENT_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
|
#define QINPUTEVENT_WRAPPED_METHODS_EXPORT_DEFINE(WidgetWrapName) \
|
||||||
|
InstanceMethod("modifiers", &WidgetWrapName::modifiers), \
|
||||||
|
InstanceMethod("timestamp", &WidgetWrapName::timestamp),
|
||||||
|
#endif
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QInputMethodEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QInputMethodEventWrap
|
||||||
|
: public Napi::ObjectWrap<QInputMethodEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QInputMethodEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QInputMethodEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QInputMethodEventWrap();
|
||||||
|
QInputMethodEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value commitString(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value preeditString(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value replacementLength(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value replacementStart(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setCommitString(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QInputMethodQueryEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QInputMethodQueryEventWrap
|
||||||
|
: public Napi::ObjectWrap<QInputMethodQueryEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QInputMethodQueryEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QInputMethodQueryEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QInputMethodQueryEventWrap();
|
||||||
|
QInputMethodQueryEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value queries(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setValue(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value value(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -6,11 +6,13 @@
|
|||||||
|
|
||||||
#include "Extras/Export/export.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "QtGui/QEvent/QInputEvent/qinputevent_macro.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QKeyEventWrap : public Napi::ObjectWrap<QKeyEventWrap> {
|
class DLL_EXPORT QKeyEventWrap : public Napi::ObjectWrap<QKeyEventWrap> {
|
||||||
COMPONENT_WRAPPED_METHODS_DECLARATION
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
QEVENT_WRAPPED_METHODS_DECLARATION
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QINPUTEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QKeyEvent* instance;
|
QKeyEvent* instance;
|
||||||
@ -25,7 +27,6 @@ class DLL_EXPORT QKeyEventWrap : public Napi::ObjectWrap<QKeyEventWrap> {
|
|||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value text(const Napi::CallbackInfo& info);
|
Napi::Value text(const Napi::CallbackInfo& info);
|
||||||
Napi::Value key(const Napi::CallbackInfo& info);
|
Napi::Value key(const Napi::CallbackInfo& info);
|
||||||
Napi::Value modifiers(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value count(const Napi::CallbackInfo& info);
|
Napi::Value count(const Napi::CallbackInfo& info);
|
||||||
Napi::Value isAutoRepeat(const Napi::CallbackInfo& info);
|
Napi::Value isAutoRepeat(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,11 +6,13 @@
|
|||||||
|
|
||||||
#include "Extras/Export/export.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "QtGui/QEvent/QInputEvent/qinputevent_macro.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QMouseEventWrap : public Napi::ObjectWrap<QMouseEventWrap> {
|
class DLL_EXPORT QMouseEventWrap : public Napi::ObjectWrap<QMouseEventWrap> {
|
||||||
COMPONENT_WRAPPED_METHODS_DECLARATION
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
QEVENT_WRAPPED_METHODS_DECLARATION
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QINPUTEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMouseEvent* instance;
|
QMouseEvent* instance;
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QMoveEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QMoveEventWrap : public Napi::ObjectWrap<QMoveEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QMoveEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QMoveEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QMoveEventWrap();
|
||||||
|
QMoveEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value oldPos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value pos(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -5,11 +5,15 @@
|
|||||||
#include <QNativeGestureEvent>
|
#include <QNativeGestureEvent>
|
||||||
|
|
||||||
#include "Extras/Export/export.h"
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "QtGui/QEvent/QInputEvent/qinputevent_macro.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QNativeGestureEventWrap
|
class DLL_EXPORT QNativeGestureEventWrap
|
||||||
: public Napi::ObjectWrap<QNativeGestureEventWrap> {
|
: public Napi::ObjectWrap<QNativeGestureEventWrap> {
|
||||||
COMPONENT_WRAPPED_METHODS_DECLARATION
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QINPUTEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QNativeGestureEvent* instance;
|
QNativeGestureEvent* instance;
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QResizeEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QResizeEventWrap : public Napi::ObjectWrap<QResizeEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QResizeEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QResizeEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QResizeEventWrap();
|
||||||
|
QResizeEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value oldSize(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value size(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -6,11 +6,13 @@
|
|||||||
|
|
||||||
#include "Extras/Export/export.h"
|
#include "Extras/Export/export.h"
|
||||||
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "QtGui/QEvent/QInputEvent/qinputevent_macro.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QTabletEventWrap : public Napi::ObjectWrap<QTabletEventWrap> {
|
class DLL_EXPORT QTabletEventWrap : public Napi::ObjectWrap<QTabletEventWrap> {
|
||||||
COMPONENT_WRAPPED_METHODS_DECLARATION
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
QEVENT_WRAPPED_METHODS_DECLARATION
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QINPUTEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTabletEvent* instance;
|
QTabletEvent* instance;
|
||||||
|
|||||||
@ -0,0 +1,27 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QTimerEvent>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QTimerEventWrap : public Napi::ObjectWrap<QTimerEventWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
QTimerEvent* instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QTimerEventWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QTimerEventWrap();
|
||||||
|
QTimerEvent* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value timerId(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -5,10 +5,14 @@
|
|||||||
#include <QWheelEvent>
|
#include <QWheelEvent>
|
||||||
|
|
||||||
#include "Extras/Export/export.h"
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtGui/QEvent/QEvent/qevent_macro.h"
|
||||||
|
#include "QtGui/QEvent/QInputEvent/qinputevent_macro.h"
|
||||||
#include "core/Component/component_macro.h"
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QWheelEventWrap : public Napi::ObjectWrap<QWheelEventWrap> {
|
class DLL_EXPORT QWheelEventWrap : public Napi::ObjectWrap<QWheelEventWrap> {
|
||||||
COMPONENT_WRAPPED_METHODS_DECLARATION
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
QINPUTEVENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QWheelEvent* instance;
|
QWheelEvent* instance;
|
||||||
|
|||||||
@ -18,6 +18,8 @@ class DLL_EXPORT QFontWrap : public Napi::ObjectWrap<QFontWrap> {
|
|||||||
~QFontWrap();
|
~QFontWrap();
|
||||||
QFont* getInternalInstance();
|
QFont* getInternalInstance();
|
||||||
// Wrapped methods
|
// Wrapped methods
|
||||||
|
Napi::Value bold(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setBold(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setCapitalization(const Napi::CallbackInfo& info);
|
Napi::Value setCapitalization(const Napi::CallbackInfo& info);
|
||||||
Napi::Value capitalization(const Napi::CallbackInfo& info);
|
Napi::Value capitalization(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setFamily(const Napi::CallbackInfo& info);
|
Napi::Value setFamily(const Napi::CallbackInfo& info);
|
||||||
|
|||||||
@ -30,5 +30,6 @@ class DLL_EXPORT QFontDatabaseWrap
|
|||||||
|
|
||||||
namespace StaticQFontDatabaseWrapMethods {
|
namespace StaticQFontDatabaseWrapMethods {
|
||||||
DLL_EXPORT Napi::Value addApplicationFont(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value addApplicationFont(const Napi::CallbackInfo& info);
|
||||||
|
DLL_EXPORT Napi::Value applicationFontFamilies(const Napi::CallbackInfo& info);
|
||||||
DLL_EXPORT Napi::Value removeApplicationFont(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value removeApplicationFont(const Napi::CallbackInfo& info);
|
||||||
} // namespace StaticQFontDatabaseWrapMethods
|
} // namespace StaticQFontDatabaseWrapMethods
|
||||||
|
|||||||
@ -38,4 +38,11 @@ class DLL_EXPORT QFontMetricsWrap : public Napi::ObjectWrap<QFontMetricsWrap> {
|
|||||||
Napi::Value swap(const Napi::CallbackInfo& info);
|
Napi::Value swap(const Napi::CallbackInfo& info);
|
||||||
Napi::Value underlinePos(const Napi::CallbackInfo& info);
|
Napi::Value underlinePos(const Napi::CallbackInfo& info);
|
||||||
Napi::Value xHeight(const Napi::CallbackInfo& info);
|
Napi::Value xHeight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value maxWidth(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value minLeftBearing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value minRightBearing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value inFontUcs4(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value boundingRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value tightBoundingRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value elidedText(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -0,0 +1,49 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QFontMetricsF>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QFontMetricsFWrap
|
||||||
|
: public Napi::ObjectWrap<QFontMetricsFWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unique_ptr<QFontMetricsF> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QFontMetricsFWrap(const Napi::CallbackInfo& info);
|
||||||
|
QFontMetricsF* getInternalInstance();
|
||||||
|
// Wrapped methods
|
||||||
|
Napi::Value ascent(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value averageCharWidth(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value capHeight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value descent(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value fontDpi(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value height(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value horizontalAdvance(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value inFont(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value leading(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value leftBearing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value lineSpacing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value lineWidth(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value overlinePos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value rightBearing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value size(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value strikeOutPos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value swap(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value underlinePos(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value xHeight(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value maxWidth(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value minLeftBearing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value minRightBearing(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value inFontUcs4(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value boundingRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value tightBoundingRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value elidedText(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -20,10 +20,18 @@ class DLL_EXPORT QIconWrap : public Napi::ObjectWrap<QIconWrap> {
|
|||||||
~QIconWrap();
|
~QIconWrap();
|
||||||
QIcon* getInternalInstance();
|
QIcon* getInternalInstance();
|
||||||
// Wrapped methods
|
// Wrapped methods
|
||||||
|
Napi::Value actualSize(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value addFile(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value addPixmap(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value availableSizes(const Napi::CallbackInfo& info);
|
||||||
Napi::Value pixmap(const Napi::CallbackInfo& info);
|
Napi::Value pixmap(const Napi::CallbackInfo& info);
|
||||||
Napi::Value isMask(const Napi::CallbackInfo& info);
|
Napi::Value isMask(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value isNull(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value name(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value paint(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setIsMask(const Napi::CallbackInfo& info);
|
Napi::Value setIsMask(const Napi::CallbackInfo& info);
|
||||||
Napi::Value cacheKey(const Napi::CallbackInfo& info);
|
Napi::Value cacheKey(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value swap(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace StaticQIconWrapMethods {
|
namespace StaticQIconWrapMethods {
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class DLL_EXPORT NMovie : public QMovie, public EventWidget {
|
|||||||
public:
|
public:
|
||||||
using QMovie::QMovie;
|
using QMovie::QMovie;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
QOBJECT_SIGNALS
|
QOBJECT_SIGNALS
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
QObject::connect(this, &QMovie::error,
|
QObject::connect(this, &QMovie::error,
|
||||||
|
|||||||
24
src/cpp/include/nodegui/QtGui/QPalette/qpalette_wrap.h
Normal file
24
src/cpp/include/nodegui/QtGui/QPalette/qpalette_wrap.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QPalette>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "core/Component/component_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QPaletteWrap : public Napi::ObjectWrap<QPaletteWrap> {
|
||||||
|
COMPONENT_WRAPPED_METHODS_DECLARATION
|
||||||
|
private:
|
||||||
|
std::unique_ptr<QPalette> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QPaletteWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QPaletteWrap();
|
||||||
|
QPalette* getInternalInstance();
|
||||||
|
|
||||||
|
// Wrapped methods
|
||||||
|
Napi::Value color(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
34
src/cpp/include/nodegui/QtGui/QScreen/qscreen_wrap.h
Normal file
34
src/cpp/include/nodegui/QtGui/QScreen/qscreen_wrap.h
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QPointer>
|
||||||
|
#include <QScreen>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QScreenWrap : public Napi::ObjectWrap<QScreenWrap>,
|
||||||
|
public EventWidget {
|
||||||
|
QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE(this)
|
||||||
|
QOBJECT_SET_PARENT_IMPL
|
||||||
|
|
||||||
|
// Note: We don't use EVENTWIDGET_IMPLEMENTATIONS() here because this class
|
||||||
|
// doesn't handle any QEvents.
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPointer<QScreen> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QScreenWrap(const Napi::CallbackInfo& info);
|
||||||
|
QScreen* getInternalInstance();
|
||||||
|
|
||||||
|
virtual void connectSignalsToEventEmitter();
|
||||||
|
|
||||||
|
// Wrapped methods
|
||||||
|
Napi::Value grabWindow(const Napi::CallbackInfo& info);
|
||||||
|
};
|
||||||
@ -20,4 +20,6 @@ class DLL_EXPORT QStyleWrap : public Napi::ObjectWrap<QStyleWrap> {
|
|||||||
QStyle* getInternalInstance();
|
QStyle* getInternalInstance();
|
||||||
// Wrapped methods
|
// Wrapped methods
|
||||||
Napi::Value pixelMetric(const Napi::CallbackInfo& info);
|
Napi::Value pixelMetric(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value polish(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value unpolish(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|||||||
58
src/cpp/include/nodegui/QtGui/QWindow/qwindow_wrap.h
Normal file
58
src/cpp/include/nodegui/QtGui/QWindow/qwindow_wrap.h
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QPointer>
|
||||||
|
#include <QWindow>
|
||||||
|
|
||||||
|
#include "Extras/Export/export.h"
|
||||||
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QWindowWrap : public Napi::ObjectWrap<QWindowWrap>,
|
||||||
|
public EventWidget,
|
||||||
|
public QObject {
|
||||||
|
QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE(this)
|
||||||
|
// Note: We don't use EVENTWIDGET_IMPLEMENTATIONS() here because this class
|
||||||
|
// doesn't handle any QEvents.
|
||||||
|
|
||||||
|
// `QWindow` has a special setParent() which only accepts `QWindow`s
|
||||||
|
Napi::Value setParent(const Napi::CallbackInfo& info) {
|
||||||
|
Napi::Env env = info.Env();
|
||||||
|
QObject* parentObject = info[0].As<Napi::External<QObject>>().Data();
|
||||||
|
QWindow* parentWindow = qobject_cast<QWindow*>(parentObject);
|
||||||
|
if (parentWindow) {
|
||||||
|
this->instance->setParent(parentWindow);
|
||||||
|
}
|
||||||
|
return env.Null();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPointer<QWindow> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QWindowWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QWindowWrap();
|
||||||
|
QWindow* getInternalInstance();
|
||||||
|
|
||||||
|
virtual void connectSignalsToEventEmitter();
|
||||||
|
|
||||||
|
// wrapped methods
|
||||||
|
Napi::Value screen(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value showFullScreen(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value showMaximized(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value showMinimized(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value showNormal(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value startSystemMove(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value startSystemResize(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setWindowState(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value windowState(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value visibility(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setVisibility(const Napi::CallbackInfo& info);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool eventFilter(QObject* watched, QEvent* event) override;
|
||||||
|
};
|
||||||
@ -16,20 +16,16 @@
|
|||||||
QWIDGET_WRAPPED_METHODS_DECLARATION \
|
QWIDGET_WRAPPED_METHODS_DECLARATION \
|
||||||
Napi::Value animateClick(const Napi::CallbackInfo& info) { \
|
Napi::Value animateClick(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
this->instance->animateClick(); \
|
||||||
int msec = info[0].As<Napi::Number>().Int32Value(); \
|
|
||||||
this->instance->animateClick(msec); \
|
|
||||||
return env.Null(); \
|
return env.Null(); \
|
||||||
} \
|
} \
|
||||||
Napi::Value click(const Napi::CallbackInfo& info) { \
|
Napi::Value click(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
this->instance->click(); \
|
this->instance->click(); \
|
||||||
return env.Null(); \
|
return env.Null(); \
|
||||||
} \
|
} \
|
||||||
Napi::Value toggle(const Napi::CallbackInfo& info) { \
|
Napi::Value toggle(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
this->instance->toggle(); \
|
this->instance->toggle(); \
|
||||||
return env.Null(); \
|
return env.Null(); \
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,21 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
This macro adds common QAbstractItemDelete exported methods
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef QABSTRACTITEMDELEGATE_WRAPPED_METHODS_DECLARATION
|
||||||
|
#define QABSTRACTITEMDELEGATE_WRAPPED_METHODS_DECLARATION \
|
||||||
|
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef QABSTRACTITEMDELEGATE_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
|
#define QABSTRACTITEMDELEGATE_WRAPPED_METHODS_EXPORT_DEFINE(WrapName) \
|
||||||
|
QOBJECT_WRAPPED_METHODS_EXPORT_DEFINE(WrapName)
|
||||||
|
#endif // QABSTRACTITEMDELEGATE_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
|
|
||||||
|
#ifndef QABSTRACTITEMDELEGATE_SIGNALS
|
||||||
|
#define QABSTRACTITEMDELEGATE_SIGNALS QOBJECT_SIGNALS
|
||||||
|
#endif // QABSTRACTITEMDELEGATE_SIGNALS
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <napi.h>
|
||||||
|
|
||||||
|
#include <QAbstractItemDelegate>
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
|
#include "Extras/Utils/nutils.h"
|
||||||
|
#include "QtWidgets/QAbstractItemDelegate/qabstractitemdelegate_macro.h"
|
||||||
|
|
||||||
|
class DLL_EXPORT QAbstractItemDelegateWrap
|
||||||
|
: public Napi::ObjectWrap<QAbstractItemDelegateWrap> {
|
||||||
|
QABSTRACTITEMDELEGATE_WRAPPED_METHODS_DECLARATION
|
||||||
|
private:
|
||||||
|
QPointer<QAbstractItemDelegate> instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
|
QAbstractItemDelegateWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QAbstractItemDelegateWrap();
|
||||||
|
QAbstractItemDelegate* getInternalInstance();
|
||||||
|
// class constructor
|
||||||
|
static Napi::FunctionReference constructor;
|
||||||
|
// wrapped methods
|
||||||
|
};
|
||||||
@ -1,6 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "QtCore/QAbstractItemModel/qabstractitemmodel_wrap.h"
|
||||||
|
#include "QtCore/QItemSelectionModel/qitemselectionmodel_wrap.h"
|
||||||
#include "QtCore/QModelIndex/qmodelindex_wrap.h"
|
#include "QtCore/QModelIndex/qmodelindex_wrap.h"
|
||||||
|
#include "QtWidgets/QAbstractItemDelegate/qabstractitemdelegate_wrap.h"
|
||||||
#include "QtWidgets/QAbstractScrollArea/qabstractscrollarea_macro.h"
|
#include "QtWidgets/QAbstractScrollArea/qabstractscrollarea_macro.h"
|
||||||
#include "QtWidgets/QWidget/qwidget_wrap.h"
|
#include "QtWidgets/QWidget/qwidget_wrap.h"
|
||||||
|
|
||||||
@ -12,110 +15,353 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QABSTRACTITEMVIEW_WRAPPED_METHODS_DECLARATION
|
#ifndef QABSTRACTITEMVIEW_WRAPPED_METHODS_DECLARATION
|
||||||
#define QABSTRACTITEMVIEW_WRAPPED_METHODS_DECLARATION \
|
|
||||||
QABSTRACTSCROLLAREA_WRAPPED_METHODS_DECLARATION \
|
// This silly *WITHOUT_INDEXAT nonsense is for the benefit of QHeaderView and
|
||||||
Napi::Value setCurrentIndex(const Napi::CallbackInfo& info) { \
|
// its redefinition of `indexAt()` as protected(!) instead of plain public.
|
||||||
Napi::Env env = info.Env(); \
|
// *sigh*
|
||||||
Napi::HandleScope scope(env); \
|
#define QABSTRACTITEMVIEW_WRAPPED_METHODS_DECLARATION_NO_QHEADERVIEW_PROTECTED \
|
||||||
Napi::Object indexObject = info[0].As<Napi::Object>(); \
|
QABSTRACTSCROLLAREA_WRAPPED_METHODS_DECLARATION \
|
||||||
QModelIndexWrap* indexWrap = \
|
Napi::Value setCurrentIndex(const Napi::CallbackInfo& info) { \
|
||||||
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(indexObject); \
|
Napi::Env env = info.Env(); \
|
||||||
this->instance->setCurrentIndex(*indexWrap->getInternalInstance()); \
|
Napi::Object indexObject = info[0].As<Napi::Object>(); \
|
||||||
return env.Null(); \
|
QModelIndexWrap* indexWrap = \
|
||||||
} \
|
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(indexObject); \
|
||||||
Napi::Value currentIndex(const Napi::CallbackInfo& info) { \
|
this->instance->setCurrentIndex(*indexWrap->getInternalInstance()); \
|
||||||
Napi::Env env = info.Env(); \
|
return env.Null(); \
|
||||||
Napi::HandleScope scope(env); \
|
} \
|
||||||
QModelIndex current = this->instance->currentIndex(); \
|
Napi::Value currentIndex(const Napi::CallbackInfo& info) { \
|
||||||
auto instance = QModelIndexWrap::constructor.New( \
|
Napi::Env env = info.Env(); \
|
||||||
{Napi::External<QModelIndex>::New(env, new QModelIndex(current))}); \
|
QModelIndex current = this->instance->currentIndex(); \
|
||||||
return instance; \
|
auto instance = QModelIndexWrap::constructor.New( \
|
||||||
} \
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(current))}); \
|
||||||
Napi::Value setIndexWidget(const Napi::CallbackInfo& info) { \
|
return instance; \
|
||||||
Napi::Env env = info.Env(); \
|
} \
|
||||||
Napi::HandleScope scope(env); \
|
Napi::Value setIndexWidget(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Object indexObject = info[0].As<Napi::Object>(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::Object widgetObject = info[1].As<Napi::Object>(); \
|
Napi::Object indexObject = info[0].As<Napi::Object>(); \
|
||||||
QModelIndexWrap* indexWrap = \
|
Napi::Object widgetObject = info[1].As<Napi::Object>(); \
|
||||||
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(indexObject); \
|
QModelIndexWrap* indexWrap = \
|
||||||
NodeWidgetWrap* widgetWrap = \
|
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(indexObject); \
|
||||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(widgetObject); \
|
NodeWidgetWrap* widgetWrap = \
|
||||||
this->instance->setIndexWidget(*indexWrap->getInternalInstance(), \
|
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(widgetObject); \
|
||||||
widgetWrap->getInternalInstance()); \
|
this->instance->setIndexWidget(*indexWrap->getInternalInstance(), \
|
||||||
return env.Null(); \
|
widgetWrap->getInternalInstance()); \
|
||||||
} \
|
return env.Null(); \
|
||||||
Napi::Value indexWidget(const Napi::CallbackInfo& info) { \
|
} \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Value indexWidget(const Napi::CallbackInfo& info) { \
|
||||||
Napi::HandleScope scope(env); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::Object indexObject = info[0].As<Napi::Object>(); \
|
Napi::Object indexObject = info[0].As<Napi::Object>(); \
|
||||||
QModelIndexWrap* indexWrap = \
|
QModelIndexWrap* indexWrap = \
|
||||||
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(indexObject); \
|
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(indexObject); \
|
||||||
QWidget* widget = \
|
QWidget* widget = \
|
||||||
this->instance->indexWidget(*indexWrap->getInternalInstance()); \
|
this->instance->indexWidget(*indexWrap->getInternalInstance()); \
|
||||||
auto instance = QWidgetWrap::constructor.New( \
|
auto instance = QWidgetWrap::constructor.New( \
|
||||||
{Napi::External<QWidget>::New(env, widget), \
|
{Napi::External<QWidget>::New(env, widget), \
|
||||||
Napi::Boolean::New(env, true)}); \
|
Napi::Boolean::New(env, true)}); \
|
||||||
return instance; \
|
return instance; \
|
||||||
} \
|
} \
|
||||||
Napi::Value resetHorizontalScrollMode(const Napi::CallbackInfo& info) { \
|
Napi::Value resetHorizontalScrollMode(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
this->instance->resetHorizontalScrollMode(); \
|
||||||
this->instance->resetHorizontalScrollMode(); \
|
return env.Null(); \
|
||||||
return env.Null(); \
|
} \
|
||||||
} \
|
Napi::Value resetVerticalScrollMode(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Value resetVerticalScrollMode(const Napi::CallbackInfo& info) { \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::Env env = info.Env(); \
|
this->instance->resetVerticalScrollMode(); \
|
||||||
Napi::HandleScope scope(env); \
|
return env.Null(); \
|
||||||
this->instance->resetVerticalScrollMode(); \
|
} \
|
||||||
return env.Null(); \
|
Napi::Value rootIndex(const Napi::CallbackInfo& info) { \
|
||||||
} \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::Value rootIndex(const Napi::CallbackInfo& info) { \
|
QModelIndex root = this->instance->rootIndex(); \
|
||||||
Napi::Env env = info.Env(); \
|
auto instance = QModelIndexWrap::constructor.New( \
|
||||||
Napi::HandleScope scope(env); \
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(root))}); \
|
||||||
QModelIndex root = this->instance->rootIndex(); \
|
return instance; \
|
||||||
auto instance = QModelIndexWrap::constructor.New( \
|
} \
|
||||||
{Napi::External<QModelIndex>::New(env, new QModelIndex(root))}); \
|
Napi::Value scrollToBottom(const Napi::CallbackInfo& info) { \
|
||||||
return instance; \
|
Napi::Env env = info.Env(); \
|
||||||
} \
|
this->instance->scrollToBottom(); \
|
||||||
Napi::Value scrollToBottom(const Napi::CallbackInfo& info) { \
|
return env.Null(); \
|
||||||
Napi::Env env = info.Env(); \
|
} \
|
||||||
Napi::HandleScope scope(env); \
|
Napi::Value scrollToTop(const Napi::CallbackInfo& info) { \
|
||||||
this->instance->scrollToBottom(); \
|
Napi::Env env = info.Env(); \
|
||||||
return env.Null(); \
|
this->instance->scrollToTop(); \
|
||||||
} \
|
return env.Null(); \
|
||||||
Napi::Value scrollToTop(const Napi::CallbackInfo& info) { \
|
} \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Value setModel(const Napi::CallbackInfo& info) { \
|
||||||
Napi::HandleScope scope(env); \
|
Napi::Env env = info.Env(); \
|
||||||
this->instance->scrollToTop(); \
|
Napi::Object modelObject = info[0].As<Napi::Object>(); \
|
||||||
return env.Null(); \
|
QAbstractItemModelWrap* modelWrap = \
|
||||||
|
Napi::ObjectWrap<QAbstractItemModelWrap>::Unwrap(modelObject); \
|
||||||
|
QAbstractItemView* instance = this->instance; \
|
||||||
|
instance->setModel(modelWrap->getInternalInstance()); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value closePersistentEditor(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QModelIndexWrap* indexWrap = \
|
||||||
|
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(info[0].As<Napi::Object>()); \
|
||||||
|
QModelIndex* index = indexWrap->getInternalInstance(); \
|
||||||
|
this->instance->QAbstractItemView::closePersistentEditor(*index); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value clearSelection(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
this->instance->clearSelection(); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value edit(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QModelIndexWrap* indexWrap = \
|
||||||
|
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(info[0].As<Napi::Object>()); \
|
||||||
|
QModelIndex* index = indexWrap->getInternalInstance(); \
|
||||||
|
this->instance->edit(*index); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value reset(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
this->instance->reset(); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value selectAll(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
this->instance->selectAll(); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value setRootIndex(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QModelIndexWrap* indexWrap = \
|
||||||
|
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(info[0].As<Napi::Object>()); \
|
||||||
|
QModelIndex* index = indexWrap->getInternalInstance(); \
|
||||||
|
this->instance->setRootIndex(*index); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value update_QModelIndex(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QModelIndexWrap* indexWrap = \
|
||||||
|
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(info[0].As<Napi::Object>()); \
|
||||||
|
QModelIndex* index = indexWrap->getInternalInstance(); \
|
||||||
|
this->instance->update(*index); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value selectionModel(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QItemSelectionModel* model = this->instance->selectionModel(); \
|
||||||
|
return WrapperCache::instance.getWrapper(env, model); \
|
||||||
|
} \
|
||||||
|
Napi::Value isPersistentEditorOpen(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QModelIndexWrap* indexWrap = \
|
||||||
|
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(info[0].As<Napi::Object>()); \
|
||||||
|
QModelIndex* index = indexWrap->getInternalInstance(); \
|
||||||
|
bool result = this->instance->isPersistentEditorOpen(*index); \
|
||||||
|
return Napi::Boolean::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value openPersistentEditor(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QModelIndexWrap* indexWrap = \
|
||||||
|
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(info[0].As<Napi::Object>()); \
|
||||||
|
QModelIndex* index = indexWrap->getInternalInstance(); \
|
||||||
|
this->instance->QAbstractItemView::openPersistentEditor(*index); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value keyboardSearch(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
std::string searchNapiText = info[0].As<Napi::String>().Utf8Value(); \
|
||||||
|
QString search = QString::fromUtf8(searchNapiText.c_str()); \
|
||||||
|
this->instance->keyboardSearch(search); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value setItemDelegate(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
if (info[0].IsNull()) { \
|
||||||
|
this->instance->setItemDelegate(nullptr); \
|
||||||
|
} else { \
|
||||||
|
QAbstractItemDelegateWrap* delegateWrap = \
|
||||||
|
Napi::ObjectWrap<QAbstractItemDelegateWrap>::Unwrap( \
|
||||||
|
info[0].As<Napi::Object>()); \
|
||||||
|
QAbstractItemDelegate* delegate = delegateWrap->getInternalInstance(); \
|
||||||
|
this->instance->setItemDelegate(delegate); \
|
||||||
|
} \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value setItemDelegateForColumn(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int column = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
|
if (info[1].IsNull()) { \
|
||||||
|
this->instance->setItemDelegateForColumn(column, nullptr); \
|
||||||
|
} else { \
|
||||||
|
QAbstractItemDelegateWrap* delegateWrap = \
|
||||||
|
Napi::ObjectWrap<QAbstractItemDelegateWrap>::Unwrap( \
|
||||||
|
info[1].As<Napi::Object>()); \
|
||||||
|
QAbstractItemDelegate* delegate = delegateWrap->getInternalInstance(); \
|
||||||
|
this->instance->setItemDelegateForColumn(column, delegate); \
|
||||||
|
} \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value setItemDelegateForRow(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int row = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
|
if (info[1].IsNull()) { \
|
||||||
|
this->instance->setItemDelegateForRow(row, nullptr); \
|
||||||
|
} else { \
|
||||||
|
QAbstractItemDelegateWrap* delegateWrap = \
|
||||||
|
Napi::ObjectWrap<QAbstractItemDelegateWrap>::Unwrap( \
|
||||||
|
info[1].As<Napi::Object>()); \
|
||||||
|
QAbstractItemDelegate* delegate = delegateWrap->getInternalInstance(); \
|
||||||
|
this->instance->setItemDelegateForRow(row, delegate); \
|
||||||
|
} \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value sizeHintForIndex(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QModelIndexWrap* indexWrap = \
|
||||||
|
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(info[0].As<Napi::Object>()); \
|
||||||
|
QModelIndex* index = indexWrap->getInternalInstance(); \
|
||||||
|
QSize result = this->instance->sizeHintForIndex(*index); \
|
||||||
|
auto resultInstance = QSizeWrap::constructor.New( \
|
||||||
|
{Napi::External<QSize>::New(env, new QSize(result))}); \
|
||||||
|
return resultInstance; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define QABSTRACTITEMVIEW_WRAPPED_METHODS_DECLARATION \
|
||||||
|
QABSTRACTITEMVIEW_WRAPPED_METHODS_DECLARATION_NO_QHEADERVIEW_PROTECTED \
|
||||||
|
Napi::Value indexAt(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QPointWrap* pointWrap = \
|
||||||
|
Napi::ObjectWrap<QPointWrap>::Unwrap(info[0].As<Napi::Object>()); \
|
||||||
|
QPoint* point = pointWrap->getInternalInstance(); \
|
||||||
|
QModelIndex result = this->instance->indexAt(*point); \
|
||||||
|
auto resultInstance = QModelIndexWrap::constructor.New( \
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(result))}); \
|
||||||
|
return resultInstance; \
|
||||||
|
} \
|
||||||
|
Napi::Value scrollTo(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QModelIndexWrap* indexWrap = \
|
||||||
|
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(info[0].As<Napi::Object>()); \
|
||||||
|
QModelIndex* index = indexWrap->getInternalInstance(); \
|
||||||
|
QAbstractItemView::ScrollHint hint = \
|
||||||
|
static_cast<QAbstractItemView::ScrollHint>( \
|
||||||
|
info[1].As<Napi::Number>().Int32Value()); \
|
||||||
|
this->instance->scrollTo(*index, hint); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value visualRect(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QModelIndexWrap* indexWrap = \
|
||||||
|
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(info[0].As<Napi::Object>()); \
|
||||||
|
QModelIndex* index = indexWrap->getInternalInstance(); \
|
||||||
|
QRect ret = this->instance->visualRect(*index); \
|
||||||
|
auto instance = QRectWrap::constructor.New( \
|
||||||
|
{Napi::External<QRect>::New(env, new QRect(ret))}); \
|
||||||
|
return instance; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QABSTRACTITEMVIEW_WRAPPED_METHODS_DECLARATION
|
#endif // QABSTRACTITEMVIEW_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
#ifndef QABSTRACTITEMVIEW_WRAPPED_METHODS_EXPORT_DEFINE
|
#ifndef QABSTRACTITEMVIEW_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
#define QABSTRACTITEMVIEW_WRAPPED_METHODS_EXPORT_DEFINE(WidgetWrapName) \
|
#define QABSTRACTITEMVIEW_WRAPPED_METHODS_EXPORT_DEFINE(WidgetWrapName) \
|
||||||
QABSTRACTSCROLLAREA_WRAPPED_METHODS_EXPORT_DEFINE(WidgetWrapName) \
|
QABSTRACTSCROLLAREA_WRAPPED_METHODS_EXPORT_DEFINE(WidgetWrapName) \
|
||||||
InstanceMethod("setCurrentIndex", &WidgetWrapName::setCurrentIndex), \
|
InstanceMethod("setCurrentIndex", &WidgetWrapName::setCurrentIndex), \
|
||||||
InstanceMethod("currentIndex", &WidgetWrapName::currentIndex), \
|
InstanceMethod("currentIndex", &WidgetWrapName::currentIndex), \
|
||||||
InstanceMethod("setIndexWidget", &WidgetWrapName::setIndexWidget), \
|
InstanceMethod("setIndexWidget", &WidgetWrapName::setIndexWidget), \
|
||||||
InstanceMethod("indexWidget", &WidgetWrapName::indexWidget), \
|
InstanceMethod("indexWidget", &WidgetWrapName::indexWidget), \
|
||||||
InstanceMethod("resetHorizontalScrollMode", \
|
InstanceMethod("resetHorizontalScrollMode", \
|
||||||
&WidgetWrapName::resetHorizontalScrollMode), \
|
&WidgetWrapName::resetHorizontalScrollMode), \
|
||||||
InstanceMethod("resetVerticalScrollMode", \
|
InstanceMethod("resetVerticalScrollMode", \
|
||||||
&WidgetWrapName::resetVerticalScrollMode), \
|
&WidgetWrapName::resetVerticalScrollMode), \
|
||||||
InstanceMethod("rootIndex", &WidgetWrapName::rootIndex), \
|
InstanceMethod("rootIndex", &WidgetWrapName::rootIndex), \
|
||||||
InstanceMethod("scrollToBottom", &WidgetWrapName::scrollToBottom), \
|
InstanceMethod("scrollToBottom", &WidgetWrapName::scrollToBottom), \
|
||||||
InstanceMethod("scrollToTop", &WidgetWrapName::scrollToTop),
|
InstanceMethod("scrollToTop", &WidgetWrapName::scrollToTop), \
|
||||||
|
InstanceMethod("setModel", &WidgetWrapName::setModel), \
|
||||||
|
InstanceMethod("closePersistentEditor", \
|
||||||
|
&WidgetWrapName::closePersistentEditor), \
|
||||||
|
InstanceMethod("clearSelection", &WidgetWrapName::clearSelection), \
|
||||||
|
InstanceMethod("edit", &WidgetWrapName::edit), \
|
||||||
|
InstanceMethod("reset", &WidgetWrapName::reset), \
|
||||||
|
InstanceMethod("selectAll", &WidgetWrapName::selectAll), \
|
||||||
|
InstanceMethod("setRootIndex", &WidgetWrapName::setRootIndex), \
|
||||||
|
InstanceMethod("update_QModelIndex", \
|
||||||
|
&WidgetWrapName::update_QModelIndex), \
|
||||||
|
InstanceMethod("indexAt", &WidgetWrapName::indexAt), \
|
||||||
|
InstanceMethod("selectionModel", &WidgetWrapName::selectionModel), \
|
||||||
|
InstanceMethod("scrollTo", &WidgetWrapName::scrollTo), \
|
||||||
|
InstanceMethod("isPersistentEditorOpen", \
|
||||||
|
&WidgetWrapName::isPersistentEditorOpen), \
|
||||||
|
InstanceMethod("openPersistentEditor", \
|
||||||
|
&WidgetWrapName::openPersistentEditor), \
|
||||||
|
InstanceMethod("keyboardSearch", &WidgetWrapName::keyboardSearch), \
|
||||||
|
InstanceMethod("setItemDelegate", &WidgetWrapName::setItemDelegate), \
|
||||||
|
InstanceMethod("setItemDelegateForColumn", \
|
||||||
|
&WidgetWrapName::setItemDelegateForColumn), \
|
||||||
|
InstanceMethod("setItemDelegateForRow", \
|
||||||
|
&WidgetWrapName::setItemDelegateForRow), \
|
||||||
|
InstanceMethod("visualRect", &WidgetWrapName::visualRect), \
|
||||||
|
InstanceMethod("sizeHintForIndex", &WidgetWrapName::sizeHintForIndex),
|
||||||
|
|
||||||
#endif // QABSTRACTITEMVIEW_WRAPPED_METHODS_EXPORT_DEFINE
|
#endif // QABSTRACTITEMVIEW_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
|
|
||||||
#ifndef QABSTRACTITEMVIEW_SIGNALS
|
#ifndef QABSTRACTITEMVIEW_SIGNALS
|
||||||
#define QABSTRACTITEMVIEW_SIGNALS \
|
#define QABSTRACTITEMVIEW_SIGNALS \
|
||||||
QABSTRACTSCROLLAREA_SIGNALS \
|
QABSTRACTSCROLLAREA_SIGNALS \
|
||||||
QObject::connect(this, &QAbstractItemView::viewportEntered, [=]() { \
|
QObject::connect( \
|
||||||
Napi::Env env = this->emitOnNode.Env(); \
|
this, &QAbstractItemView::activated, [=](const QModelIndex& index) { \
|
||||||
Napi::HandleScope scope(env); \
|
Napi::Env env = this->emitOnNode.Env(); \
|
||||||
this->emitOnNode.Call({Napi::String::New(env, "viewportEntered")}); \
|
Napi::HandleScope scope(env); \
|
||||||
|
auto indexInstance = QModelIndexWrap::constructor.New( \
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(index))}); \
|
||||||
|
this->emitOnNode.Call( \
|
||||||
|
{Napi::String::New(env, "activated"), indexInstance}); \
|
||||||
|
}); \
|
||||||
|
QObject::connect( \
|
||||||
|
this, &QAbstractItemView::clicked, [=](const QModelIndex& index) { \
|
||||||
|
Napi::Env env = this->emitOnNode.Env(); \
|
||||||
|
Napi::HandleScope scope(env); \
|
||||||
|
auto indexInstance = QModelIndexWrap::constructor.New( \
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(index))}); \
|
||||||
|
this->emitOnNode.Call( \
|
||||||
|
{Napi::String::New(env, "clicked"), indexInstance}); \
|
||||||
|
}); \
|
||||||
|
QObject::connect( \
|
||||||
|
this, &QAbstractItemView::doubleClicked, [=](const QModelIndex& index) { \
|
||||||
|
Napi::Env env = this->emitOnNode.Env(); \
|
||||||
|
Napi::HandleScope scope(env); \
|
||||||
|
auto indexInstance = QModelIndexWrap::constructor.New( \
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(index))}); \
|
||||||
|
this->emitOnNode.Call( \
|
||||||
|
{Napi::String::New(env, "doubleClicked"), indexInstance}); \
|
||||||
|
}); \
|
||||||
|
QObject::connect( \
|
||||||
|
this, &QAbstractItemView::entered, [=](const QModelIndex& index) { \
|
||||||
|
Napi::Env env = this->emitOnNode.Env(); \
|
||||||
|
Napi::HandleScope scope(env); \
|
||||||
|
auto indexInstance = QModelIndexWrap::constructor.New( \
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(index))}); \
|
||||||
|
this->emitOnNode.Call( \
|
||||||
|
{Napi::String::New(env, "entered"), indexInstance}); \
|
||||||
|
}); \
|
||||||
|
QObject::connect( \
|
||||||
|
this, &QAbstractItemView::iconSizeChanged, [=](const QSize& size) { \
|
||||||
|
Napi::Env env = this->emitOnNode.Env(); \
|
||||||
|
Napi::HandleScope scope(env); \
|
||||||
|
auto sizeInstance = QSizeWrap::constructor.New( \
|
||||||
|
{Napi::External<QSize>::New(env, new QSize(size))}); \
|
||||||
|
this->emitOnNode.Call( \
|
||||||
|
{Napi::String::New(env, "iconSizeChanged"), sizeInstance}); \
|
||||||
|
}); \
|
||||||
|
QObject::connect( \
|
||||||
|
this, &QAbstractItemView::pressed, [=](const QModelIndex& index) { \
|
||||||
|
Napi::Env env = this->emitOnNode.Env(); \
|
||||||
|
Napi::HandleScope scope(env); \
|
||||||
|
auto indexInstance = QModelIndexWrap::constructor.New( \
|
||||||
|
{Napi::External<QModelIndex>::New(env, new QModelIndex(index))}); \
|
||||||
|
this->emitOnNode.Call( \
|
||||||
|
{Napi::String::New(env, "pressed"), indexInstance}); \
|
||||||
|
}); \
|
||||||
|
QObject::connect(this, &QAbstractItemView::viewportEntered, [=]() { \
|
||||||
|
Napi::Env env = this->emitOnNode.Env(); \
|
||||||
|
Napi::HandleScope scope(env); \
|
||||||
|
this->emitOnNode.Call({Napi::String::New(env, "viewportEntered")}); \
|
||||||
});
|
});
|
||||||
|
|
||||||
#endif // QABSTRACTITEMVIEW_SIGNALS
|
#endif // QABSTRACTITEMVIEW_SIGNALS
|
||||||
|
|||||||
@ -19,7 +19,6 @@
|
|||||||
\
|
\
|
||||||
Napi::Value maximumViewportSize(const Napi::CallbackInfo& info) { \
|
Napi::Value maximumViewportSize(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
QSize size = this->instance->maximumViewportSize(); \
|
QSize size = this->instance->maximumViewportSize(); \
|
||||||
auto instance = QSizeWrap::constructor.New( \
|
auto instance = QSizeWrap::constructor.New( \
|
||||||
{Napi::External<QSize>::New(env, new QSize(size))}); \
|
{Napi::External<QSize>::New(env, new QSize(size))}); \
|
||||||
@ -28,7 +27,6 @@
|
|||||||
\
|
\
|
||||||
Napi::Value setHorizontalScrollBar(const Napi::CallbackInfo& info) { \
|
Napi::Value setHorizontalScrollBar(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
Napi::Object scrollBarObject = info[0].As<Napi::Object>(); \
|
Napi::Object scrollBarObject = info[0].As<Napi::Object>(); \
|
||||||
QScrollBarWrap* scrollBarWrap = \
|
QScrollBarWrap* scrollBarWrap = \
|
||||||
Napi::ObjectWrap<QScrollBarWrap>::Unwrap(scrollBarObject); \
|
Napi::ObjectWrap<QScrollBarWrap>::Unwrap(scrollBarObject); \
|
||||||
@ -39,7 +37,6 @@
|
|||||||
\
|
\
|
||||||
Napi::Value setVerticalScrollBar(const Napi::CallbackInfo& info) { \
|
Napi::Value setVerticalScrollBar(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
Napi::Object scrollBarObject = info[0].As<Napi::Object>(); \
|
Napi::Object scrollBarObject = info[0].As<Napi::Object>(); \
|
||||||
QScrollBarWrap* scrollBarWrap = \
|
QScrollBarWrap* scrollBarWrap = \
|
||||||
Napi::ObjectWrap<QScrollBarWrap>::Unwrap(scrollBarObject); \
|
Napi::ObjectWrap<QScrollBarWrap>::Unwrap(scrollBarObject); \
|
||||||
@ -50,7 +47,6 @@
|
|||||||
\
|
\
|
||||||
Napi::Value setViewport(const Napi::CallbackInfo& info) { \
|
Napi::Value setViewport(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
Napi::Object viewPortObject = info[0].As<Napi::Object>(); \
|
Napi::Object viewPortObject = info[0].As<Napi::Object>(); \
|
||||||
NodeWidgetWrap* viewPortWidgetWrap = \
|
NodeWidgetWrap* viewPortWidgetWrap = \
|
||||||
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(viewPortObject); \
|
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(viewPortObject); \
|
||||||
@ -61,11 +57,22 @@
|
|||||||
\
|
\
|
||||||
Napi::Value viewport(const Napi::CallbackInfo& info) { \
|
Napi::Value viewport(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
QWidget* viewPort = this->instance->viewport(); \
|
QWidget* viewPort = this->instance->viewport(); \
|
||||||
NWidget* nviewPort = reinterpret_cast<NWidget*>(viewPort); \
|
auto instance = WrapperCache::instance.getWrapper(env, viewPort); \
|
||||||
auto instance = QWidgetWrap::constructor.New( \
|
return instance; \
|
||||||
{Napi::External<NWidget>::New(env, nviewPort)}); \
|
} \
|
||||||
|
\
|
||||||
|
Napi::Value horizontalScrollBar(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QScrollBar* scrollBar = this->instance->horizontalScrollBar(); \
|
||||||
|
auto instance = WrapperCache::instance.getWrapper(env, scrollBar); \
|
||||||
|
return instance; \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
Napi::Value verticalScrollBar(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QScrollBar* scrollBar = this->instance->verticalScrollBar(); \
|
||||||
|
auto instance = WrapperCache::instance.getWrapper(env, scrollBar); \
|
||||||
return instance; \
|
return instance; \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +89,10 @@
|
|||||||
InstanceMethod("setVerticalScrollBar", \
|
InstanceMethod("setVerticalScrollBar", \
|
||||||
&WidgetWrapName::setVerticalScrollBar), \
|
&WidgetWrapName::setVerticalScrollBar), \
|
||||||
InstanceMethod("setViewport", &WidgetWrapName::setViewport), \
|
InstanceMethod("setViewport", &WidgetWrapName::setViewport), \
|
||||||
InstanceMethod("viewport", &WidgetWrapName::viewport),
|
InstanceMethod("viewport", &WidgetWrapName::viewport), \
|
||||||
|
InstanceMethod("horizontalScrollBar", \
|
||||||
|
&WidgetWrapName::horizontalScrollBar), \
|
||||||
|
InstanceMethod("verticalScrollBar", &WidgetWrapName::verticalScrollBar),
|
||||||
|
|
||||||
#endif // QABSTRACTSCROLLAREA_WRAPPED_METHODS_EXPORT_DEFINE
|
#endif // QABSTRACTSCROLLAREA_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
QWIDGET_WRAPPED_METHODS_DECLARATION \
|
QWIDGET_WRAPPED_METHODS_DECLARATION \
|
||||||
Napi::Value triggerAction(const Napi::CallbackInfo& info) { \
|
Napi::Value triggerAction(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
int action = info[0].As<Napi::Number>().Int32Value(); \
|
int action = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
this->instance->triggerAction( \
|
this->instance->triggerAction( \
|
||||||
static_cast<QAbstractSlider::SliderAction>(action)); \
|
static_cast<QAbstractSlider::SliderAction>(action)); \
|
||||||
@ -22,7 +21,6 @@
|
|||||||
} \
|
} \
|
||||||
Napi::Value setRange(const Napi::CallbackInfo& info) { \
|
Napi::Value setRange(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
int min = info[0].As<Napi::Number>().Int32Value(); \
|
int min = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
int max = info[1].As<Napi::Number>().Int32Value(); \
|
int max = info[1].As<Napi::Number>().Int32Value(); \
|
||||||
this->instance->setRange(min, max); \
|
this->instance->setRange(min, max); \
|
||||||
|
|||||||
@ -15,19 +15,16 @@
|
|||||||
QWIDGET_WRAPPED_METHODS_DECLARATION \
|
QWIDGET_WRAPPED_METHODS_DECLARATION \
|
||||||
Napi::Value selectAll(const Napi::CallbackInfo& info) { \
|
Napi::Value selectAll(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
this->instance->selectAll(); \
|
this->instance->selectAll(); \
|
||||||
return env.Null(); \
|
return env.Null(); \
|
||||||
} \
|
} \
|
||||||
Napi::Value stepDown(const Napi::CallbackInfo& info) { \
|
Napi::Value stepDown(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
this->instance->stepDown(); \
|
this->instance->stepDown(); \
|
||||||
return env.Null(); \
|
return env.Null(); \
|
||||||
} \
|
} \
|
||||||
Napi::Value stepUp(const Napi::CallbackInfo& info) { \
|
Napi::Value stepUp(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
this->instance->stepUp(); \
|
this->instance->stepUp(); \
|
||||||
return env.Null(); \
|
return env.Null(); \
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@ class DLL_EXPORT NAction : public QAction, public EventWidget {
|
|||||||
EVENTWIDGET_IMPLEMENTATIONS(QAction)
|
EVENTWIDGET_IMPLEMENTATIONS(QAction)
|
||||||
public:
|
public:
|
||||||
using QAction::QAction; // inherit all constructors of QAction
|
using QAction::QAction; // inherit all constructors of QAction
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
QOBJECT_SIGNALS
|
QOBJECT_SIGNALS
|
||||||
QObject::connect(this, &QAction::triggered, [=](bool checked) {
|
QObject::connect(this, &QAction::triggered, [=](bool checked) {
|
||||||
|
|||||||
@ -11,14 +11,13 @@ class DLL_EXPORT QActionWrap : public Napi::ObjectWrap<QActionWrap> {
|
|||||||
QOBJECT_WRAPPED_METHODS_DECLARATION
|
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<NAction> instance;
|
QPointer<QAction> instance;
|
||||||
bool disableDeletion;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QActionWrap(const Napi::CallbackInfo& info);
|
QActionWrap(const Napi::CallbackInfo& info);
|
||||||
~QActionWrap();
|
~QActionWrap();
|
||||||
NAction* getInternalInstance();
|
QAction* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -10,5 +10,5 @@ class DLL_EXPORT NBoxLayout : public QBoxLayout, public EventWidget {
|
|||||||
public:
|
public:
|
||||||
EVENTWIDGET_IMPLEMENTATIONS(QBoxLayout)
|
EVENTWIDGET_IMPLEMENTATIONS(QBoxLayout)
|
||||||
using QBoxLayout::QBoxLayout;
|
using QBoxLayout::QBoxLayout;
|
||||||
void connectSignalsToEventEmitter() { QLAYOUT_SIGNALS }
|
virtual void connectSignalsToEventEmitter() { QLAYOUT_SIGNALS }
|
||||||
};
|
};
|
||||||
|
|||||||
@ -12,13 +12,13 @@
|
|||||||
class DLL_EXPORT QBoxLayoutWrap : public Napi::ObjectWrap<QBoxLayoutWrap> {
|
class DLL_EXPORT QBoxLayoutWrap : public Napi::ObjectWrap<QBoxLayoutWrap> {
|
||||||
QLAYOUT_WRAPPED_METHODS_DECLARATION
|
QLAYOUT_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NBoxLayout> instance;
|
QPointer<QBoxLayout> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QBoxLayoutWrap(const Napi::CallbackInfo& info);
|
QBoxLayoutWrap(const Napi::CallbackInfo& info);
|
||||||
~QBoxLayoutWrap();
|
~QBoxLayoutWrap();
|
||||||
NBoxLayout* getInternalInstance();
|
QBoxLayout* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -12,15 +12,33 @@ class DLL_EXPORT NButtonGroup : public QButtonGroup, public EventWidget {
|
|||||||
EVENTWIDGET_IMPLEMENTATIONS(QButtonGroup)
|
EVENTWIDGET_IMPLEMENTATIONS(QButtonGroup)
|
||||||
public:
|
public:
|
||||||
using QButtonGroup::QButtonGroup; // inherit all constructors of QButtonGroup
|
using QButtonGroup::QButtonGroup; // inherit all constructors of QButtonGroup
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
QOBJECT_SIGNALS
|
QOBJECT_SIGNALS
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
connect(this, QOverload<int>::of(&QButtonGroup::buttonClicked),
|
connect(this, &QButtonGroup::idClicked, [=](int id) {
|
||||||
[=](int id) {
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
Napi::Env env = this->emitOnNode.Env();
|
Napi::HandleScope scope(env);
|
||||||
Napi::HandleScope scope(env);
|
this->emitOnNode.Call(
|
||||||
this->emitOnNode.Call({Napi::String::New(env, "buttonClicked"),
|
{Napi::String::New(env, "idClicked"), Napi::Number::New(env, id)});
|
||||||
Napi::Number::New(env, id)});
|
});
|
||||||
});
|
connect(this, &QButtonGroup::idPressed, [=](int id) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call(
|
||||||
|
{Napi::String::New(env, "idPressed"), Napi::Number::New(env, id)});
|
||||||
|
});
|
||||||
|
connect(this, &QButtonGroup::idReleased, [=](int id) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call(
|
||||||
|
{Napi::String::New(env, "idReleased"), Napi::Number::New(env, id)});
|
||||||
|
});
|
||||||
|
connect(this, &QButtonGroup::idToggled, [=](int id, bool checked) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call({Napi::String::New(env, "idToggled"),
|
||||||
|
Napi::Number::New(env, id),
|
||||||
|
Napi::Boolean::New(env, checked)});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -9,13 +9,13 @@
|
|||||||
#include "nbuttongroup.hpp"
|
#include "nbuttongroup.hpp"
|
||||||
class DLL_EXPORT QButtonGroupWrap : public Napi::ObjectWrap<QButtonGroupWrap> {
|
class DLL_EXPORT QButtonGroupWrap : public Napi::ObjectWrap<QButtonGroupWrap> {
|
||||||
private:
|
private:
|
||||||
QPointer<NButtonGroup> instance;
|
QPointer<QButtonGroup> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QButtonGroupWrap(const Napi::CallbackInfo& info);
|
QButtonGroupWrap(const Napi::CallbackInfo& info);
|
||||||
~QButtonGroupWrap();
|
~QButtonGroupWrap();
|
||||||
NButtonGroup* getInternalInstance();
|
QButtonGroup* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class DLL_EXPORT NCalendarWidget : public QCalendarWidget, public NodeWidget {
|
|||||||
// inherit all constructors of QCalendarWidget
|
// inherit all constructors of QCalendarWidget
|
||||||
using QCalendarWidget::QCalendarWidget;
|
using QCalendarWidget::QCalendarWidget;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
QWIDGET_SIGNALS
|
QWIDGET_SIGNALS
|
||||||
QObject::connect(this, &QCalendarWidget::activated, [=](const QDate &date) {
|
QObject::connect(this, &QCalendarWidget::activated, [=](const QDate &date) {
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QCalendarWidgetWrap
|
class DLL_EXPORT QCalendarWidgetWrap
|
||||||
: public Napi::ObjectWrap<QCalendarWidgetWrap> {
|
: public Napi::ObjectWrap<QCalendarWidgetWrap> {
|
||||||
private:
|
private:
|
||||||
QPointer<NCalendarWidget> instance;
|
QPointer<QCalendarWidget> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QCalendarWidgetWrap(const Napi::CallbackInfo &info);
|
QCalendarWidgetWrap(const Napi::CallbackInfo &info);
|
||||||
~QCalendarWidgetWrap();
|
~QCalendarWidgetWrap();
|
||||||
NCalendarWidget *getInternalInstance();
|
QCalendarWidget *getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class DLL_EXPORT NCheckBox : public QCheckBox, public NodeWidget {
|
|||||||
public:
|
public:
|
||||||
using QCheckBox::QCheckBox; // inherit all constructors of QCheckBox
|
using QCheckBox::QCheckBox; // inherit all constructors of QCheckBox
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
QABSTRACT_BUTTON_SIGNALS
|
QABSTRACT_BUTTON_SIGNALS
|
||||||
QObject::connect(this, &QCheckBox::stateChanged, [=](int state) {
|
QObject::connect(this, &QCheckBox::stateChanged, [=](int state) {
|
||||||
Napi::Env env = this->emitOnNode.Env();
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
|||||||
@ -12,14 +12,13 @@
|
|||||||
class DLL_EXPORT QCheckBoxWrap : public Napi::ObjectWrap<QCheckBoxWrap> {
|
class DLL_EXPORT QCheckBoxWrap : public Napi::ObjectWrap<QCheckBoxWrap> {
|
||||||
QABSTRACTBUTTON_WRAPPED_METHODS_DECLARATION
|
QABSTRACTBUTTON_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NCheckBox> instance;
|
QPointer<QCheckBox> instance;
|
||||||
bool disableDeletion;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QCheckBoxWrap(const Napi::CallbackInfo& info);
|
QCheckBoxWrap(const Napi::CallbackInfo& info);
|
||||||
~QCheckBoxWrap();
|
~QCheckBoxWrap();
|
||||||
NCheckBox* getInternalInstance();
|
QCheckBox* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class DLL_EXPORT NColorDialog : public QColorDialog, public NodeWidget {
|
|||||||
public:
|
public:
|
||||||
using QColorDialog::QColorDialog;
|
using QColorDialog::QColorDialog;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
QDIALOG_SIGNALS
|
QDIALOG_SIGNALS
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
|
|||||||
@ -9,21 +9,23 @@
|
|||||||
#include "QtWidgets/QDialog/qdialog_macro.h"
|
#include "QtWidgets/QDialog/qdialog_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QColorDialogWrap : public Napi::ObjectWrap<QColorDialogWrap> {
|
class DLL_EXPORT QColorDialogWrap : public Napi::ObjectWrap<QColorDialogWrap> {
|
||||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
QDIALOG_WRAPPED_METHODS_DECLARATION_NO_ACCEPT_OR_DONE
|
||||||
private:
|
private:
|
||||||
QPointer<NColorDialog> instance;
|
QPointer<QColorDialog> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QColorDialogWrap(const Napi::CallbackInfo& info);
|
QColorDialogWrap(const Napi::CallbackInfo& info);
|
||||||
~QColorDialogWrap();
|
~QColorDialogWrap();
|
||||||
NColorDialog* getInternalInstance();
|
QColorDialog* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value selectedColor(const Napi::CallbackInfo& info);
|
Napi::Value selectedColor(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setOption(const Napi::CallbackInfo& info);
|
Napi::Value setOption(const Napi::CallbackInfo& info);
|
||||||
Napi::Value testOption(const Napi::CallbackInfo& info);
|
Napi::Value testOption(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value accept(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value done(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace StaticQColorDialogWrapMethods {
|
namespace StaticQColorDialogWrapMethods {
|
||||||
|
|||||||
@ -12,9 +12,16 @@ class DLL_EXPORT NComboBox : public QComboBox, public NodeWidget {
|
|||||||
NODEWIDGET_IMPLEMENTATIONS(QComboBox)
|
NODEWIDGET_IMPLEMENTATIONS(QComboBox)
|
||||||
using QComboBox::QComboBox;
|
using QComboBox::QComboBox;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
QWIDGET_SIGNALS
|
QWIDGET_SIGNALS
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
|
QObject::connect(
|
||||||
|
this, QOverload<int>::of(&QComboBox::activated), [=](int index) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call({Napi::String::New(env, "activated"),
|
||||||
|
Napi::Number::From(env, index)});
|
||||||
|
});
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
this, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
this, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
[=](int index) {
|
[=](int index) {
|
||||||
@ -38,5 +45,25 @@ class DLL_EXPORT NComboBox : public QComboBox, public NodeWidget {
|
|||||||
this->emitOnNode.Call({Napi::String::New(env, "editTextChanged"),
|
this->emitOnNode.Call({Napi::String::New(env, "editTextChanged"),
|
||||||
Napi::String::New(env, text.toStdString())});
|
Napi::String::New(env, text.toStdString())});
|
||||||
});
|
});
|
||||||
|
QObject::connect(
|
||||||
|
this, QOverload<int>::of(&QComboBox::highlighted), [=](int index) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call({Napi::String::New(env, "highlighted"),
|
||||||
|
Napi::Number::From(env, index)});
|
||||||
|
});
|
||||||
|
QObject::connect(this, &QComboBox::textActivated, [=](const QString &text) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call({Napi::String::New(env, "textActivated"),
|
||||||
|
Napi::String::New(env, text.toStdString())});
|
||||||
|
});
|
||||||
|
QObject::connect(
|
||||||
|
this, &QComboBox::textHighlighted, [=](const QString &text) {
|
||||||
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
|
Napi::HandleScope scope(env);
|
||||||
|
this->emitOnNode.Call({Napi::String::New(env, "textHighlighted"),
|
||||||
|
Napi::String::New(env, text.toStdString())});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QComboBoxWrap : public Napi::ObjectWrap<QComboBoxWrap> {
|
class DLL_EXPORT QComboBoxWrap : public Napi::ObjectWrap<QComboBoxWrap> {
|
||||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NComboBox> instance;
|
QPointer<QComboBox> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QComboBoxWrap(const Napi::CallbackInfo& info);
|
QComboBoxWrap(const Napi::CallbackInfo& info);
|
||||||
~QComboBoxWrap();
|
~QComboBoxWrap();
|
||||||
NComboBox* getInternalInstance();
|
QComboBox* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
@ -40,4 +40,25 @@ class DLL_EXPORT QComboBoxWrap : public Napi::ObjectWrap<QComboBoxWrap> {
|
|||||||
Napi::Value clear(const Napi::CallbackInfo& info);
|
Napi::Value clear(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setModel(const Napi::CallbackInfo& info);
|
Napi::Value setModel(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setEditText(const Napi::CallbackInfo& info);
|
Napi::Value setEditText(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value count(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value duplicatesEnabled(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value hasFrame(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value hidePopup(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value iconSize(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value maxCount(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value minimumContentsLength(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value modelColumn(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value rootModelIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setDuplicatesEnabled(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setMinimumContentsLength(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setModelColumn(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setRootModelIndex(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value clearEditText(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setFrame(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setItemText(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setMaxCount(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value showPopup(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value insertPolicy(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setInsertPolicy(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setIconSize(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class DLL_EXPORT NDateEdit : public QDateEdit, public NodeWidget {
|
|||||||
// inherit all constructors of QDateEdit
|
// inherit all constructors of QDateEdit
|
||||||
using QDateEdit::QDateEdit;
|
using QDateEdit::QDateEdit;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
QDATETIMEEDIT_SIGNALS
|
QDATETIMEEDIT_SIGNALS
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QDateEditWrap : public Napi::ObjectWrap<QDateEditWrap> {
|
class DLL_EXPORT QDateEditWrap : public Napi::ObjectWrap<QDateEditWrap> {
|
||||||
QDATETIMEEDIT_WRAPPED_METHODS_DECLARATION
|
QDATETIMEEDIT_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NDateEdit> instance;
|
QPointer<QDateEdit> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QDateEditWrap(const Napi::CallbackInfo &info);
|
QDateEditWrap(const Napi::CallbackInfo &info);
|
||||||
~QDateEditWrap();
|
~QDateEditWrap();
|
||||||
NDateEdit *getInternalInstance();
|
QDateEdit *getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class DLL_EXPORT NDateTimeEdit : public QDateTimeEdit, public NodeWidget {
|
|||||||
// inherit all constructors of QDateTimeEdit
|
// inherit all constructors of QDateTimeEdit
|
||||||
using QDateTimeEdit::QDateTimeEdit;
|
using QDateTimeEdit::QDateTimeEdit;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
QDATETIMEEDIT_SIGNALS
|
QDATETIMEEDIT_SIGNALS
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,21 +18,30 @@
|
|||||||
QABSTRACTSPINBOX_WRAPPED_METHODS_DECLARATION \
|
QABSTRACTSPINBOX_WRAPPED_METHODS_DECLARATION \
|
||||||
Napi::Value setCalendarWidget(const Napi::CallbackInfo &info) { \
|
Napi::Value setCalendarWidget(const Napi::CallbackInfo &info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
Napi::Object calendarWidgetObject = info[0].As<Napi::Object>(); \
|
Napi::Object calendarWidgetObject = info[0].As<Napi::Object>(); \
|
||||||
QCalendarWidgetWrap *calendarWidgetWrap = \
|
QCalendarWidgetWrap *calendarWidgetWrap = \
|
||||||
Napi::ObjectWrap<QCalendarWidgetWrap>::Unwrap(calendarWidgetObject); \
|
Napi::ObjectWrap<QCalendarWidgetWrap>::Unwrap(calendarWidgetObject); \
|
||||||
this->instance->setCalendarWidget( \
|
this->instance->setCalendarWidget( \
|
||||||
calendarWidgetWrap->getInternalInstance()); \
|
calendarWidgetWrap->getInternalInstance()); \
|
||||||
return env.Null(); \
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value calendarWidget(const Napi::CallbackInfo &info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QObject *calendarWidget = this->instance->calendarWidget(); \
|
||||||
|
if (calendarWidget) { \
|
||||||
|
return WrapperCache::instance.getWrapper(env, calendarWidget); \
|
||||||
|
} else { \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QDATETIMEEDIT_WRAPPED_METHODS_DECLARATION
|
#endif // QDATETIMEEDIT_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
#ifndef QDATETIMEEDIT_WRAPPED_METHODS_EXPORT_DEFINE
|
#ifndef QDATETIMEEDIT_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
#define QDATETIMEEDIT_WRAPPED_METHODS_EXPORT_DEFINE(WidgetWrapName) \
|
#define QDATETIMEEDIT_WRAPPED_METHODS_EXPORT_DEFINE(WidgetWrapName) \
|
||||||
QABSTRACTSPINBOX_WRAPPED_METHODS_EXPORT_DEFINE(WidgetWrapName) \
|
QABSTRACTSPINBOX_WRAPPED_METHODS_EXPORT_DEFINE(WidgetWrapName) \
|
||||||
InstanceMethod("setCalendarWidget", &WidgetWrapName::setCalendarWidget),
|
InstanceMethod("setCalendarWidget", &WidgetWrapName::setCalendarWidget), \
|
||||||
|
InstanceMethod("calendarWidget", &WidgetWrapName::calendarWidget),
|
||||||
|
|
||||||
#endif // QDATETIMEEDIT_WRAPPED_METHODS_EXPORT_DEFINE
|
#endif // QDATETIMEEDIT_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
|
|
||||||
|
|||||||
@ -12,13 +12,13 @@ class DLL_EXPORT QDateTimeEditWrap
|
|||||||
: public Napi::ObjectWrap<QDateTimeEditWrap> {
|
: public Napi::ObjectWrap<QDateTimeEditWrap> {
|
||||||
QDATETIMEEDIT_WRAPPED_METHODS_DECLARATION
|
QDATETIMEEDIT_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NDateTimeEdit> instance;
|
QPointer<QDateTimeEdit> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QDateTimeEditWrap(const Napi::CallbackInfo &info);
|
QDateTimeEditWrap(const Napi::CallbackInfo &info);
|
||||||
~QDateTimeEditWrap();
|
~QDateTimeEditWrap();
|
||||||
NDateTimeEdit *getInternalInstance();
|
QDateTimeEdit *getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -1,15 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QDesktopWidget>
|
|
||||||
|
|
||||||
#include "core/NodeWidget/nodewidget.h"
|
|
||||||
|
|
||||||
class NQDesktopWidget : public QDesktopWidget, public NodeWidget {
|
|
||||||
public:
|
|
||||||
Q_OBJECT
|
|
||||||
NODEWIDGET_IMPLEMENTATIONS(QDesktopWidget)
|
|
||||||
public:
|
|
||||||
using QDesktopWidget::QDesktopWidget; // inherit all constructors of
|
|
||||||
// QStatusBar
|
|
||||||
};
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <QPointer>
|
|
||||||
|
|
||||||
#include "QtWidgets/QWidget/qwidget_macro.h"
|
|
||||||
#include "napi.h"
|
|
||||||
#include "nqdesktopwidget.hpp"
|
|
||||||
|
|
||||||
class QDesktopWidgetWrap : public Napi::ObjectWrap<QDesktopWidgetWrap> {
|
|
||||||
private:
|
|
||||||
QPointer<NQDesktopWidget> instance;
|
|
||||||
|
|
||||||
public:
|
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
|
||||||
QDesktopWidgetWrap(const Napi::CallbackInfo &info);
|
|
||||||
~QDesktopWidgetWrap();
|
|
||||||
NQDesktopWidget *getInternalInstance();
|
|
||||||
static Napi::FunctionReference constructor;
|
|
||||||
// wrapped methods
|
|
||||||
Napi::Value availableGeometry(const Napi::CallbackInfo &info);
|
|
||||||
Napi::Value screenGeometry(const Napi::CallbackInfo &info);
|
|
||||||
Napi::Value screenNumber(const Napi::CallbackInfo &info);
|
|
||||||
|
|
||||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
|
||||||
};
|
|
||||||
@ -11,7 +11,7 @@ class DLL_EXPORT NDial : public QDial, public NodeWidget {
|
|||||||
public:
|
public:
|
||||||
using QDial::QDial; // inherit all constructors of QDial
|
using QDial::QDial; // inherit all constructors of QDial
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
QABSTRACT_SLIDER_SIGNALS
|
QABSTRACT_SLIDER_SIGNALS
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,13 +12,13 @@
|
|||||||
class DLL_EXPORT QDialWrap : public Napi::ObjectWrap<QDialWrap> {
|
class DLL_EXPORT QDialWrap : public Napi::ObjectWrap<QDialWrap> {
|
||||||
QABSTRACTSLIDER_WRAPPED_METHODS_DECLARATION
|
QABSTRACTSLIDER_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NDial> instance;
|
QPointer<QDial> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QDialWrap(const Napi::CallbackInfo& info);
|
QDialWrap(const Napi::CallbackInfo& info);
|
||||||
~QDialWrap();
|
~QDialWrap();
|
||||||
NDial* getInternalInstance();
|
QDial* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -11,5 +11,5 @@ class DLL_EXPORT NDialog : public QDialog, public NodeWidget {
|
|||||||
public:
|
public:
|
||||||
using QDialog::QDialog;
|
using QDialog::QDialog;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() { QDIALOG_SIGNALS }
|
virtual void connectSignalsToEventEmitter() { QDIALOG_SIGNALS }
|
||||||
};
|
};
|
||||||
|
|||||||
@ -10,44 +10,55 @@
|
|||||||
|
|
||||||
This macro adds common QDialog exported methods
|
This macro adds common QDialog exported methods
|
||||||
The exported methods are taken into this macro to avoid writing them in each
|
The exported methods are taken into this macro to avoid writing them in each
|
||||||
and every widget we export.
|
and every widget we export.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef QDIALOG_WRAPPED_METHODS_DECLARATION_NO_ACCEPT_OR_DONE
|
||||||
|
#define QDIALOG_WRAPPED_METHODS_DECLARATION_NO_ACCEPT_OR_DONE \
|
||||||
|
\
|
||||||
|
QWIDGET_WRAPPED_METHODS_DECLARATION \
|
||||||
|
\
|
||||||
|
Napi::Value setResult(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
Napi::Number result = info[0].As<Napi::Number>(); \
|
||||||
|
this->instance->setResult(result.Int32Value()); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value result(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int value = this->instance->result(); \
|
||||||
|
return Napi::Value::From(env, value); \
|
||||||
|
} \
|
||||||
|
Napi::Value exec(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int value = static_cast<int>(this->instance->exec()); \
|
||||||
|
return Napi::Number::From(env, value); \
|
||||||
|
} \
|
||||||
|
Napi::Value open(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
this->instance->open(); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value reject(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
this->instance->reject(); \
|
||||||
|
return env.Null(); \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef QDIALOG_WRAPPED_METHODS_DECLARATION
|
#ifndef QDIALOG_WRAPPED_METHODS_DECLARATION
|
||||||
#define QDIALOG_WRAPPED_METHODS_DECLARATION \
|
#define QDIALOG_WRAPPED_METHODS_DECLARATION \
|
||||||
\
|
QDIALOG_WRAPPED_METHODS_DECLARATION_NO_ACCEPT_OR_DONE \
|
||||||
QWIDGET_WRAPPED_METHODS_DECLARATION \
|
Napi::Value accept(const Napi::CallbackInfo& info) { \
|
||||||
\
|
Napi::Env env = info.Env(); \
|
||||||
Napi::Value setResult(const Napi::CallbackInfo& info) { \
|
this->instance->accept(); \
|
||||||
Napi::Env env = info.Env(); \
|
return env.Null(); \
|
||||||
Napi::HandleScope scope(env); \
|
} \
|
||||||
Napi::Number result = info[0].As<Napi::Number>(); \
|
Napi::Value done(const Napi::CallbackInfo& info) { \
|
||||||
this->instance->setResult(result.Int32Value()); \
|
Napi::Env env = info.Env(); \
|
||||||
return env.Null(); \
|
int r = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
} \
|
this->instance->done(r); \
|
||||||
Napi::Value result(const Napi::CallbackInfo& info) { \
|
return env.Null(); \
|
||||||
Napi::Env env = info.Env(); \
|
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
int value = this->instance->result(); \
|
|
||||||
return Napi::Value::From(env, value); \
|
|
||||||
} \
|
|
||||||
Napi::Value exec(const Napi::CallbackInfo& info) { \
|
|
||||||
Napi::Env env = info.Env(); \
|
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
int value = static_cast<int>(this->instance->exec()); \
|
|
||||||
return Napi::Number::From(env, value); \
|
|
||||||
} \
|
|
||||||
Napi::Value open(const Napi::CallbackInfo& info) { \
|
|
||||||
Napi::Env env = info.Env(); \
|
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
this->instance->open(); \
|
|
||||||
return env.Null(); \
|
|
||||||
} \
|
|
||||||
Napi::Value reject(const Napi::CallbackInfo& info) { \
|
|
||||||
Napi::Env env = info.Env(); \
|
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
this->instance->reject(); \
|
|
||||||
return env.Null(); \
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -59,7 +70,9 @@
|
|||||||
InstanceMethod("setResult", &DialogWrapName::setResult), \
|
InstanceMethod("setResult", &DialogWrapName::setResult), \
|
||||||
InstanceMethod("exec", &DialogWrapName::exec), \
|
InstanceMethod("exec", &DialogWrapName::exec), \
|
||||||
InstanceMethod("open", &DialogWrapName::open), \
|
InstanceMethod("open", &DialogWrapName::open), \
|
||||||
InstanceMethod("reject", &DialogWrapName::reject),
|
InstanceMethod("reject", &DialogWrapName::reject), \
|
||||||
|
InstanceMethod("accept", &DialogWrapName::accept), \
|
||||||
|
InstanceMethod("done", &DialogWrapName::done),
|
||||||
|
|
||||||
#endif // QDIALOG_WRAPPED_METHODS_EXPORT_DEFINE
|
#endif // QDIALOG_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
|
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QDialogWrap : public Napi::ObjectWrap<QDialogWrap> {
|
class DLL_EXPORT QDialogWrap : public Napi::ObjectWrap<QDialogWrap> {
|
||||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
QDIALOG_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NDialog> instance;
|
QPointer<QDialog> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QDialogWrap(const Napi::CallbackInfo& info);
|
QDialogWrap(const Napi::CallbackInfo& info);
|
||||||
~QDialogWrap();
|
~QDialogWrap();
|
||||||
NDialog* getInternalInstance();
|
QDialog* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class DLL_EXPORT NDoubleSpinBox : public QDoubleSpinBox, public NodeWidget {
|
|||||||
using QDoubleSpinBox::QDoubleSpinBox; // inherit all constructors of
|
using QDoubleSpinBox::QDoubleSpinBox; // inherit all constructors of
|
||||||
// QDoubleSpinBox
|
// QDoubleSpinBox
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
QABSTRACTSPINBOX_SIGNALS
|
QABSTRACTSPINBOX_SIGNALS
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
|
|||||||
@ -12,13 +12,13 @@ class DLL_EXPORT QDoubleSpinBoxWrap
|
|||||||
: public Napi::ObjectWrap<QDoubleSpinBoxWrap> {
|
: public Napi::ObjectWrap<QDoubleSpinBoxWrap> {
|
||||||
QABSTRACTSPINBOX_WRAPPED_METHODS_DECLARATION
|
QABSTRACTSPINBOX_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NDoubleSpinBox> instance;
|
QPointer<QDoubleSpinBox> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QDoubleSpinBoxWrap(const Napi::CallbackInfo& info);
|
QDoubleSpinBoxWrap(const Napi::CallbackInfo& info);
|
||||||
~QDoubleSpinBoxWrap();
|
~QDoubleSpinBoxWrap();
|
||||||
NDoubleSpinBox* getInternalInstance();
|
QDoubleSpinBox* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class DLL_EXPORT NErrorMessage : public QErrorMessage, public NodeWidget {
|
|||||||
public:
|
public:
|
||||||
using QErrorMessage::QErrorMessage;
|
using QErrorMessage::QErrorMessage;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
QDIALOG_SIGNALS
|
QDIALOG_SIGNALS
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,17 +10,19 @@
|
|||||||
|
|
||||||
class DLL_EXPORT QErrorMessageWrap
|
class DLL_EXPORT QErrorMessageWrap
|
||||||
: public Napi::ObjectWrap<QErrorMessageWrap> {
|
: public Napi::ObjectWrap<QErrorMessageWrap> {
|
||||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
QDIALOG_WRAPPED_METHODS_DECLARATION_NO_ACCEPT_OR_DONE
|
||||||
private:
|
private:
|
||||||
QPointer<NErrorMessage> instance;
|
QPointer<QErrorMessage> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QErrorMessageWrap(const Napi::CallbackInfo& info);
|
QErrorMessageWrap(const Napi::CallbackInfo& info);
|
||||||
~QErrorMessageWrap();
|
~QErrorMessageWrap();
|
||||||
NErrorMessage* getInternalInstance();
|
QErrorMessage* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value showMessage(const Napi::CallbackInfo& info);
|
Napi::Value showMessage(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value accept(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value done(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class DLL_EXPORT NFileDialog : public QFileDialog, public NodeWidget {
|
|||||||
NODEWIDGET_IMPLEMENTATIONS(QFileDialog)
|
NODEWIDGET_IMPLEMENTATIONS(QFileDialog)
|
||||||
using QFileDialog::QFileDialog;
|
using QFileDialog::QFileDialog;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
QDIALOG_SIGNALS
|
QDIALOG_SIGNALS
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
|
|||||||
@ -9,15 +9,15 @@
|
|||||||
#include "QtWidgets/QFileDialog/nfiledialog.hpp"
|
#include "QtWidgets/QFileDialog/nfiledialog.hpp"
|
||||||
|
|
||||||
class DLL_EXPORT QFileDialogWrap : public Napi::ObjectWrap<QFileDialogWrap> {
|
class DLL_EXPORT QFileDialogWrap : public Napi::ObjectWrap<QFileDialogWrap> {
|
||||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
QDIALOG_WRAPPED_METHODS_DECLARATION_NO_ACCEPT_OR_DONE
|
||||||
private:
|
private:
|
||||||
QPointer<NFileDialog> instance;
|
QPointer<QFileDialog> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QFileDialogWrap(const Napi::CallbackInfo& info);
|
QFileDialogWrap(const Napi::CallbackInfo& info);
|
||||||
~QFileDialogWrap();
|
~QFileDialogWrap();
|
||||||
NFileDialog* getInternalInstance();
|
QFileDialog* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
@ -28,4 +28,6 @@ class DLL_EXPORT QFileDialogWrap : public Napi::ObjectWrap<QFileDialogWrap> {
|
|||||||
Napi::Value setOption(const Napi::CallbackInfo& info);
|
Napi::Value setOption(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setNameFilter(const Napi::CallbackInfo& info);
|
Napi::Value setNameFilter(const Napi::CallbackInfo& info);
|
||||||
Napi::Value selectedFiles(const Napi::CallbackInfo& info);
|
Napi::Value selectedFiles(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value accept(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value done(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class DLL_EXPORT NFontDialog : public QFontDialog, public NodeWidget {
|
|||||||
public:
|
public:
|
||||||
using QFontDialog::QFontDialog;
|
using QFontDialog::QFontDialog;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
QDIALOG_SIGNALS
|
QDIALOG_SIGNALS
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
|
|||||||
@ -9,19 +9,21 @@
|
|||||||
#include "QtWidgets/QFontDialog/nfontdialog.hpp"
|
#include "QtWidgets/QFontDialog/nfontdialog.hpp"
|
||||||
|
|
||||||
class DLL_EXPORT QFontDialogWrap : public Napi::ObjectWrap<QFontDialogWrap> {
|
class DLL_EXPORT QFontDialogWrap : public Napi::ObjectWrap<QFontDialogWrap> {
|
||||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
QDIALOG_WRAPPED_METHODS_DECLARATION_NO_ACCEPT_OR_DONE
|
||||||
private:
|
private:
|
||||||
QPointer<NFontDialog> instance;
|
QPointer<QFontDialog> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QFontDialogWrap(const Napi::CallbackInfo& info);
|
QFontDialogWrap(const Napi::CallbackInfo& info);
|
||||||
~QFontDialogWrap();
|
~QFontDialogWrap();
|
||||||
NFontDialog* getInternalInstance();
|
QFontDialog* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value selectedFont(const Napi::CallbackInfo& info);
|
Napi::Value selectedFont(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setOption(const Napi::CallbackInfo& info);
|
Napi::Value setOption(const Napi::CallbackInfo& info);
|
||||||
Napi::Value testOption(const Napi::CallbackInfo& info);
|
Napi::Value testOption(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value accept(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value done(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -12,5 +12,5 @@ class DLL_EXPORT NFrame : public QFrame, public NodeWidget {
|
|||||||
public:
|
public:
|
||||||
using QFrame::QFrame;
|
using QFrame::QFrame;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() { QFRAME_SIGNALS }
|
virtual void connectSignalsToEventEmitter() { QFRAME_SIGNALS }
|
||||||
};
|
};
|
||||||
|
|||||||
@ -17,12 +17,10 @@
|
|||||||
\
|
\
|
||||||
Napi::Value frameStyle(const Napi::CallbackInfo& info) { \
|
Napi::Value frameStyle(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
return Napi::Number::New(env, this->instance->frameStyle()); \
|
return Napi::Number::New(env, this->instance->frameStyle()); \
|
||||||
} \
|
} \
|
||||||
Napi::Value setFrameStyle(const Napi::CallbackInfo& info) { \
|
Napi::Value setFrameStyle(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::HandleScope scope(env); \
|
|
||||||
int style = info[0].As<Napi::Number>().Int32Value(); \
|
int style = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
this->instance->setFrameStyle(style); \
|
this->instance->setFrameStyle(style); \
|
||||||
return env.Null(); \
|
return env.Null(); \
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QFrameWrap : public Napi::ObjectWrap<QFrameWrap> {
|
class DLL_EXPORT QFrameWrap : public Napi::ObjectWrap<QFrameWrap> {
|
||||||
QFRAME_WRAPPED_METHODS_DECLARATION
|
QFRAME_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NFrame> instance;
|
QPointer<QFrame> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QFrameWrap(const Napi::CallbackInfo& info);
|
QFrameWrap(const Napi::CallbackInfo& info);
|
||||||
~QFrameWrap();
|
~QFrameWrap();
|
||||||
NFrame* getInternalInstance();
|
QFrame* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class DLL_EXPORT NGraphicsBlurEffect : public QGraphicsBlurEffect,
|
|||||||
public:
|
public:
|
||||||
using QGraphicsBlurEffect::QGraphicsBlurEffect;
|
using QGraphicsBlurEffect::QGraphicsBlurEffect;
|
||||||
|
|
||||||
void connectSignalsToEventEmitter() {
|
virtual void connectSignalsToEventEmitter() {
|
||||||
QGRAPHICSEFFECT_SIGNALS
|
QGRAPHICSEFFECT_SIGNALS
|
||||||
// Qt Connects: Implement all signal connects here
|
// Qt Connects: Implement all signal connects here
|
||||||
QObject::connect(this, &QGraphicsBlurEffect::blurHintsChanged,
|
QObject::connect(this, &QGraphicsBlurEffect::blurHintsChanged,
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
#include "Extras/Export/export.h"
|
#include "Extras/Export/export.h"
|
||||||
|
#include "Extras/Utils/nutils.h"
|
||||||
#include "QtWidgets/QGraphicsEffect/qgraphicseffect_macro.h"
|
#include "QtWidgets/QGraphicsEffect/qgraphicseffect_macro.h"
|
||||||
#include "ngraphicsblureffect.hpp"
|
#include "ngraphicsblureffect.hpp"
|
||||||
|
|
||||||
@ -12,13 +13,13 @@ class DLL_EXPORT QGraphicsBlurEffectWrap
|
|||||||
: public Napi::ObjectWrap<QGraphicsBlurEffectWrap> {
|
: public Napi::ObjectWrap<QGraphicsBlurEffectWrap> {
|
||||||
QGRAPHICSEFFECT_WRAPPED_METHODS_DECLARATION
|
QGRAPHICSEFFECT_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NGraphicsBlurEffect> instance;
|
QPointer<QGraphicsBlurEffect> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QGraphicsBlurEffectWrap(const Napi::CallbackInfo& info);
|
QGraphicsBlurEffectWrap(const Napi::CallbackInfo& info);
|
||||||
~QGraphicsBlurEffectWrap();
|
~QGraphicsBlurEffectWrap();
|
||||||
NGraphicsBlurEffect* getInternalInstance();
|
QGraphicsBlurEffect* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user