Compare commits
118 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 |
13
.github/workflows/latest.yml
vendored
13
.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: '16.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: yarn 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
|
||||||
@ -32,9 +35,9 @@ jobs:
|
|||||||
body: >
|
body: >
|
||||||
Latest auto release corresponding to commit ${{github.sha}} 🔥.
|
Latest auto release corresponding to commit ${{github.sha}} 🔥.
|
||||||
To install do:
|
To install do:
|
||||||
`yarn 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`
|
||||||
or
|
or
|
||||||
`yarn install http://master-release.nodegui.org`
|
`npm install http://master-release.nodegui.org`
|
||||||
assets: >
|
assets: >
|
||||||
nodegui-nodegui-0.0.0-latest-master.tgz:nodegui-master.tgz:application/tar+gzip
|
nodegui-nodegui-0.0.0-latest-master.tgz:nodegui-master.tgz:application/tar+gzip
|
||||||
recreate: true
|
recreate: true
|
||||||
|
|||||||
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-18.04
|
- os: ubuntu-20.04
|
||||||
platform: linux
|
platform: linux
|
||||||
arch: x64
|
arch: x64
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
@ -30,8 +30,8 @@ jobs:
|
|||||||
node-version: '16.x'
|
node-version: '16.x'
|
||||||
|
|
||||||
- name: Install ubuntu deps
|
- name: Install ubuntu deps
|
||||||
if: contains(matrix.os, 'ubuntu-18.04')
|
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
|
||||||
|
|||||||
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@ -6,7 +6,7 @@ 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
|
||||||
@ -14,8 +14,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: '16.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
|
||||||
|
|||||||
@ -11,6 +11,7 @@ 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.
|
# Note: CMake+moc also use this list when finding files which `moc` applied.
|
||||||
|
|
||||||
@ -51,14 +52,18 @@ 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/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/QFontMetricsF/qfontmetricsf_wrap.cpp"
|
||||||
@ -157,6 +162,7 @@ add_library(${CORE_WIDGETS_ADDON} SHARED
|
|||||||
"${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/QStyleFactory/qstylefactory_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/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/QAbstractItemModel/nabstractitemmodel.hpp"
|
||||||
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtCore/QItemSelectionModel/nitemselectionmodel.hpp"
|
"${PROJECT_SOURCE_DIR}/src/cpp/include/nodegui/QtCore/QItemSelectionModel/nitemselectionmodel.hpp"
|
||||||
@ -251,10 +257,9 @@ if (WIN32)
|
|||||||
ENABLE_DLL_EXPORT=1
|
ENABLE_DLL_EXPORT=1
|
||||||
)
|
)
|
||||||
target_compile_options(${CORE_WIDGETS_ADDON} PRIVATE "/MP")
|
target_compile_options(${CORE_WIDGETS_ADDON} PRIVATE "/MP")
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (LINUX)
|
if (UNIX AND NOT APPLE)
|
||||||
# Set the RPATH in the binary to a relative one to allow it to find our Qt
|
# 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.
|
# libraries regardless of where the base installation directory is.
|
||||||
file(RELATIVE_PATH QT_LIBRARY_REL_PATH "${CMAKE_BINARY_DIR}/Release" "${QT_CMAKE_HOME_DIR}/../..")
|
file(RELATIVE_PATH QT_LIBRARY_REL_PATH "${CMAKE_BINARY_DIR}/Release" "${QT_CMAKE_HOME_DIR}/../..")
|
||||||
@ -263,16 +268,16 @@ if (LINUX)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
set(CMAKE_MACOSX_RPATH ON)
|
||||||
file(RELATIVE_PATH QT_LIBRARY_REL_PATH "${CMAKE_BINARY_DIR}/Release" "${QT_CMAKE_HOME_DIR}/../..")
|
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}")
|
set_target_properties(${CORE_WIDGETS_ADDON} PROPERTIES INSTALL_RPATH "@loader_path/${QT_LIBRARY_REL_PATH}")
|
||||||
set_target_properties(${CORE_WIDGETS_ADDON} PROPERTIES SKIP_BUILD_RPATH FALSE)
|
|
||||||
set_target_properties(${CORE_WIDGETS_ADDON} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
|
|
||||||
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
|
||||||
)
|
)
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
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)**.
|
||||||
|
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
10483
package-lock.json
generated
Normal file
10483
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
35
package.json
35
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nodegui/nodegui",
|
"name": "@nodegui/nodegui",
|
||||||
"version": "0.45.3",
|
"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",
|
||||||
@ -14,18 +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",
|
||||||
"install": "cross-env npm run setupqt && (node ./scripts/skip.js || npm run setupbinary || 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)",
|
||||||
"setupbinary": "cross-env node ./scripts/setupBinary.js",
|
"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"
|
||||||
@ -33,7 +34,7 @@
|
|||||||
"engineStrict": false,
|
"engineStrict": false,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodegui/artifact-installer": "^1.1.0",
|
"@nodegui/artifact-installer": "^1.1.0",
|
||||||
"@nodegui/qode": "^16.4.0",
|
"@nodegui/qode": "^18.12.1",
|
||||||
"cmake-js": "^6.2.1",
|
"cmake-js": "^6.2.1",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"cuid": "^2.1.8",
|
"cuid": "^2.1.8",
|
||||||
@ -46,20 +47,20 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bindings": "^1.5.1",
|
"@types/bindings": "^1.5.1",
|
||||||
"@types/jest": "^26.0.24",
|
"@types/jest": "29.2.4",
|
||||||
"@types/node": "^16.4.13",
|
"@types/node": "^16.4.13",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.29.0",
|
"@typescript-eslint/eslint-plugin": "^4.29.0",
|
||||||
"@typescript-eslint/parser": "^4.29.0",
|
"@typescript-eslint/parser": "^4.29.0",
|
||||||
"clang-format": "^1.5.0",
|
"clang-format": "^1.5.0",
|
||||||
"typedoc": "^0.17.8",
|
|
||||||
"typedoc-plugin-markdown": "^2.4.2",
|
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-prettier": "^3.4.0",
|
"eslint-plugin-prettier": "^3.4.0",
|
||||||
"husky": "^7.0.1",
|
"husky": "^7.0.1",
|
||||||
"jest": "^27.0.6",
|
"jest": "29.3.1",
|
||||||
"prettier": "^2.3.2",
|
"prettier": "^2.3.2",
|
||||||
"ts-jest": "^27.0.4",
|
"ts-jest": "29.0.3",
|
||||||
|
"typedoc": "^0.17.8",
|
||||||
|
"typedoc-plugin-markdown": "^2.4.2",
|
||||||
"typescript": "^4.3.5"
|
"typescript": "^4.3.5"
|
||||||
},
|
},
|
||||||
"binary": {
|
"binary": {
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -13,8 +13,7 @@ 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);
|
DLL_EXPORT uint64_t hashPointerTo53bit(const void* input);
|
||||||
|
|||||||
@ -35,6 +35,8 @@ class DLL_EXPORT NAbstractItemModel : public QAbstractItemModel,
|
|||||||
return *newIndex;
|
return *newIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QObject* parent() const { return nullptr; }
|
||||||
|
|
||||||
QModelIndex parent(const QModelIndex& child) const override {
|
QModelIndex parent(const QModelIndex& child) const override {
|
||||||
Napi::Env env = this->dispatchOnNode.Env();
|
Napi::Env env = this->dispatchOnNode.Env();
|
||||||
Napi::HandleScope scope(env);
|
Napi::HandleScope scope(env);
|
||||||
|
|||||||
@ -14,7 +14,6 @@ class DLL_EXPORT QItemSelectionModelWrap
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<QItemSelectionModel> instance;
|
QPointer<QItemSelectionModel> 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);
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -5,11 +5,12 @@
|
|||||||
#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_WITH_EVENT_SOURCE
|
#ifndef QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE
|
||||||
@ -20,7 +21,8 @@
|
|||||||
Napi::Value __id__(const Napi::CallbackInfo& info) { \
|
Napi::Value __id__(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
return Napi::Value::From( \
|
return Napi::Value::From( \
|
||||||
env, extrautils::hashPointerTo53bit(this->instance.data())); \
|
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(); \
|
||||||
@ -74,6 +76,49 @@
|
|||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
return Napi::External<QObject>::New( \
|
return Napi::External<QObject>::New( \
|
||||||
env, static_cast<QObject*>(this->instance)); \
|
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
|
// Ideally this macro below should go in
|
||||||
@ -115,7 +160,13 @@
|
|||||||
InstanceMethod("objectName", &ComponentWrapName::objectName), \
|
InstanceMethod("objectName", &ComponentWrapName::objectName), \
|
||||||
InstanceMethod("dumpObjectTree", &ComponentWrapName::dumpObjectTree), \
|
InstanceMethod("dumpObjectTree", &ComponentWrapName::dumpObjectTree), \
|
||||||
InstanceMethod("dumpObjectInfo", &ComponentWrapName::dumpObjectInfo), \
|
InstanceMethod("dumpObjectInfo", &ComponentWrapName::dumpObjectInfo), \
|
||||||
InstanceMethod("setParent", &ComponentWrapName::setParent),
|
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
|
||||||
|
|
||||||
@ -135,4 +186,22 @@
|
|||||||
#define QOBJECT_SIGNALS QOBJECT_SIGNALS_ON_TARGET(this)
|
#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"
|
#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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -19,9 +19,19 @@ class DLL_EXPORT QSizeFWrap : public Napi::ObjectWrap<QSizeFWrap> {
|
|||||||
~QSizeFWrap();
|
~QSizeFWrap();
|
||||||
QSizeF* getInternalInstance();
|
QSizeF* 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 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);
|
Napi::Value width(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,14 @@ class DLL_EXPORT NApplication : public QApplication, public EventWidget {
|
|||||||
// 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();
|
||||||
@ -25,12 +33,17 @@ class DLL_EXPORT NApplication : public QApplication, public EventWidget {
|
|||||||
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(
|
QObject::connect(
|
||||||
this, &QGuiApplication::primaryScreenChanged, [=](QScreen* screen) {
|
this, &QGuiApplication::primaryScreenChanged, [=](QScreen* screen) {
|
||||||
Napi::Env env = this->emitOnNode.Env();
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
Napi::HandleScope scope(env);
|
Napi::HandleScope scope(env);
|
||||||
auto instance =
|
auto instance = WrapperCache::instance.getWrapper(env, screen, true);
|
||||||
WrapperCache::instance.get<QScreen, QScreenWrap>(env, screen);
|
|
||||||
this->emitOnNode.Call(
|
this->emitOnNode.Call(
|
||||||
{Napi::String::New(env, "primaryScreenChanged"), instance});
|
{Napi::String::New(env, "primaryScreenChanged"), instance});
|
||||||
});
|
});
|
||||||
@ -38,8 +51,7 @@ class DLL_EXPORT NApplication : public QApplication, public EventWidget {
|
|||||||
QObject::connect(this, &QGuiApplication::screenAdded, [=](QScreen* screen) {
|
QObject::connect(this, &QGuiApplication::screenAdded, [=](QScreen* screen) {
|
||||||
Napi::Env env = this->emitOnNode.Env();
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
Napi::HandleScope scope(env);
|
Napi::HandleScope scope(env);
|
||||||
auto instance =
|
auto instance = WrapperCache::instance.getWrapper(env, screen, true);
|
||||||
WrapperCache::instance.get<QScreen, QScreenWrap>(env, screen);
|
|
||||||
this->emitOnNode.Call({Napi::String::New(env, "screenAdded"), instance});
|
this->emitOnNode.Call({Napi::String::New(env, "screenAdded"), instance});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -47,8 +59,7 @@ class DLL_EXPORT NApplication : public QApplication, public EventWidget {
|
|||||||
this, &QGuiApplication::screenRemoved, [=](QScreen* screen) {
|
this, &QGuiApplication::screenRemoved, [=](QScreen* screen) {
|
||||||
Napi::Env env = this->emitOnNode.Env();
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
Napi::HandleScope scope(env);
|
Napi::HandleScope scope(env);
|
||||||
auto instance =
|
auto instance = WrapperCache::instance.getWrapper(env, screen, true);
|
||||||
WrapperCache::instance.get<QScreen, QScreenWrap>(env, screen);
|
|
||||||
this->emitOnNode.Call(
|
this->emitOnNode.Call(
|
||||||
{Napi::String::New(env, "screenRemoved"), instance});
|
{Napi::String::New(env, "screenRemoved"), instance});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -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,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);
|
||||||
|
};
|
||||||
@ -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);
|
||||||
|
};
|
||||||
@ -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);
|
||||||
|
};
|
||||||
@ -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 {
|
||||||
|
|||||||
@ -30,4 +30,5 @@ class DLL_EXPORT QScreenWrap : public Napi::ObjectWrap<QScreenWrap>,
|
|||||||
virtual void connectSignalsToEventEmitter();
|
virtual void connectSignalsToEventEmitter();
|
||||||
|
|
||||||
// Wrapped methods
|
// Wrapped methods
|
||||||
|
Napi::Value grabWindow(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -9,7 +9,8 @@
|
|||||||
#include "QtCore/QObject/qobject_macro.h"
|
#include "QtCore/QObject/qobject_macro.h"
|
||||||
|
|
||||||
class DLL_EXPORT QWindowWrap : public Napi::ObjectWrap<QWindowWrap>,
|
class DLL_EXPORT QWindowWrap : public Napi::ObjectWrap<QWindowWrap>,
|
||||||
public EventWidget {
|
public EventWidget,
|
||||||
|
public QObject {
|
||||||
QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE(this)
|
QOBJECT_WRAPPED_METHODS_DECLARATION_WITH_EVENT_SOURCE(this)
|
||||||
// Note: We don't use EVENTWIDGET_IMPLEMENTATIONS() here because this class
|
// Note: We don't use EVENTWIDGET_IMPLEMENTATIONS() here because this class
|
||||||
// doesn't handle any QEvents.
|
// doesn't handle any QEvents.
|
||||||
@ -34,10 +35,24 @@ class DLL_EXPORT QWindowWrap : public Napi::ObjectWrap<QWindowWrap>,
|
|||||||
|
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QWindowWrap(const Napi::CallbackInfo& info);
|
QWindowWrap(const Napi::CallbackInfo& info);
|
||||||
|
~QWindowWrap();
|
||||||
QWindow* getInternalInstance();
|
QWindow* getInternalInstance();
|
||||||
|
|
||||||
virtual void connectSignalsToEventEmitter();
|
virtual void connectSignalsToEventEmitter();
|
||||||
|
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value screen(const Napi::CallbackInfo& info);
|
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,8 +16,7 @@
|
|||||||
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(); \
|
||||||
int msec = info[0].As<Napi::Number>().Int32Value(); \
|
this->instance->animateClick(); \
|
||||||
this->instance->animateClick(msec); \
|
|
||||||
return env.Null(); \
|
return env.Null(); \
|
||||||
} \
|
} \
|
||||||
Napi::Value click(const Napi::CallbackInfo& info) { \
|
Napi::Value click(const Napi::CallbackInfo& info) { \
|
||||||
|
|||||||
@ -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
|
||||||
|
};
|
||||||
@ -3,6 +3,7 @@
|
|||||||
#include "QtCore/QAbstractItemModel/qabstractitemmodel_wrap.h"
|
#include "QtCore/QAbstractItemModel/qabstractitemmodel_wrap.h"
|
||||||
#include "QtCore/QItemSelectionModel/qitemselectionmodel_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"
|
||||||
|
|
||||||
@ -145,9 +146,7 @@
|
|||||||
Napi::Value selectionModel(const Napi::CallbackInfo& info) { \
|
Napi::Value selectionModel(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
QItemSelectionModel* model = this->instance->selectionModel(); \
|
QItemSelectionModel* model = this->instance->selectionModel(); \
|
||||||
auto modelExt = Napi::External<QItemSelectionModel>::New(env, model); \
|
return WrapperCache::instance.getWrapper(env, model); \
|
||||||
auto instance = QItemSelectionModelWrap::constructor.New({modelExt}); \
|
|
||||||
return instance; \
|
|
||||||
} \
|
} \
|
||||||
Napi::Value isPersistentEditorOpen(const Napi::CallbackInfo& info) { \
|
Napi::Value isPersistentEditorOpen(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
@ -171,6 +170,57 @@
|
|||||||
QString search = QString::fromUtf8(searchNapiText.c_str()); \
|
QString search = QString::fromUtf8(searchNapiText.c_str()); \
|
||||||
this->instance->keyboardSearch(search); \
|
this->instance->keyboardSearch(search); \
|
||||||
return env.Null(); \
|
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 \
|
#define QABSTRACTITEMVIEW_WRAPPED_METHODS_DECLARATION \
|
||||||
@ -195,42 +245,59 @@
|
|||||||
info[1].As<Napi::Number>().Int32Value()); \
|
info[1].As<Napi::Number>().Int32Value()); \
|
||||||
this->instance->scrollTo(*index, hint); \
|
this->instance->scrollTo(*index, hint); \
|
||||||
return env.Null(); \
|
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("setModel", &WidgetWrapName::setModel), \
|
||||||
InstanceMethod("closePersistentEditor", \
|
InstanceMethod("closePersistentEditor", \
|
||||||
&WidgetWrapName::closePersistentEditor), \
|
&WidgetWrapName::closePersistentEditor), \
|
||||||
InstanceMethod("clearSelection", &WidgetWrapName::clearSelection), \
|
InstanceMethod("clearSelection", &WidgetWrapName::clearSelection), \
|
||||||
InstanceMethod("edit", &WidgetWrapName::edit), \
|
InstanceMethod("edit", &WidgetWrapName::edit), \
|
||||||
InstanceMethod("reset", &WidgetWrapName::reset), \
|
InstanceMethod("reset", &WidgetWrapName::reset), \
|
||||||
InstanceMethod("selectAll", &WidgetWrapName::selectAll), \
|
InstanceMethod("selectAll", &WidgetWrapName::selectAll), \
|
||||||
InstanceMethod("setRootIndex", &WidgetWrapName::setRootIndex), \
|
InstanceMethod("setRootIndex", &WidgetWrapName::setRootIndex), \
|
||||||
InstanceMethod("update_QModelIndex", \
|
InstanceMethod("update_QModelIndex", \
|
||||||
&WidgetWrapName::update_QModelIndex), \
|
&WidgetWrapName::update_QModelIndex), \
|
||||||
InstanceMethod("indexAt", &WidgetWrapName::indexAt), \
|
InstanceMethod("indexAt", &WidgetWrapName::indexAt), \
|
||||||
InstanceMethod("selectionModel", &WidgetWrapName::selectionModel), \
|
InstanceMethod("selectionModel", &WidgetWrapName::selectionModel), \
|
||||||
InstanceMethod("scrollTo", &WidgetWrapName::scrollTo), \
|
InstanceMethod("scrollTo", &WidgetWrapName::scrollTo), \
|
||||||
InstanceMethod("isPersistentEditorOpen", \
|
InstanceMethod("isPersistentEditorOpen", \
|
||||||
&WidgetWrapName::isPersistentEditorOpen), \
|
&WidgetWrapName::isPersistentEditorOpen), \
|
||||||
InstanceMethod("openPersistentEditor", \
|
InstanceMethod("openPersistentEditor", \
|
||||||
&WidgetWrapName::openPersistentEditor), \
|
&WidgetWrapName::openPersistentEditor), \
|
||||||
InstanceMethod("keyboardSearch", &WidgetWrapName::keyboardSearch),
|
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
|
||||||
|
|
||||||
|
|||||||
@ -58,9 +58,21 @@
|
|||||||
Napi::Value viewport(const Napi::CallbackInfo& info) { \
|
Napi::Value viewport(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.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; \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,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
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -15,12 +15,30 @@ class DLL_EXPORT NButtonGroup : public QButtonGroup, public EventWidget {
|
|||||||
virtual 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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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 {
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -24,14 +24,24 @@
|
|||||||
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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -10,39 +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::Number result = info[0].As<Napi::Number>(); \
|
} \
|
||||||
this->instance->setResult(result.Int32Value()); \
|
Napi::Value done(const Napi::CallbackInfo& info) { \
|
||||||
return env.Null(); \
|
Napi::Env env = info.Env(); \
|
||||||
} \
|
int r = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
Napi::Value result(const Napi::CallbackInfo& info) { \
|
this->instance->done(r); \
|
||||||
Napi::Env env = info.Env(); \
|
return env.Null(); \
|
||||||
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
|
#endif
|
||||||
|
|
||||||
@ -54,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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -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);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -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);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -12,13 +12,13 @@ class DLL_EXPORT QGraphicsDropShadowEffectWrap
|
|||||||
: public Napi::ObjectWrap<QGraphicsDropShadowEffectWrap> {
|
: public Napi::ObjectWrap<QGraphicsDropShadowEffectWrap> {
|
||||||
QGRAPHICSEFFECT_WRAPPED_METHODS_DECLARATION
|
QGRAPHICSEFFECT_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NGraphicsDropShadowEffect> instance;
|
QPointer<QGraphicsDropShadowEffect> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QGraphicsDropShadowEffectWrap(const Napi::CallbackInfo& info);
|
QGraphicsDropShadowEffectWrap(const Napi::CallbackInfo& info);
|
||||||
~QGraphicsDropShadowEffectWrap();
|
~QGraphicsDropShadowEffectWrap();
|
||||||
NGraphicsDropShadowEffect* getInternalInstance();
|
QGraphicsDropShadowEffect* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -12,13 +12,13 @@
|
|||||||
class DLL_EXPORT QGridLayoutWrap : public Napi::ObjectWrap<QGridLayoutWrap> {
|
class DLL_EXPORT QGridLayoutWrap : public Napi::ObjectWrap<QGridLayoutWrap> {
|
||||||
QLAYOUT_WRAPPED_METHODS_DECLARATION
|
QLAYOUT_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NGridLayout> instance;
|
QPointer<QGridLayout> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QGridLayoutWrap(const Napi::CallbackInfo& info);
|
QGridLayoutWrap(const Napi::CallbackInfo& info);
|
||||||
~QGridLayoutWrap();
|
~QGridLayoutWrap();
|
||||||
NGridLayout* getInternalInstance();
|
QGridLayout* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QGroupBoxWrap : public Napi::ObjectWrap<QGroupBoxWrap> {
|
class DLL_EXPORT QGroupBoxWrap : public Napi::ObjectWrap<QGroupBoxWrap> {
|
||||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NGroupBox> instance;
|
QPointer<QGroupBox> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QGroupBoxWrap(const Napi::CallbackInfo& info);
|
QGroupBoxWrap(const Napi::CallbackInfo& info);
|
||||||
~QGroupBoxWrap();
|
~QGroupBoxWrap();
|
||||||
NGroupBox* getInternalInstance();
|
QGroupBox* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -21,4 +21,7 @@ class DLL_EXPORT NHeaderView : public QHeaderView, public NodeWidget {
|
|||||||
void _protected_scrollTo(const QModelIndex &index, ScrollHint hint) {
|
void _protected_scrollTo(const QModelIndex &index, ScrollHint hint) {
|
||||||
scrollTo(index, hint);
|
scrollTo(index, hint);
|
||||||
}
|
}
|
||||||
|
QRect _protected_visualRect(const QModelIndex &index) const {
|
||||||
|
return visualRect(index);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -43,9 +43,24 @@ class DLL_EXPORT QHeaderViewWrap : public Napi::ObjectWrap<QHeaderViewWrap> {
|
|||||||
return env.Null();
|
return env.Null();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Napi::Value visualRect(const Napi::CallbackInfo& info) {
|
||||||
|
Napi::Env env = info.Env();
|
||||||
|
|
||||||
|
NHeaderView* wrapper = dynamic_cast<NHeaderView*>(this->instance.data());
|
||||||
|
if (wrapper) {
|
||||||
|
QModelIndexWrap* indexWrap =
|
||||||
|
Napi::ObjectWrap<QModelIndexWrap>::Unwrap(info[0].As<Napi::Object>());
|
||||||
|
QModelIndex* index = indexWrap->getInternalInstance();
|
||||||
|
QRect ret = wrapper->_protected_visualRect(*index);
|
||||||
|
auto instance = QRectWrap::constructor.New(
|
||||||
|
{Napi::External<QRect>::New(env, new QRect(ret))});
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
return env.Null();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<QHeaderView> instance;
|
QPointer<QHeaderView> 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);
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QInputDialogWrap : public Napi::ObjectWrap<QInputDialogWrap> {
|
class DLL_EXPORT QInputDialogWrap : public Napi::ObjectWrap<QInputDialogWrap> {
|
||||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
QDIALOG_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NInputDialog> instance;
|
QPointer<QInputDialog> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QInputDialogWrap(const Napi::CallbackInfo& info);
|
QInputDialogWrap(const Napi::CallbackInfo& info);
|
||||||
~QInputDialogWrap();
|
~QInputDialogWrap();
|
||||||
NInputDialog* getInternalInstance();
|
QInputDialog* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// members
|
// members
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QLCDNumberWrap : public Napi::ObjectWrap<QLCDNumberWrap> {
|
class DLL_EXPORT QLCDNumberWrap : public Napi::ObjectWrap<QLCDNumberWrap> {
|
||||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NLCDNumber> instance;
|
QPointer<QLCDNumber> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QLCDNumberWrap(const Napi::CallbackInfo& info);
|
QLCDNumberWrap(const Napi::CallbackInfo& info);
|
||||||
~QLCDNumberWrap();
|
~QLCDNumberWrap();
|
||||||
NLCDNumber* getInternalInstance();
|
QLCDNumber* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -12,19 +12,20 @@
|
|||||||
class DLL_EXPORT QLabelWrap : public Napi::ObjectWrap<QLabelWrap> {
|
class DLL_EXPORT QLabelWrap : public Napi::ObjectWrap<QLabelWrap> {
|
||||||
QFRAME_WRAPPED_METHODS_DECLARATION
|
QFRAME_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NLabel> instance;
|
QPointer<QLabel> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QLabelWrap(const Napi::CallbackInfo& info);
|
QLabelWrap(const Napi::CallbackInfo& info);
|
||||||
~QLabelWrap();
|
~QLabelWrap();
|
||||||
NLabel* getInternalInstance();
|
QLabel* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value setSelection(const Napi::CallbackInfo& info);
|
Napi::Value setSelection(const Napi::CallbackInfo& info);
|
||||||
Napi::Value selectionStart(const Napi::CallbackInfo& info);
|
Napi::Value selectionStart(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setBuddy(const Napi::CallbackInfo& info);
|
Napi::Value setBuddy(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value buddy(const Napi::CallbackInfo& info);
|
||||||
Napi::Value clear(const Napi::CallbackInfo& info);
|
Napi::Value clear(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setMovie(const Napi::CallbackInfo& info);
|
Napi::Value setMovie(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setNumDouble(const Napi::CallbackInfo& info);
|
Napi::Value setNumDouble(const Napi::CallbackInfo& info);
|
||||||
|
|||||||
@ -13,13 +13,13 @@
|
|||||||
class DLL_EXPORT QLayoutWrap : public Napi::ObjectWrap<QLayoutWrap> {
|
class DLL_EXPORT QLayoutWrap : public Napi::ObjectWrap<QLayoutWrap> {
|
||||||
QLAYOUT_WRAPPED_METHODS_DECLARATION
|
QLAYOUT_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NLayout> instance;
|
QPointer<QLayout> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void init(Napi::Env env);
|
static void init(Napi::Env env, Napi::Object exports);
|
||||||
QLayoutWrap(const Napi::CallbackInfo& info);
|
QLayoutWrap(const Napi::CallbackInfo& info);
|
||||||
~QLayoutWrap();
|
~QLayoutWrap();
|
||||||
NLayout* getInternalInstance();
|
QLayout* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -11,20 +11,37 @@
|
|||||||
class DLL_EXPORT QLineEditWrap : public Napi::ObjectWrap<QLineEditWrap> {
|
class DLL_EXPORT QLineEditWrap : public Napi::ObjectWrap<QLineEditWrap> {
|
||||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NLineEdit> instance;
|
QPointer<QLineEdit> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QLineEditWrap(const Napi::CallbackInfo& info);
|
QLineEditWrap(const Napi::CallbackInfo& info);
|
||||||
~QLineEditWrap();
|
~QLineEditWrap();
|
||||||
NLineEdit* getInternalInstance();
|
QLineEdit* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value setText(const Napi::CallbackInfo& info);
|
Napi::Value backspace(const Napi::CallbackInfo& info);
|
||||||
Napi::Value text(const Napi::CallbackInfo& info);
|
Napi::Value cursorBackward(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setPlaceholderText(const Napi::CallbackInfo& info);
|
Napi::Value cursorForward(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setReadOnly(const Napi::CallbackInfo& info);
|
Napi::Value cursorPositionAt(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value cursorWordBackward(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value cursorWordForward(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value del(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value deselect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value end(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value home(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value insert(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value selectionEnd(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value selectionLength(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value selectionStart(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setSelection(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setTextMargins(const Napi::CallbackInfo& info);
|
||||||
Napi::Value clear(const Napi::CallbackInfo& info);
|
Napi::Value clear(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setEchoMode(const Napi::CallbackInfo& info);
|
Napi::Value copy(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value cut(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value paste(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value redo(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value selectAll(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value undo(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -11,14 +11,13 @@
|
|||||||
class DLL_EXPORT QListViewWrap : public Napi::ObjectWrap<QListViewWrap> {
|
class DLL_EXPORT QListViewWrap : public Napi::ObjectWrap<QListViewWrap> {
|
||||||
QLISTVIEW_WRAPPED_METHODS_DECLARATION
|
QLISTVIEW_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NListView> instance;
|
QPointer<QListView> 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);
|
||||||
QListViewWrap(const Napi::CallbackInfo& info);
|
QListViewWrap(const Napi::CallbackInfo& info);
|
||||||
~QListViewWrap();
|
~QListViewWrap();
|
||||||
NListView* getInternalInstance();
|
QListView* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -12,13 +12,13 @@
|
|||||||
class DLL_EXPORT QListWidgetWrap : public Napi::ObjectWrap<QListWidgetWrap> {
|
class DLL_EXPORT QListWidgetWrap : public Napi::ObjectWrap<QListWidgetWrap> {
|
||||||
QLISTVIEW_WRAPPED_METHODS_DECLARATION
|
QLISTVIEW_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NListWidget> instance;
|
QPointer<QListWidget> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QListWidgetWrap(const Napi::CallbackInfo& info);
|
QListWidgetWrap(const Napi::CallbackInfo& info);
|
||||||
~QListWidgetWrap();
|
~QListWidgetWrap();
|
||||||
NListWidget* getInternalInstance();
|
QListWidget* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -12,16 +12,17 @@ class DLL_EXPORT QMainWindowWrap : public Napi::ObjectWrap<QMainWindowWrap> {
|
|||||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<NMainWindow> instance;
|
QPointer<QMainWindow> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QMainWindowWrap(const Napi::CallbackInfo& info);
|
QMainWindowWrap(const Napi::CallbackInfo& info);
|
||||||
~QMainWindowWrap();
|
~QMainWindowWrap();
|
||||||
NMainWindow* getInternalInstance();
|
QMainWindow* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
Napi::Value centralWidget(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setCentralWidget(const Napi::CallbackInfo& info);
|
Napi::Value setCentralWidget(const Napi::CallbackInfo& info);
|
||||||
Napi::Value takeCentralWidget(const Napi::CallbackInfo& info);
|
Napi::Value takeCentralWidget(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setMenuBar(const Napi::CallbackInfo& info);
|
Napi::Value setMenuBar(const Napi::CallbackInfo& info);
|
||||||
|
|||||||
@ -17,10 +17,8 @@ class DLL_EXPORT NMenu : public QMenu, public NodeWidget {
|
|||||||
QObject::connect(this, &QMenu::triggered, [=](QAction* action) {
|
QObject::connect(this, &QMenu::triggered, [=](QAction* action) {
|
||||||
Napi::Env env = this->emitOnNode.Env();
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
Napi::HandleScope scope(env);
|
Napi::HandleScope scope(env);
|
||||||
auto actionInstance = QActionWrap::constructor.New(
|
auto instance = WrapperCache::instance.getWrapper(env, action);
|
||||||
{Napi::External<QAction>::New(env, action)});
|
this->emitOnNode.Call({Napi::String::New(env, "triggered"), instance});
|
||||||
this->emitOnNode.Call(
|
|
||||||
{Napi::String::New(env, "triggered"), actionInstance});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -10,13 +10,13 @@
|
|||||||
class DLL_EXPORT QMenuWrap : public Napi::ObjectWrap<QMenuWrap> {
|
class DLL_EXPORT QMenuWrap : public Napi::ObjectWrap<QMenuWrap> {
|
||||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NMenu> instance;
|
QPointer<QMenu> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QMenuWrap(const Napi::CallbackInfo& info);
|
QMenuWrap(const Napi::CallbackInfo& info);
|
||||||
~QMenuWrap();
|
~QMenuWrap();
|
||||||
NMenu* getInternalInstance();
|
QMenu* getInternalInstance();
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value clear(const Napi::CallbackInfo& info);
|
Napi::Value clear(const Napi::CallbackInfo& info);
|
||||||
|
|||||||
@ -10,13 +10,13 @@
|
|||||||
class DLL_EXPORT QMenuBarWrap : public Napi::ObjectWrap<QMenuBarWrap> {
|
class DLL_EXPORT QMenuBarWrap : public Napi::ObjectWrap<QMenuBarWrap> {
|
||||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NMenuBar> instance;
|
QPointer<QMenuBar> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QMenuBarWrap(const Napi::CallbackInfo& info);
|
QMenuBarWrap(const Napi::CallbackInfo& info);
|
||||||
~QMenuBarWrap();
|
~QMenuBarWrap();
|
||||||
NMenuBar* getInternalInstance();
|
QMenuBar* getInternalInstance();
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value addMenu(const Napi::CallbackInfo& info);
|
Napi::Value addMenu(const Napi::CallbackInfo& info);
|
||||||
|
|||||||
@ -11,20 +11,18 @@
|
|||||||
class DLL_EXPORT QMessageBoxWrap : public Napi::ObjectWrap<QMessageBoxWrap> {
|
class DLL_EXPORT QMessageBoxWrap : public Napi::ObjectWrap<QMessageBoxWrap> {
|
||||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
QDIALOG_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NMessageBox> instance;
|
QPointer<QMessageBox> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QMessageBoxWrap(const Napi::CallbackInfo& info);
|
QMessageBoxWrap(const Napi::CallbackInfo& info);
|
||||||
~QMessageBoxWrap();
|
~QMessageBoxWrap();
|
||||||
NMessageBox* getInternalInstance();
|
QMessageBox* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value setDefaultButton(const Napi::CallbackInfo& info);
|
Napi::Value setDefaultButton(const Napi::CallbackInfo& info);
|
||||||
Napi::Value addButton(const Napi::CallbackInfo& info);
|
Napi::Value addButton(const Napi::CallbackInfo& info);
|
||||||
Napi::Value accept(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value done(const Napi::CallbackInfo& info);
|
|
||||||
};
|
};
|
||||||
namespace StaticQMessageBoxWrapMethods {
|
namespace StaticQMessageBoxWrapMethods {
|
||||||
DLL_EXPORT Napi::Value about(const Napi::CallbackInfo& info);
|
DLL_EXPORT Napi::Value about(const Napi::CallbackInfo& info);
|
||||||
|
|||||||
@ -20,38 +20,52 @@ class DLL_EXPORT QPainterWrap : public Napi::ObjectWrap<QPainterWrap> {
|
|||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value drawArc(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value drawText(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value drawImage(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value drawPath(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value strokePath(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value begin(const Napi::CallbackInfo& info);
|
Napi::Value begin(const Napi::CallbackInfo& info);
|
||||||
Napi::Value beginNativePainting(const Napi::CallbackInfo& info);
|
Napi::Value beginNativePainting(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value boundingRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value boundingRectF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value compositionMode(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawArc(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawArcF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawChord(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawChordF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawConvexPolygon(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawConvexPolygonF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawEllipse(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawEllipseF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawImage(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawImageF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawLine(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawLineF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawPath(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawPie(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawPieF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawPoint(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawPointF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawRectF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawText(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value drawTextF(const Napi::CallbackInfo& info);
|
||||||
Napi::Value end(const Napi::CallbackInfo& info);
|
Napi::Value end(const Napi::CallbackInfo& info);
|
||||||
Napi::Value endNativePainting(const Napi::CallbackInfo& info);
|
Napi::Value endNativePainting(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value eraseRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value eraseRectF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value fillRect(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value fillRectF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value opacity(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value restore(const Napi::CallbackInfo& info);
|
||||||
Napi::Value rotate(const Napi::CallbackInfo& info);
|
Napi::Value rotate(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value save(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scale(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setBrush(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setBrushOrigin(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setBrushOriginF(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setCompositionMode(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setFont(const Napi::CallbackInfo& info);
|
Napi::Value setFont(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value setOpacity(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setPen(const Napi::CallbackInfo& info);
|
Napi::Value setPen(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setRenderHint(const Napi::CallbackInfo& info);
|
Napi::Value setRenderHint(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setTransform(const Napi::CallbackInfo& info);
|
Napi::Value setTransform(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setBrush(const Napi::CallbackInfo& info);
|
Napi::Value strokePath(const Napi::CallbackInfo& info);
|
||||||
Napi::Value drawLine(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value drawEllipse(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value drawPie(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value scale(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value translate(const Napi::CallbackInfo& info);
|
Napi::Value translate(const Napi::CallbackInfo& info);
|
||||||
Napi::Value drawConvexPolygon(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value save(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value restore(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value fillRect(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value compositionMode(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value setCompositionMode(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value opacity(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value setOpacity(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value drawPoint(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value drawRect(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value eraseRect(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value boundingRect(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value drawChord(const Napi::CallbackInfo& info);
|
|
||||||
Napi::Value setBrushOrigin(const Napi::CallbackInfo& info);
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -13,13 +13,13 @@ class DLL_EXPORT QPlainTextEditWrap
|
|||||||
: public Napi::ObjectWrap<QPlainTextEditWrap> {
|
: public Napi::ObjectWrap<QPlainTextEditWrap> {
|
||||||
QABSTRACTSCROLLAREA_WRAPPED_METHODS_DECLARATION
|
QABSTRACTSCROLLAREA_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NPlainTextEdit> instance;
|
QPointer<QPlainTextEdit> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QPlainTextEditWrap(const Napi::CallbackInfo &info);
|
QPlainTextEditWrap(const Napi::CallbackInfo &info);
|
||||||
~QPlainTextEditWrap();
|
~QPlainTextEditWrap();
|
||||||
NPlainTextEdit *getInternalInstance();
|
QPlainTextEdit *getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QProgressBarWrap : public Napi::ObjectWrap<QProgressBarWrap> {
|
class DLL_EXPORT QProgressBarWrap : public Napi::ObjectWrap<QProgressBarWrap> {
|
||||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NProgressBar> instance;
|
QPointer<QProgressBar> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QProgressBarWrap(const Napi::CallbackInfo& info);
|
QProgressBarWrap(const Napi::CallbackInfo& info);
|
||||||
~QProgressBarWrap();
|
~QProgressBarWrap();
|
||||||
NProgressBar* getInternalInstance();
|
QProgressBar* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -12,13 +12,13 @@ class DLL_EXPORT QProgressDialogWrap
|
|||||||
: public Napi::ObjectWrap<QProgressDialogWrap> {
|
: public Napi::ObjectWrap<QProgressDialogWrap> {
|
||||||
QDIALOG_WRAPPED_METHODS_DECLARATION
|
QDIALOG_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NProgressDialog> instance;
|
QPointer<QProgressDialog> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QProgressDialogWrap(const Napi::CallbackInfo& info);
|
QProgressDialogWrap(const Napi::CallbackInfo& info);
|
||||||
~QProgressDialogWrap();
|
~QProgressDialogWrap();
|
||||||
NProgressDialog* getInternalInstance();
|
QProgressDialog* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -12,17 +12,17 @@
|
|||||||
class DLL_EXPORT QPushButtonWrap : public Napi::ObjectWrap<QPushButtonWrap> {
|
class DLL_EXPORT QPushButtonWrap : public Napi::ObjectWrap<QPushButtonWrap> {
|
||||||
QABSTRACTBUTTON_WRAPPED_METHODS_DECLARATION
|
QABSTRACTBUTTON_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NPushButton> instance;
|
QPointer<QPushButton> 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);
|
||||||
QPushButtonWrap(const Napi::CallbackInfo& info);
|
QPushButtonWrap(const Napi::CallbackInfo& info);
|
||||||
~QPushButtonWrap();
|
~QPushButtonWrap();
|
||||||
NPushButton* getInternalInstance();
|
QPushButton* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value setMenu(const Napi::CallbackInfo& info);
|
Napi::Value setMenu(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value menu(const Napi::CallbackInfo& info);
|
||||||
Napi::Value showMenu(const Napi::CallbackInfo& info);
|
Napi::Value showMenu(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -13,14 +13,13 @@ class DLL_EXPORT QRadioButtonWrap : public Napi::ObjectWrap<QRadioButtonWrap> {
|
|||||||
QABSTRACTBUTTON_WRAPPED_METHODS_DECLARATION
|
QABSTRACTBUTTON_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<NRadioButton> instance;
|
QPointer<QRadioButton> 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);
|
||||||
QRadioButtonWrap(const Napi::CallbackInfo& info);
|
QRadioButtonWrap(const Napi::CallbackInfo& info);
|
||||||
~QRadioButtonWrap();
|
~QRadioButtonWrap();
|
||||||
NRadioButton* getInternalInstance();
|
QRadioButton* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -11,20 +11,20 @@
|
|||||||
class DLL_EXPORT QScrollAreaWrap : public Napi::ObjectWrap<QScrollAreaWrap> {
|
class DLL_EXPORT QScrollAreaWrap : public Napi::ObjectWrap<QScrollAreaWrap> {
|
||||||
QABSTRACTSCROLLAREA_WRAPPED_METHODS_DECLARATION
|
QABSTRACTSCROLLAREA_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NScrollArea> instance;
|
QPointer<QScrollArea> instance;
|
||||||
YGNodeRef scrollNode;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QScrollAreaWrap(const Napi::CallbackInfo& info);
|
QScrollAreaWrap(const Napi::CallbackInfo& info);
|
||||||
~QScrollAreaWrap();
|
~QScrollAreaWrap();
|
||||||
NScrollArea* getInternalInstance();
|
QScrollArea* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value ensureVisible(const Napi::CallbackInfo& info);
|
Napi::Value ensureVisible(const Napi::CallbackInfo& info);
|
||||||
Napi::Value ensureWidgetVisible(const Napi::CallbackInfo& info);
|
Napi::Value ensureWidgetVisible(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setWidget(const Napi::CallbackInfo& info);
|
Napi::Value setWidget(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value widget(const Napi::CallbackInfo& info);
|
||||||
Napi::Value takeWidget(const Napi::CallbackInfo& info);
|
Napi::Value takeWidget(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setViewportMargins(const Napi::CallbackInfo& info);
|
Napi::Value setViewportMargins(const Napi::CallbackInfo& info);
|
||||||
Napi::Value viewportMargins(const Napi::CallbackInfo& info);
|
Napi::Value viewportMargins(const Napi::CallbackInfo& info);
|
||||||
|
|||||||
@ -12,13 +12,13 @@
|
|||||||
class DLL_EXPORT QScrollBarWrap : public Napi::ObjectWrap<QScrollBarWrap> {
|
class DLL_EXPORT QScrollBarWrap : public Napi::ObjectWrap<QScrollBarWrap> {
|
||||||
QABSTRACTSLIDER_WRAPPED_METHODS_DECLARATION
|
QABSTRACTSLIDER_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NScrollBar> instance;
|
QPointer<QScrollBar> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QScrollBarWrap(const Napi::CallbackInfo& info);
|
QScrollBarWrap(const Napi::CallbackInfo& info);
|
||||||
~QScrollBarWrap();
|
~QScrollBarWrap();
|
||||||
NScrollBar* getInternalInstance();
|
QScrollBar* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QShortcutWrap : public Napi::ObjectWrap<QShortcutWrap> {
|
class DLL_EXPORT QShortcutWrap : public Napi::ObjectWrap<QShortcutWrap> {
|
||||||
QOBJECT_WRAPPED_METHODS_DECLARATION
|
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NShortcut> instance;
|
QPointer<QShortcut> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QShortcutWrap(const Napi::CallbackInfo& info);
|
QShortcutWrap(const Napi::CallbackInfo& info);
|
||||||
~QShortcutWrap();
|
~QShortcutWrap();
|
||||||
NShortcut* getInternalInstance();
|
QShortcut* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -12,13 +12,13 @@
|
|||||||
class DLL_EXPORT QSliderWrap : public Napi::ObjectWrap<QSliderWrap> {
|
class DLL_EXPORT QSliderWrap : public Napi::ObjectWrap<QSliderWrap> {
|
||||||
QABSTRACTSLIDER_WRAPPED_METHODS_DECLARATION
|
QABSTRACTSLIDER_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NSlider> instance;
|
QPointer<QSlider> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QSliderWrap(const Napi::CallbackInfo& info);
|
QSliderWrap(const Napi::CallbackInfo& info);
|
||||||
~QSliderWrap();
|
~QSliderWrap();
|
||||||
NSlider* getInternalInstance();
|
QSlider* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QSpinBoxWrap : public Napi::ObjectWrap<QSpinBoxWrap> {
|
class DLL_EXPORT QSpinBoxWrap : public Napi::ObjectWrap<QSpinBoxWrap> {
|
||||||
QABSTRACTSPINBOX_WRAPPED_METHODS_DECLARATION
|
QABSTRACTSPINBOX_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NSpinBox> instance;
|
QPointer<QSpinBox> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QSpinBoxWrap(const Napi::CallbackInfo &info);
|
QSpinBoxWrap(const Napi::CallbackInfo &info);
|
||||||
~QSpinBoxWrap();
|
~QSpinBoxWrap();
|
||||||
NSpinBox *getInternalInstance();
|
QSpinBox *getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QSplitterWrap : public Napi::ObjectWrap<QSplitterWrap> {
|
class DLL_EXPORT QSplitterWrap : public Napi::ObjectWrap<QSplitterWrap> {
|
||||||
QFRAME_WRAPPED_METHODS_DECLARATION
|
QFRAME_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NSplitter> instance;
|
QPointer<QSplitter> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QSplitterWrap(const Napi::CallbackInfo& info);
|
QSplitterWrap(const Napi::CallbackInfo& info);
|
||||||
~QSplitterWrap();
|
~QSplitterWrap();
|
||||||
NSplitter* getInternalInstance();
|
QSplitter* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -12,13 +12,13 @@ class DLL_EXPORT QStackedWidgetWrap
|
|||||||
: public Napi::ObjectWrap<QStackedWidgetWrap> {
|
: public Napi::ObjectWrap<QStackedWidgetWrap> {
|
||||||
QFRAME_WRAPPED_METHODS_DECLARATION
|
QFRAME_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NStackedWidget> instance;
|
QPointer<QStackedWidget> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QStackedWidgetWrap(const Napi::CallbackInfo &info);
|
QStackedWidgetWrap(const Napi::CallbackInfo &info);
|
||||||
~QStackedWidgetWrap();
|
~QStackedWidgetWrap();
|
||||||
NStackedWidget *getInternalInstance();
|
QStackedWidget *getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -10,13 +10,13 @@
|
|||||||
class DLL_EXPORT QStandardItemModelWrap
|
class DLL_EXPORT QStandardItemModelWrap
|
||||||
: public Napi::ObjectWrap<QStandardItemModelWrap> {
|
: public Napi::ObjectWrap<QStandardItemModelWrap> {
|
||||||
private:
|
private:
|
||||||
QPointer<NStandardItemModel> instance;
|
QPointer<QStandardItemModel> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QStandardItemModelWrap(const Napi::CallbackInfo& info);
|
QStandardItemModelWrap(const Napi::CallbackInfo& info);
|
||||||
~QStandardItemModelWrap();
|
~QStandardItemModelWrap();
|
||||||
NStandardItemModel* getInternalInstance();
|
QStandardItemModel* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class DLL_EXPORT QStatusBarWrap : public Napi::ObjectWrap<QStatusBarWrap> {
|
|||||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<NStatusBar> instance;
|
QPointer<QStatusBar> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
@ -22,7 +22,7 @@ class DLL_EXPORT QStatusBarWrap : public Napi::ObjectWrap<QStatusBarWrap> {
|
|||||||
QStatusBarWrap(const Napi::CallbackInfo &info);
|
QStatusBarWrap(const Napi::CallbackInfo &info);
|
||||||
~QStatusBarWrap();
|
~QStatusBarWrap();
|
||||||
|
|
||||||
NStatusBar *getInternalInstance();
|
QStatusBar *getInternalInstance();
|
||||||
|
|
||||||
// Wrapped methods
|
// Wrapped methods
|
||||||
Napi::Value addPermanentWidget(const Napi::CallbackInfo &info);
|
Napi::Value addPermanentWidget(const Napi::CallbackInfo &info);
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QSvgWidgetWrap : public Napi::ObjectWrap<QSvgWidgetWrap> {
|
class DLL_EXPORT QSvgWidgetWrap : public Napi::ObjectWrap<QSvgWidgetWrap> {
|
||||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NSvgWidget> instance;
|
QPointer<QSvgWidget> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QSvgWidgetWrap(const Napi::CallbackInfo& info);
|
QSvgWidgetWrap(const Napi::CallbackInfo& info);
|
||||||
~QSvgWidgetWrap();
|
~QSvgWidgetWrap();
|
||||||
NSvgWidget* getInternalInstance();
|
QSvgWidget* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -12,13 +12,13 @@ class DLL_EXPORT QSystemTrayIconWrap
|
|||||||
: public Napi::ObjectWrap<QSystemTrayIconWrap> {
|
: public Napi::ObjectWrap<QSystemTrayIconWrap> {
|
||||||
QOBJECT_WRAPPED_METHODS_DECLARATION
|
QOBJECT_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NSystemTrayIcon> instance;
|
QPointer<QSystemTrayIcon> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QSystemTrayIconWrap(const Napi::CallbackInfo& info);
|
QSystemTrayIconWrap(const Napi::CallbackInfo& info);
|
||||||
~QSystemTrayIconWrap();
|
~QSystemTrayIconWrap();
|
||||||
NSystemTrayIcon* getInternalInstance();
|
QSystemTrayIcon* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -11,14 +11,13 @@
|
|||||||
class DLL_EXPORT QTabBarWrap : public Napi::ObjectWrap<QTabBarWrap> {
|
class DLL_EXPORT QTabBarWrap : public Napi::ObjectWrap<QTabBarWrap> {
|
||||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NTabBar> instance;
|
QPointer<QTabBar> 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);
|
||||||
QTabBarWrap(const Napi::CallbackInfo& info);
|
QTabBarWrap(const Napi::CallbackInfo& info);
|
||||||
~QTabBarWrap();
|
~QTabBarWrap();
|
||||||
NTabBar* getInternalInstance();
|
QTabBar* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QTabWidgetWrap : public Napi::ObjectWrap<QTabWidgetWrap> {
|
class DLL_EXPORT QTabWidgetWrap : public Napi::ObjectWrap<QTabWidgetWrap> {
|
||||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NTabWidget> instance;
|
QPointer<QTabWidget> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QTabWidgetWrap(const Napi::CallbackInfo &info);
|
QTabWidgetWrap(const Napi::CallbackInfo &info);
|
||||||
~QTabWidgetWrap();
|
~QTabWidgetWrap();
|
||||||
NTabWidget *getInternalInstance();
|
QTabWidget *getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
@ -31,4 +31,5 @@ class DLL_EXPORT QTabWidgetWrap : public Napi::ObjectWrap<QTabWidgetWrap> {
|
|||||||
Napi::Value setTabsClosable(const Napi::CallbackInfo &info);
|
Napi::Value setTabsClosable(const Napi::CallbackInfo &info);
|
||||||
Napi::Value setTabText(const Napi::CallbackInfo &info);
|
Napi::Value setTabText(const Napi::CallbackInfo &info);
|
||||||
Napi::Value setTabIcon(const Napi::CallbackInfo &info);
|
Napi::Value setTabIcon(const Napi::CallbackInfo &info);
|
||||||
|
Napi::Value widget(const Napi::CallbackInfo &info);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -181,15 +181,13 @@
|
|||||||
Napi::Value horizontalHeader(const Napi::CallbackInfo& info) { \
|
Napi::Value horizontalHeader(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
auto header = this->instance->horizontalHeader(); \
|
auto header = this->instance->horizontalHeader(); \
|
||||||
auto instance = QHeaderViewWrap::constructor.New( \
|
auto instance = WrapperCache::instance.getWrapper(env, header); \
|
||||||
{Napi::External<QHeaderView>::New(env, header)}); \
|
|
||||||
return instance; \
|
return instance; \
|
||||||
} \
|
} \
|
||||||
Napi::Value verticalHeader(const Napi::CallbackInfo& info) { \
|
Napi::Value verticalHeader(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
auto header = this->instance->verticalHeader(); \
|
auto header = this->instance->verticalHeader(); \
|
||||||
auto instance = QHeaderViewWrap::constructor.New( \
|
auto instance = WrapperCache::instance.getWrapper(env, header); \
|
||||||
{Napi::External<QHeaderView>::New(env, header)}); \
|
|
||||||
return instance; \
|
return instance; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,14 +11,13 @@
|
|||||||
class DLL_EXPORT QTableViewWrap : public Napi::ObjectWrap<QTableViewWrap> {
|
class DLL_EXPORT QTableViewWrap : public Napi::ObjectWrap<QTableViewWrap> {
|
||||||
QTABLEVIEW_WRAPPED_METHODS_DECLARATION
|
QTABLEVIEW_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NTableView> instance;
|
QPointer<QTableView> 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);
|
||||||
QTableViewWrap(const Napi::CallbackInfo& info);
|
QTableViewWrap(const Napi::CallbackInfo& info);
|
||||||
~QTableViewWrap();
|
~QTableViewWrap();
|
||||||
NTableView* getInternalInstance();
|
QTableView* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QTableWidgetWrap : public Napi::ObjectWrap<QTableWidgetWrap> {
|
class DLL_EXPORT QTableWidgetWrap : public Napi::ObjectWrap<QTableWidgetWrap> {
|
||||||
QABSTRACTSCROLLAREA_WRAPPED_METHODS_DECLARATION
|
QABSTRACTSCROLLAREA_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NTableWidget> instance;
|
QPointer<QTableWidget> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QTableWidgetWrap(const Napi::CallbackInfo& info);
|
QTableWidgetWrap(const Napi::CallbackInfo& info);
|
||||||
~QTableWidgetWrap();
|
~QTableWidgetWrap();
|
||||||
NTableWidget* getInternalInstance();
|
QTableWidget* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
@ -80,4 +80,8 @@ class DLL_EXPORT QTableWidgetWrap : public Napi::ObjectWrap<QTableWidgetWrap> {
|
|||||||
Napi::Value setRowCount(const Napi::CallbackInfo& info);
|
Napi::Value setRowCount(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setSortingEnabled(const Napi::CallbackInfo& info);
|
Napi::Value setSortingEnabled(const Napi::CallbackInfo& info);
|
||||||
Napi::Value isSortingEnabled(const Napi::CallbackInfo& info);
|
Napi::Value isSortingEnabled(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value clearSelection(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value selectAll(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scrollToBottom(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value scrollToTop(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -38,14 +38,13 @@ class DLL_EXPORT NTextBrowser : public QTextBrowser, public NodeWidget {
|
|||||||
this->emitOnNode.Call({Napi::String::New(env, "forwardAvailable"),
|
this->emitOnNode.Call({Napi::String::New(env, "forwardAvailable"),
|
||||||
Napi::Boolean::New(env, available)});
|
Napi::Boolean::New(env, available)});
|
||||||
});
|
});
|
||||||
QObject::connect(
|
QObject::connect(this, &QTextBrowser::highlighted, [=](const QUrl& link) {
|
||||||
this, QOverload<const QString&>::of(&QTextBrowser::highlighted),
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
[=](const QString& link) {
|
Napi::HandleScope scope(env);
|
||||||
Napi::Env env = this->emitOnNode.Env();
|
this->emitOnNode.Call(
|
||||||
Napi::HandleScope scope(env);
|
{Napi::String::New(env, "highlighted"),
|
||||||
this->emitOnNode.Call({Napi::String::New(env, "highlighted"),
|
Napi::String::New(env, link.toString().toStdString())});
|
||||||
Napi::String::New(env, link.toStdString())});
|
});
|
||||||
});
|
|
||||||
QObject::connect(this, &QTextBrowser::historyChanged, [=]() {
|
QObject::connect(this, &QTextBrowser::historyChanged, [=]() {
|
||||||
Napi::Env env = this->emitOnNode.Env();
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
Napi::HandleScope scope(env);
|
Napi::HandleScope scope(env);
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QTextBrowserWrap : public Napi::ObjectWrap<QTextBrowserWrap> {
|
class DLL_EXPORT QTextBrowserWrap : public Napi::ObjectWrap<QTextBrowserWrap> {
|
||||||
QTEXTEDIT_WRAPPED_METHODS_DECLARATION
|
QTEXTEDIT_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NTextBrowser> instance;
|
QPointer<QTextBrowser> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QTextBrowserWrap(const Napi::CallbackInfo& info);
|
QTextBrowserWrap(const Napi::CallbackInfo& info);
|
||||||
~QTextBrowserWrap();
|
~QTextBrowserWrap();
|
||||||
NTextBrowser* getInternalInstance();
|
QTextBrowser* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
class DLL_EXPORT QTextEditWrap : public Napi::ObjectWrap<QTextEditWrap> {
|
class DLL_EXPORT QTextEditWrap : public Napi::ObjectWrap<QTextEditWrap> {
|
||||||
QTEXTEDIT_WRAPPED_METHODS_DECLARATION
|
QTEXTEDIT_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NTextEdit> instance;
|
QPointer<QTextEdit> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QTextEditWrap(const Napi::CallbackInfo& info);
|
QTextEditWrap(const Napi::CallbackInfo& info);
|
||||||
~QTextEditWrap();
|
~QTextEditWrap();
|
||||||
NTextEdit* getInternalInstance();
|
QTextEdit* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -12,13 +12,13 @@
|
|||||||
class DLL_EXPORT QTimeEditWrap : public Napi::ObjectWrap<QTimeEditWrap> {
|
class DLL_EXPORT QTimeEditWrap : public Napi::ObjectWrap<QTimeEditWrap> {
|
||||||
QDATETIMEEDIT_WRAPPED_METHODS_DECLARATION
|
QDATETIMEEDIT_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NTimeEdit> instance;
|
QPointer<QTimeEdit> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
QTimeEditWrap(const Napi::CallbackInfo &info);
|
QTimeEditWrap(const Napi::CallbackInfo &info);
|
||||||
~QTimeEditWrap();
|
~QTimeEditWrap();
|
||||||
NTimeEdit *getInternalInstance();
|
QTimeEdit *getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
|
|||||||
@ -21,11 +21,7 @@ class DLL_EXPORT NToolButton : public QToolButton, public NodeWidget {
|
|||||||
QObject::connect(this, &QToolButton::triggered, [=](QAction* action) {
|
QObject::connect(this, &QToolButton::triggered, [=](QAction* action) {
|
||||||
Napi::Env env = this->emitOnNode.Env();
|
Napi::Env env = this->emitOnNode.Env();
|
||||||
Napi::HandleScope scope(env);
|
Napi::HandleScope scope(env);
|
||||||
|
auto instance = WrapperCache::instance.getWrapper(env, action);
|
||||||
// disable deletion of the native instance for these by passing true
|
|
||||||
auto instance = QActionWrap::constructor.New(
|
|
||||||
{Napi::External<QAction>::New(env, action),
|
|
||||||
Napi::Boolean::New(env, true)});
|
|
||||||
this->emitOnNode.Call({Napi::String::New(env, "triggered"), instance});
|
this->emitOnNode.Call({Napi::String::New(env, "triggered"), instance});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,18 +12,18 @@
|
|||||||
class DLL_EXPORT QToolButtonWrap : public Napi::ObjectWrap<QToolButtonWrap> {
|
class DLL_EXPORT QToolButtonWrap : public Napi::ObjectWrap<QToolButtonWrap> {
|
||||||
QABSTRACTBUTTON_WRAPPED_METHODS_DECLARATION
|
QABSTRACTBUTTON_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NToolButton> instance;
|
QPointer<QToolButton> 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);
|
||||||
QToolButtonWrap(const Napi::CallbackInfo& info);
|
QToolButtonWrap(const Napi::CallbackInfo& info);
|
||||||
~QToolButtonWrap();
|
~QToolButtonWrap();
|
||||||
NToolButton* getInternalInstance();
|
QToolButton* getInternalInstance();
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
// wrapped methods
|
// wrapped methods
|
||||||
Napi::Value setMenu(const Napi::CallbackInfo& info);
|
Napi::Value setMenu(const Napi::CallbackInfo& info);
|
||||||
Napi::Value setDefaultAction(const Napi::CallbackInfo& info);
|
Napi::Value setDefaultAction(const Napi::CallbackInfo& info);
|
||||||
Napi::Value showMenu(const Napi::CallbackInfo& info);
|
Napi::Value showMenu(const Napi::CallbackInfo& info);
|
||||||
|
Napi::Value defaultAction(const Napi::CallbackInfo& info);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
class DLL_EXPORT QTreeWidgetWrap : public Napi::ObjectWrap<QTreeWidgetWrap> {
|
class DLL_EXPORT QTreeWidgetWrap : public Napi::ObjectWrap<QTreeWidgetWrap> {
|
||||||
QWIDGET_WRAPPED_METHODS_DECLARATION
|
QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
private:
|
private:
|
||||||
QPointer<NTreeWidget> instance;
|
QPointer<QTreeWidget> instance;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
static Napi::Object init(Napi::Env env, Napi::Object exports);
|
||||||
@ -20,7 +20,7 @@ class DLL_EXPORT QTreeWidgetWrap : public Napi::ObjectWrap<QTreeWidgetWrap> {
|
|||||||
|
|
||||||
~QTreeWidgetWrap();
|
~QTreeWidgetWrap();
|
||||||
|
|
||||||
NTreeWidget *getInternalInstance();
|
QTreeWidget *getInternalInstance();
|
||||||
|
|
||||||
// class constructor
|
// class constructor
|
||||||
static Napi::FunctionReference constructor;
|
static Napi::FunctionReference constructor;
|
||||||
|
|||||||
@ -16,11 +16,15 @@ class DLL_EXPORT NWidget : public QWidget, public NodeWidget {
|
|||||||
// https://doc.qt.io/qt-5/stylesheet-reference.html
|
// https://doc.qt.io/qt-5/stylesheet-reference.html
|
||||||
void paintEvent(QPaintEvent* e) override {
|
void paintEvent(QPaintEvent* e) override {
|
||||||
QStyleOption opt;
|
QStyleOption opt;
|
||||||
opt.init(this);
|
opt.initFrom(this);
|
||||||
QPainter p(this);
|
QPainter p(this);
|
||||||
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||||
QWidget::paintEvent(e);
|
QWidget::paintEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void connectSignalsToEventEmitter() { QWIDGET_SIGNALS }
|
virtual void connectSignalsToEventEmitter() { QWIDGET_SIGNALS }
|
||||||
|
|
||||||
|
void _protected_updateMicroFocus(Qt::InputMethodQuery query) {
|
||||||
|
updateMicroFocus(query);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,9 +6,11 @@
|
|||||||
|
|
||||||
#include "QtCore/QObject/qobject_wrap.h"
|
#include "QtCore/QObject/qobject_wrap.h"
|
||||||
#include "QtCore/QPoint/qpoint_wrap.h"
|
#include "QtCore/QPoint/qpoint_wrap.h"
|
||||||
|
#include "QtCore/QRect/qrect_wrap.h"
|
||||||
#include "QtCore/QSize/qsize_wrap.h"
|
#include "QtCore/QSize/qsize_wrap.h"
|
||||||
#include "QtGui/QCursor/qcursor_wrap.h"
|
#include "QtGui/QCursor/qcursor_wrap.h"
|
||||||
#include "QtGui/QIcon/qicon_wrap.h"
|
#include "QtGui/QIcon/qicon_wrap.h"
|
||||||
|
#include "QtGui/QPixmap/qpixmap_wrap.h"
|
||||||
#include "QtGui/QStyle/qstyle_wrap.h"
|
#include "QtGui/QStyle/qstyle_wrap.h"
|
||||||
#include "QtGui/QWindow/qwindow_wrap.h"
|
#include "QtGui/QWindow/qwindow_wrap.h"
|
||||||
#include "QtWidgets/QAction/qaction_wrap.h"
|
#include "QtWidgets/QAction/qaction_wrap.h"
|
||||||
@ -58,6 +60,19 @@
|
|||||||
bool hasClosed = this->instance->close(); \
|
bool hasClosed = this->instance->close(); \
|
||||||
return Napi::Boolean::New(env, hasClosed); \
|
return Napi::Boolean::New(env, hasClosed); \
|
||||||
} \
|
} \
|
||||||
|
Napi::Value mapFrom(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
Napi::Object widgetObject = info[0].As<Napi::Object>(); \
|
||||||
|
NodeWidgetWrap* widgetWrap = \
|
||||||
|
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(widgetObject); \
|
||||||
|
Napi::Object posObject = info[1].As<Napi::Object>(); \
|
||||||
|
QPointWrap* posWrap = Napi::ObjectWrap<QPointWrap>::Unwrap(posObject); \
|
||||||
|
QPoint pt = this->instance->mapFrom(widgetWrap->getInternalInstance(), \
|
||||||
|
*posWrap->getInternalInstance()); \
|
||||||
|
auto instance = QPointWrap::constructor.New( \
|
||||||
|
{Napi::External<QPoint>::New(env, new QPoint(pt.x(), pt.y()))}); \
|
||||||
|
return instance; \
|
||||||
|
} \
|
||||||
Napi::Value mapFromGlobal(const Napi::CallbackInfo& info) { \
|
Napi::Value mapFromGlobal(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::Object posObject = info[0].As<Napi::Object>(); \
|
Napi::Object posObject = info[0].As<Napi::Object>(); \
|
||||||
@ -96,6 +111,19 @@
|
|||||||
{Napi::External<QPoint>::New(env, new QPoint(pt.x(), pt.y()))}); \
|
{Napi::External<QPoint>::New(env, new QPoint(pt.x(), pt.y()))}); \
|
||||||
return instance; \
|
return instance; \
|
||||||
} \
|
} \
|
||||||
|
Napi::Value mapTo(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
Napi::Object widgetObject = info[0].As<Napi::Object>(); \
|
||||||
|
NodeWidgetWrap* widgetWrap = \
|
||||||
|
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(widgetObject); \
|
||||||
|
Napi::Object posObject = info[1].As<Napi::Object>(); \
|
||||||
|
QPointWrap* posWrap = Napi::ObjectWrap<QPointWrap>::Unwrap(posObject); \
|
||||||
|
QPoint pt = this->instance->mapTo(widgetWrap->getInternalInstance(), \
|
||||||
|
*posWrap->getInternalInstance()); \
|
||||||
|
auto instance = QPointWrap::constructor.New( \
|
||||||
|
{Napi::External<QPoint>::New(env, new QPoint(pt.x(), pt.y()))}); \
|
||||||
|
return instance; \
|
||||||
|
} \
|
||||||
Napi::Value setLayout(const Napi::CallbackInfo& info) { \
|
Napi::Value setLayout(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
Napi::Object layoutObject = info[0].As<Napi::Object>(); \
|
Napi::Object layoutObject = info[0].As<Napi::Object>(); \
|
||||||
@ -401,7 +429,7 @@
|
|||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
QWindow* window = this->instance->windowHandle(); \
|
QWindow* window = this->instance->windowHandle(); \
|
||||||
if (window) { \
|
if (window) { \
|
||||||
return WrapperCache::instance.get<QWindow, QWindowWrap>(env, window); \
|
return WrapperCache::instance.getWrapper(env, window, true); \
|
||||||
} else { \
|
} else { \
|
||||||
return env.Null(); \
|
return env.Null(); \
|
||||||
} \
|
} \
|
||||||
@ -428,6 +456,17 @@
|
|||||||
this->instance->clearMask(); \
|
this->instance->clearMask(); \
|
||||||
return env.Null(); \
|
return env.Null(); \
|
||||||
} \
|
} \
|
||||||
|
Napi::Value grab(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
Napi::Object boundingRectObject = info[0].As<Napi::Object>(); \
|
||||||
|
QRectWrap* boundingRectWrap = \
|
||||||
|
Napi::ObjectWrap<QRectWrap>::Unwrap(boundingRectObject); \
|
||||||
|
auto pixmap = \
|
||||||
|
this->instance->grab(*boundingRectWrap->getInternalInstance()); \
|
||||||
|
auto instance = QPixmapWrap::constructor.New( \
|
||||||
|
{Napi::External<QPixmap>::New(env, new QPixmap(pixmap))}); \
|
||||||
|
return instance; \
|
||||||
|
} \
|
||||||
Napi::Value grabKeyboard(const Napi::CallbackInfo& info) { \
|
Napi::Value grabKeyboard(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
this->instance->grabKeyboard(); \
|
this->instance->grabKeyboard(); \
|
||||||
@ -533,6 +572,209 @@
|
|||||||
int w = info[0].As<Napi::Number>().Int32Value(); \
|
int w = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
int result = this->instance->heightForWidth(w); \
|
int result = this->instance->heightForWidth(w); \
|
||||||
return Napi::Number::New(env, result); \
|
return Napi::Number::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value winId(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
WId result = this->instance->winId(); \
|
||||||
|
return Napi::BigInt::New(env, static_cast<uint64_t>(result)); \
|
||||||
|
} \
|
||||||
|
Napi::Value contentsRect(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QRect result = this->instance->contentsRect(); \
|
||||||
|
auto resultInstance = QRectWrap::constructor.New( \
|
||||||
|
{Napi::External<QRect>::New(env, new QRect(result))}); \
|
||||||
|
return resultInstance; \
|
||||||
|
} \
|
||||||
|
Napi::Value childAt(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int x = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
|
int y = info[1].As<Napi::Number>().Int32Value(); \
|
||||||
|
QWidget* result = this->instance->childAt(x, y); \
|
||||||
|
if (result) { \
|
||||||
|
return WrapperCache::instance.getWrapper(env, \
|
||||||
|
static_cast<QObject*>(result)); \
|
||||||
|
} else { \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
Napi::Value focusProxy(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QWidget* result = this->instance->focusProxy(); \
|
||||||
|
if (result) { \
|
||||||
|
return WrapperCache::instance.getWrapper(env, \
|
||||||
|
static_cast<QObject*>(result)); \
|
||||||
|
} else { \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
Napi::Value setFocusProxy(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
Napi::Object widgetObject = info[0].As<Napi::Object>(); \
|
||||||
|
NodeWidgetWrap* widgetWrap = \
|
||||||
|
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(widgetObject); \
|
||||||
|
this->instance->setFocusProxy(widgetWrap->getInternalInstance()); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value focusWidget(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QWidget* result = this->instance->focusWidget(); \
|
||||||
|
if (result) { \
|
||||||
|
return WrapperCache::instance.getWrapper(env, \
|
||||||
|
static_cast<QObject*>(result)); \
|
||||||
|
} else { \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
Napi::Value nativeParentWidget(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QWidget* result = this->instance->nativeParentWidget(); \
|
||||||
|
if (result) { \
|
||||||
|
return WrapperCache::instance.getWrapper(env, \
|
||||||
|
static_cast<QObject*>(result)); \
|
||||||
|
} else { \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
Napi::Value nextInFocusChain(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QWidget* result = this->instance->nextInFocusChain(); \
|
||||||
|
if (result) { \
|
||||||
|
return WrapperCache::instance.getWrapper(env, \
|
||||||
|
static_cast<QObject*>(result)); \
|
||||||
|
} else { \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
Napi::Value parentWidget(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QWidget* result = this->instance->parentWidget(); \
|
||||||
|
if (result) { \
|
||||||
|
return WrapperCache::instance.getWrapper(env, \
|
||||||
|
static_cast<QObject*>(result)); \
|
||||||
|
} else { \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
Napi::Value previousInFocusChain(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QWidget* result = this->instance->previousInFocusChain(); \
|
||||||
|
if (result) { \
|
||||||
|
return WrapperCache::instance.getWrapper(env, \
|
||||||
|
static_cast<QObject*>(result)); \
|
||||||
|
} else { \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
Napi::Value window(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
QWidget* result = this->instance->window(); \
|
||||||
|
if (result) { \
|
||||||
|
return WrapperCache::instance.getWrapper(env, \
|
||||||
|
static_cast<QObject*>(result)); \
|
||||||
|
} else { \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
Napi::Value isAncestorOf(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
Napi::Object childWidgetObject = info[0].As<Napi::Object>(); \
|
||||||
|
NodeWidgetWrap* childWidgetWrap = \
|
||||||
|
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(childWidgetObject); \
|
||||||
|
QWidget* child = childWidgetWrap->getInternalInstance(); \
|
||||||
|
bool result = this->instance->isAncestorOf(child); \
|
||||||
|
return Napi::Boolean::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value isEnabledTo(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
Napi::Object ancestorWidgetObject = info[0].As<Napi::Object>(); \
|
||||||
|
NodeWidgetWrap* ancestorWidgetWrap = \
|
||||||
|
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(ancestorWidgetObject); \
|
||||||
|
QWidget* ancestor = ancestorWidgetWrap->getInternalInstance(); \
|
||||||
|
bool result = this->instance->isEnabledTo(ancestor); \
|
||||||
|
return Napi::Boolean::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value isVisibleTo(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
Napi::Object ancestorWidgetObject = info[0].As<Napi::Object>(); \
|
||||||
|
NodeWidgetWrap* ancestorWidgetWrap = \
|
||||||
|
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(ancestorWidgetObject); \
|
||||||
|
QWidget* ancestor = ancestorWidgetWrap->getInternalInstance(); \
|
||||||
|
bool result = this->instance->isVisibleTo(ancestor); \
|
||||||
|
return Napi::Boolean::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value stackUnder(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
Napi::Object wWidgetObject = info[0].As<Napi::Object>(); \
|
||||||
|
NodeWidgetWrap* wWidgetWrap = \
|
||||||
|
Napi::ObjectWrap<NodeWidgetWrap>::Unwrap(wWidgetObject); \
|
||||||
|
QWidget* w = wWidgetWrap->getInternalInstance(); \
|
||||||
|
this->instance->stackUnder(w); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value colorCount(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int result = this->instance->colorCount(); \
|
||||||
|
return Napi::Number::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value depth(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int result = this->instance->depth(); \
|
||||||
|
return Napi::Number::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value devicePixelRatio(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
qreal result = this->instance->devicePixelRatio(); \
|
||||||
|
return Napi::Number::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value devicePixelRatioF(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
qreal result = this->instance->devicePixelRatioF(); \
|
||||||
|
return Napi::Number::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value heightMM(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int result = this->instance->heightMM(); \
|
||||||
|
return Napi::Number::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value logicalDpiX(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int result = this->instance->logicalDpiX(); \
|
||||||
|
return Napi::Number::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value logicalDpiY(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int result = this->instance->logicalDpiY(); \
|
||||||
|
return Napi::Number::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value paintingActive(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
bool result = this->instance->paintingActive(); \
|
||||||
|
return Napi::Boolean::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value physicalDpiX(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int result = this->instance->physicalDpiX(); \
|
||||||
|
return Napi::Number::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value physicalDpiY(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int result = this->instance->physicalDpiY(); \
|
||||||
|
return Napi::Number::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value widthMM(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int result = this->instance->widthMM(); \
|
||||||
|
return Napi::Number::New(env, result); \
|
||||||
|
} \
|
||||||
|
Napi::Value updateMicroFocus(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
NWidget* nwidget = dynamic_cast<NWidget*>(this->instance.data()); \
|
||||||
|
if (nwidget) { \
|
||||||
|
Qt::InputMethodQuery query = static_cast<Qt::InputMethodQuery>( \
|
||||||
|
info[0].As<Napi::Number>().Int32Value()); \
|
||||||
|
nwidget->_protected_updateMicroFocus(query); \
|
||||||
|
} \
|
||||||
|
return env.Null(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QWIDGET_WRAPPED_METHODS_DECLARATION
|
#endif // QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
@ -545,10 +787,12 @@
|
|||||||
InstanceMethod("show", &WidgetWrapName::show), \
|
InstanceMethod("show", &WidgetWrapName::show), \
|
||||||
InstanceMethod("resize", &WidgetWrapName::resize), \
|
InstanceMethod("resize", &WidgetWrapName::resize), \
|
||||||
InstanceMethod("close", &WidgetWrapName::close), \
|
InstanceMethod("close", &WidgetWrapName::close), \
|
||||||
|
InstanceMethod("mapFrom", &WidgetWrapName::mapFrom), \
|
||||||
InstanceMethod("mapFromGlobal", &WidgetWrapName::mapFromGlobal), \
|
InstanceMethod("mapFromGlobal", &WidgetWrapName::mapFromGlobal), \
|
||||||
InstanceMethod("mapFromParent", &WidgetWrapName::mapFromParent), \
|
InstanceMethod("mapFromParent", &WidgetWrapName::mapFromParent), \
|
||||||
InstanceMethod("mapToGlobal", &WidgetWrapName::mapToGlobal), \
|
InstanceMethod("mapToGlobal", &WidgetWrapName::mapToGlobal), \
|
||||||
InstanceMethod("mapToParent", &WidgetWrapName::mapToParent), \
|
InstanceMethod("mapToParent", &WidgetWrapName::mapToParent), \
|
||||||
|
InstanceMethod("mapTo", &WidgetWrapName::mapTo), \
|
||||||
InstanceMethod("setLayout", &WidgetWrapName::setLayout), \
|
InstanceMethod("setLayout", &WidgetWrapName::setLayout), \
|
||||||
InstanceMethod("setStyleSheet", &WidgetWrapName::setStyleSheet), \
|
InstanceMethod("setStyleSheet", &WidgetWrapName::setStyleSheet), \
|
||||||
InstanceMethod("setCursor", &WidgetWrapName::setCursor), \
|
InstanceMethod("setCursor", &WidgetWrapName::setCursor), \
|
||||||
@ -600,6 +844,7 @@
|
|||||||
InstanceMethod("setFixedWidth", &WidgetWrapName::setFixedWidth), \
|
InstanceMethod("setFixedWidth", &WidgetWrapName::setFixedWidth), \
|
||||||
InstanceMethod("ensurePolished", &WidgetWrapName::ensurePolished), \
|
InstanceMethod("ensurePolished", &WidgetWrapName::ensurePolished), \
|
||||||
InstanceMethod("clearMask", &WidgetWrapName::clearMask), \
|
InstanceMethod("clearMask", &WidgetWrapName::clearMask), \
|
||||||
|
InstanceMethod("grab", &WidgetWrapName::grab), \
|
||||||
InstanceMethod("grabKeyboard", &WidgetWrapName::grabKeyboard), \
|
InstanceMethod("grabKeyboard", &WidgetWrapName::grabKeyboard), \
|
||||||
InstanceMethod("grabMouse", &WidgetWrapName::grabMouse), \
|
InstanceMethod("grabMouse", &WidgetWrapName::grabMouse), \
|
||||||
InstanceMethod("hasHeightForWidth", &WidgetWrapName::hasHeightForWidth), \
|
InstanceMethod("hasHeightForWidth", &WidgetWrapName::hasHeightForWidth), \
|
||||||
@ -621,7 +866,36 @@
|
|||||||
&WidgetWrapName::unsetLayoutDirection), \
|
&WidgetWrapName::unsetLayoutDirection), \
|
||||||
InstanceMethod("unsetLocale", &WidgetWrapName::unsetLocale), \
|
InstanceMethod("unsetLocale", &WidgetWrapName::unsetLocale), \
|
||||||
InstanceMethod("windowRole", &WidgetWrapName::windowRole), \
|
InstanceMethod("windowRole", &WidgetWrapName::windowRole), \
|
||||||
InstanceMethod("heightForWidth", &WidgetWrapName::heightForWidth),
|
InstanceMethod("heightForWidth", &WidgetWrapName::heightForWidth), \
|
||||||
|
InstanceMethod("winId", &WidgetWrapName::winId), \
|
||||||
|
InstanceMethod("contentsRect", &WidgetWrapName::contentsRect), \
|
||||||
|
InstanceMethod("childAt", &WidgetWrapName::childAt), \
|
||||||
|
InstanceMethod("focusProxy", &WidgetWrapName::focusProxy), \
|
||||||
|
InstanceMethod("setFocusProxy", &WidgetWrapName::setFocusProxy), \
|
||||||
|
InstanceMethod("focusWidget", &WidgetWrapName::focusWidget), \
|
||||||
|
InstanceMethod("nativeParentWidget", \
|
||||||
|
&WidgetWrapName::nativeParentWidget), \
|
||||||
|
InstanceMethod("nextInFocusChain", &WidgetWrapName::nextInFocusChain), \
|
||||||
|
InstanceMethod("parentWidget", &WidgetWrapName::parentWidget), \
|
||||||
|
InstanceMethod("previousInFocusChain", \
|
||||||
|
&WidgetWrapName::previousInFocusChain), \
|
||||||
|
InstanceMethod("window", &WidgetWrapName::window), \
|
||||||
|
InstanceMethod("isAncestorOf", &WidgetWrapName::isAncestorOf), \
|
||||||
|
InstanceMethod("isEnabledTo", &WidgetWrapName::isEnabledTo), \
|
||||||
|
InstanceMethod("isVisibleTo", &WidgetWrapName::isVisibleTo), \
|
||||||
|
InstanceMethod("stackUnder", &WidgetWrapName::stackUnder), \
|
||||||
|
InstanceMethod("colorCount", &WidgetWrapName::colorCount), \
|
||||||
|
InstanceMethod("depth", &WidgetWrapName::depth), \
|
||||||
|
InstanceMethod("devicePixelRatio", &WidgetWrapName::devicePixelRatio), \
|
||||||
|
InstanceMethod("devicePixelRatioF", &WidgetWrapName::devicePixelRatioF), \
|
||||||
|
InstanceMethod("heightMM", &WidgetWrapName::heightMM), \
|
||||||
|
InstanceMethod("logicalDpiX", &WidgetWrapName::logicalDpiX), \
|
||||||
|
InstanceMethod("logicalDpiY", &WidgetWrapName::logicalDpiY), \
|
||||||
|
InstanceMethod("paintingActive", &WidgetWrapName::paintingActive), \
|
||||||
|
InstanceMethod("physicalDpiX", &WidgetWrapName::physicalDpiX), \
|
||||||
|
InstanceMethod("physicalDpiY", &WidgetWrapName::physicalDpiY), \
|
||||||
|
InstanceMethod("widthMM", &WidgetWrapName::widthMM), \
|
||||||
|
InstanceMethod("updateMicroFocus", &WidgetWrapName::updateMicroFocus),
|
||||||
|
|
||||||
#endif // QWIDGET_WRAPPED_METHODS_EXPORT_DEFINE
|
#endif // QWIDGET_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
|
|
||||||
@ -655,3 +929,8 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
#endif // QWIDGET_SIGNALS
|
#endif // QWIDGET_SIGNALS
|
||||||
|
|
||||||
|
#include "QtWidgets/QWidget/qwidget_wrap.h"
|
||||||
|
// ^ Yes, this is weird due to the mutual dependency between the methods macro
|
||||||
|
// and `NodeWidgetWrap`. Having this here makes everything work regardless if
|
||||||
|
// `qwidget_wrap.h` is included first or `qwidget_macro.h`.
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user