Upgrade deps (#562)

* upgrade qode

* 0.20.0

* dep updates

* formatting and fix exports

* fix type rename
This commit is contained in:
Atul R 2020-05-13 09:15:46 +02:00 committed by GitHub
parent f8a3f4186c
commit 1bd0a5ca10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 1920 additions and 605 deletions

2448
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@nodegui/nodegui",
"version": "0.19.0",
"version": "0.20.0",
"description": "A cross platform library to build native desktop apps.",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
@ -28,7 +28,7 @@
},
"dependencies": {
"@nodegui/artifact-installer": "^1.1.0",
"@nodegui/qode": "^2.0.4",
"@nodegui/qode": "^2.1.0",
"cmake-js": "^6.1.0",
"cross-env": "^7.0.0",
"cuid": "^2.1.6",
@ -41,21 +41,21 @@
"devDependencies": {
"@types/bindings": "^1.3.0",
"@types/jest": "^25.2.1",
"@types/node": "^13.11.1",
"@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.28.0",
"@types/node": "^13.13.6",
"@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.33.0",
"clang-format": "^1.3.0",
"eslint": "^6.6.0",
"eslint-config-prettier": "^6.5.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"husky": "^4.2.5",
"jest": "^25.3.0",
"jest": "^25.5.4",
"prebuild": "^10.0.0",
"prettier": "^2.0.4",
"ts-jest": "^25.3.1",
"typedoc": "^0.17.4",
"prettier": "^2.0.5",
"ts-jest": "^25.5.1",
"typedoc": "^0.17.6",
"typedoc-plugin-markdown": "^2.2.14",
"typescript": "^3.8.3"
"typescript": "^3.9.2"
},
"binary": {
"napi_versions": [

View File

@ -378,13 +378,13 @@
this->instance->addAction(actionWrap->getInternalInstance()); \
return env.Null(); \
} \
Napi::Value removeAction(const Napi::CallbackInfo& info) { \
Napi::Value removeAction(const Napi::CallbackInfo& info) { \
Napi::Env env = info.Env(); \
Napi::HandleScope scope(env); \
Napi::Object actionObject = info[0].As<Napi::Object>(); \
QActionWrap* actionWrap = \
Napi::ObjectWrap<QActionWrap>::Unwrap(actionObject); \
this->instance->removeAction(actionWrap->getInternalInstance()); \
this->instance->removeAction(actionWrap->getInternalInstance()); \
return env.Null(); \
} \
Napi::Value repolish(const Napi::CallbackInfo& info) { \

View File

@ -2,8 +2,8 @@
#include "Extras/Utils/nutils.h"
#include "QtCore/QVariant/qvariant_wrap.h"
#include "QtGui/QColor/qcolor_wrap.h"
#include "QtGui/QBrush/qbrush_wrap.h"
#include "QtGui/QColor/qcolor_wrap.h"
#include "QtGui/QPixmap/qpixmap_wrap.h"
Napi::FunctionReference QPenWrap::constructor;
@ -11,15 +11,15 @@ Napi::FunctionReference QPenWrap::constructor;
Napi::Object QPenWrap::init(Napi::Env env, Napi::Object exports) {
Napi::HandleScope scope(env);
char CLASSNAME[] = "QPen";
Napi::Function func = DefineClass(
env, CLASSNAME,
{InstanceMethod("setColor", &QPenWrap::setColor),
InstanceMethod("color", &QPenWrap::color),
InstanceMethod("setStyle", &QPenWrap::setStyle),
InstanceMethod("style", &QPenWrap::style),
InstanceMethod("setCapStyle", &QPenWrap::setCapStyle),
InstanceMethod("setWidth", &QPenWrap::setWidth),
COMPONENT_WRAPPED_METHODS_EXPORT_DEFINE(QPenWrap)});
Napi::Function func =
DefineClass(env, CLASSNAME,
{InstanceMethod("setColor", &QPenWrap::setColor),
InstanceMethod("color", &QPenWrap::color),
InstanceMethod("setStyle", &QPenWrap::setStyle),
InstanceMethod("style", &QPenWrap::style),
InstanceMethod("setCapStyle", &QPenWrap::setCapStyle),
InstanceMethod("setWidth", &QPenWrap::setWidth),
COMPONENT_WRAPPED_METHODS_EXPORT_DEFINE(QPenWrap)});
constructor = Napi::Persistent(func);
exports.Set(CLASSNAME, func);
return exports;
@ -73,8 +73,7 @@ Napi::Value QPenWrap::setStyle(const Napi::CallbackInfo& info) {
Napi::Env env = info.Env();
Napi::HandleScope scope(env);
Qt::PenStyle style =
(Qt::PenStyle)info[0].As<Napi::Number>().Int32Value();
Qt::PenStyle style = (Qt::PenStyle)info[0].As<Napi::Number>().Int32Value();
this->instance->setStyle(style);
return env.Null();
}

View File

@ -71,7 +71,8 @@ Napi::Value QPainterWrap::drawPath(const Napi::CallbackInfo& info) {
Napi::Env env = info.Env();
Napi::HandleScope scope(env);
Napi::Object pathObject = info[0].As<Napi::Object>();
QPainterPathWrap* pathWrap = Napi::ObjectWrap<QPainterPathWrap>::Unwrap(pathObject);
QPainterPathWrap* pathWrap =
Napi::ObjectWrap<QPainterPathWrap>::Unwrap(pathObject);
QPainterPath* path = pathWrap->getInternalInstance();
this->instance->drawPath(*path);
return env.Null();
@ -80,7 +81,8 @@ Napi::Value QPainterWrap::strokePath(const Napi::CallbackInfo& info) {
Napi::Env env = info.Env();
Napi::HandleScope scope(env);
Napi::Object pathObject = info[0].As<Napi::Object>();
QPainterPathWrap* pathWrap = Napi::ObjectWrap<QPainterPathWrap>::Unwrap(pathObject);
QPainterPathWrap* pathWrap =
Napi::ObjectWrap<QPainterPathWrap>::Unwrap(pathObject);
QPainterPath* path = pathWrap->getInternalInstance();
Napi::Object penObject = info[1].As<Napi::Object>();
QPenWrap* penWrap = Napi::ObjectWrap<QPenWrap>::Unwrap(penObject);

View File

@ -22,7 +22,9 @@ Napi::Object QPainterPathWrap::init(Napi::Env env, Napi::Object exports) {
return exports;
}
QPainterPath* QPainterPathWrap::getInternalInstance() { return this->instance.get(); }
QPainterPath* QPainterPathWrap::getInternalInstance() {
return this->instance.get();
}
QPainterPathWrap::~QPainterPathWrap() { this->instance.reset(); }
QPainterPathWrap::QPainterPathWrap(const Napi::CallbackInfo& info)

View File

@ -15,8 +15,10 @@ Napi::Object QTreeWidgetWrap::init(Napi::Env env, Napi::Object exports) {
env, CLASSNAME,
{InstanceMethod("addTopLevelItem", &QTreeWidgetWrap::addTopLevelItem),
InstanceMethod("addTopLevelItems", &QTreeWidgetWrap::addTopLevelItems),
InstanceMethod("insertTopLevelItem",&QTreeWidgetWrap::insertTopLevelItem),
InstanceMethod("insertTopLevelItems", &QTreeWidgetWrap::insertTopLevelItems),
InstanceMethod("insertTopLevelItem",
&QTreeWidgetWrap::insertTopLevelItem),
InstanceMethod("insertTopLevelItems",
&QTreeWidgetWrap::insertTopLevelItems),
InstanceMethod("selectedItems", &QTreeWidgetWrap::selectedItems),
InstanceMethod("setColumnCount", &QTreeWidgetWrap::setColumnCount),
InstanceMethod("setColumnWidth", &QTreeWidgetWrap::setColumnWidth),

View File

@ -14,7 +14,6 @@
#include "QtCore/QVariant/qvariant_wrap.h"
#include "QtGui/QApplication/qapplication_wrap.h"
#include "QtGui/QBrush/qbrush_wrap.h"
#include "QtGui/QPen/qpen_wrap.h"
#include "QtGui/QClipboard/qclipboard_wrap.h"
#include "QtGui/QColor/qcolor_wrap.h"
#include "QtGui/QCursor/qcursor_wrap.h"
@ -25,6 +24,7 @@
#include "QtGui/QIcon/qicon_wrap.h"
#include "QtGui/QKeySequence/qkeysequence_wrap.h"
#include "QtGui/QMovie/qmovie_wrap.h"
#include "QtGui/QPen/qpen_wrap.h"
#include "QtGui/QPicture/qpicture_wrap.h"
#include "QtGui/QPixmap/qpixmap_wrap.h"
#include "QtGui/QStyle/qstyle_wrap.h"

View File

@ -69,7 +69,7 @@ export {
LayoutMode,
Movement,
ResizeMode,
ViewMode,
ListViewMode,
} from './lib/QtWidgets/QListView';
export { QListWidget, QListWidgetSignals } from './lib/QtWidgets/QListWidget';
export { QListWidgetItem } from './lib/QtWidgets/QListWidgetItem';

View File

@ -94,10 +94,10 @@ export abstract class NodeListView<Signals extends QListViewSignals> extends QAb
uniformItemSizes(): boolean {
return this.property('uniformItemSizes').toBool();
}
setViewMode(mode: ViewMode): void {
setViewMode(mode: ListViewMode): void {
this.setProperty('viewMode', mode);
}
viewMode(): ViewMode {
viewMode(): ListViewMode {
return this.property('viewMode').toInt();
}
setWordWrap(on: boolean): void {
@ -138,7 +138,7 @@ export enum ResizeMode {
Adjust,
}
export enum ViewMode {
export enum ListViewMode {
ListMode,
IconMode,
}

View File

@ -253,7 +253,7 @@ export abstract class NodeWidget<Signals extends QWidgetSignals> extends YogaWid
this.native.addAction(action.native);
this.actions.add(action);
return action;
}
}
removeAction(action: QAction): void {
this.native.removeAction(action.native);
this.actions.delete(action);