diff --git a/src/cpp/include/nodegui/QtWidgets/QDesktopWidget/nqdesktopwidget.hpp b/src/cpp/include/nodegui/QtWidgets/QDesktopWidget/nqdesktopwidget.hpp index 7b4ce8c55..cd563fd87 100644 --- a/src/cpp/include/nodegui/QtWidgets/QDesktopWidget/nqdesktopwidget.hpp +++ b/src/cpp/include/nodegui/QtWidgets/QDesktopWidget/nqdesktopwidget.hpp @@ -1,13 +1,15 @@ #pragma once -#include "core/NodeWidget/nodewidget.h" -#include #include +#include + +#include "core/NodeWidget/nodewidget.h" class NQDesktopWidget : public QDesktopWidget, public NodeWidget { public: Q_OBJECT NODEWIDGET_IMPLEMENTATIONS(QDesktopWidget) public: - using QDesktopWidget::QDesktopWidget; // inherit all constructors of QStatusBar + using QDesktopWidget::QDesktopWidget; // inherit all constructors of + // QStatusBar }; diff --git a/src/cpp/include/nodegui/QtWidgets/QDesktopWidget/qdesktopwidget_wrap.h b/src/cpp/include/nodegui/QtWidgets/QDesktopWidget/qdesktopwidget_wrap.h index 5ff2bfee4..845425907 100644 --- a/src/cpp/include/nodegui/QtWidgets/QDesktopWidget/qdesktopwidget_wrap.h +++ b/src/cpp/include/nodegui/QtWidgets/QDesktopWidget/qdesktopwidget_wrap.h @@ -1,7 +1,8 @@ #pragma once -#include "napi.h" -#include "QtWidgets/QWidget/qwidget_macro.h" #include + +#include "QtWidgets/QWidget/qwidget_macro.h" +#include "napi.h" #include "nqdesktopwidget.hpp" class QDesktopWidgetWrap : public Napi::ObjectWrap { diff --git a/src/cpp/lib/QtWidgets/QDesktopWidget/qdesktopwidget_wrap.cpp b/src/cpp/lib/QtWidgets/QDesktopWidget/qdesktopwidget_wrap.cpp index e45e4b7eb..9bf8f5e50 100644 --- a/src/cpp/lib/QtWidgets/QDesktopWidget/qdesktopwidget_wrap.cpp +++ b/src/cpp/lib/QtWidgets/QDesktopWidget/qdesktopwidget_wrap.cpp @@ -1,28 +1,31 @@ #include "QtWidgets/QDesktopWidget/qdesktopwidget_wrap.h" -#include "Extras/Utils/nutils.h" -#include "QtWidgets/QWidget/qwidget_wrap.h" -#include "QtCore/QRect/qrect_wrap.h" - #include +#include "Extras/Utils/nutils.h" +#include "QtCore/QRect/qrect_wrap.h" +#include "QtWidgets/QWidget/qwidget_wrap.h" + Napi::FunctionReference QDesktopWidgetWrap::constructor; Napi::Object QDesktopWidgetWrap::init(Napi::Env env, Napi::Object exports) { Napi::HandleScope scope(env); char CLASSNAME[] = "QDesktopWidget"; - Napi::Function func = - DefineClass(env, CLASSNAME, - {InstanceMethod("screenGeometry", &QDesktopWidgetWrap::screenGeometry), - InstanceMethod("availableGeometry", &QDesktopWidgetWrap::availableGeometry), - InstanceMethod("screenNumber", &QDesktopWidgetWrap::screenNumber), - QWIDGET_WRAPPED_METHODS_EXPORT_DEFINE(QDesktopWidgetWrap)}); + Napi::Function func = DefineClass( + env, CLASSNAME, + {InstanceMethod("screenGeometry", &QDesktopWidgetWrap::screenGeometry), + InstanceMethod("availableGeometry", + &QDesktopWidgetWrap::availableGeometry), + InstanceMethod("screenNumber", &QDesktopWidgetWrap::screenNumber), + QWIDGET_WRAPPED_METHODS_EXPORT_DEFINE(QDesktopWidgetWrap)}); constructor = Napi::Persistent(func); exports.Set(CLASSNAME, func); return exports; } -NQDesktopWidget *QDesktopWidgetWrap::getInternalInstance() { return this->instance; } +NQDesktopWidget *QDesktopWidgetWrap::getInternalInstance() { + return this->instance; +} QDesktopWidgetWrap::QDesktopWidgetWrap(const Napi::CallbackInfo &info) : Napi::ObjectWrap(info) { @@ -40,7 +43,9 @@ QDesktopWidgetWrap::QDesktopWidgetWrap(const Napi::CallbackInfo &info) true); } -QDesktopWidgetWrap::~QDesktopWidgetWrap() { extrautils::safeDelete(this->instance); } +QDesktopWidgetWrap::~QDesktopWidgetWrap() { + extrautils::safeDelete(this->instance); +} Napi::Value QDesktopWidgetWrap::screenGeometry(const Napi::CallbackInfo &info) { Napi::Env env = info.Env(); @@ -48,17 +53,20 @@ Napi::Value QDesktopWidgetWrap::screenGeometry(const Napi::CallbackInfo &info) { Napi::Number screen = info[0].As(); QRect rect = this->instance->screenGeometry(screen); - auto instance = QRectWrap::constructor.New({Napi::External::New(env, new QRect(rect))}); + auto instance = QRectWrap::constructor.New( + {Napi::External::New(env, new QRect(rect))}); return instance; } -Napi::Value QDesktopWidgetWrap::availableGeometry(const Napi::CallbackInfo &info) { +Napi::Value QDesktopWidgetWrap::availableGeometry( + const Napi::CallbackInfo &info) { Napi::Env env = info.Env(); Napi::HandleScope scope(env); Napi::Number screen = info[0].As(); QRect rect = this->instance->availableGeometry(screen); - auto instance = QRectWrap::constructor.New({Napi::External::New(env, new QRect(rect))}); + auto instance = QRectWrap::constructor.New( + {Napi::External::New(env, new QRect(rect))}); return instance; } diff --git a/src/cpp/lib/QtWidgets/QTableWidget/qtablewidget_wrap.cpp b/src/cpp/lib/QtWidgets/QTableWidget/qtablewidget_wrap.cpp index fdb6cad0e..59e4d16b3 100644 --- a/src/cpp/lib/QtWidgets/QTableWidget/qtablewidget_wrap.cpp +++ b/src/cpp/lib/QtWidgets/QTableWidget/qtablewidget_wrap.cpp @@ -66,10 +66,12 @@ Napi::Object QTableWidgetWrap::init(Napi::Env env, Napi::Object exports) { InstanceMethod("currentItem", &QTableWidgetWrap::currentItem), InstanceMethod("currentRow", &QTableWidgetWrap::currentRow), InstanceMethod("findItems", &QTableWidgetWrap::findItems), - InstanceMethod("isPersistentEditorOpen", &QTableWidgetWrap::isPersistentEditorOpen), + InstanceMethod("isPersistentEditorOpen", + &QTableWidgetWrap::isPersistentEditorOpen), InstanceMethod("item", &QTableWidgetWrap::item), InstanceMethod("itemAt", &QTableWidgetWrap::itemAt), - InstanceMethod("openPersistentEditor", &QTableWidgetWrap::openPersistentEditor), + InstanceMethod("openPersistentEditor", + &QTableWidgetWrap::openPersistentEditor), InstanceMethod("removeCellWidget", &QTableWidgetWrap::removeCellWidget), InstanceMethod("row", &QTableWidgetWrap::row), InstanceMethod("cellWidget", &QTableWidgetWrap::cellWidget), @@ -344,8 +346,8 @@ Napi::Value QTableWidgetWrap::cellWidget(const Napi::CallbackInfo& info) { QWidget* widget = this->instance->cellWidget(row, column); auto instance = - QWidgetWrap::constructor.New({Napi::External::New(env, widget), - Napi::Boolean::New(env, true)}); + QWidgetWrap::constructor.New({Napi::External::New(env, widget), + Napi::Boolean::New(env, true)}); return instance; } @@ -408,7 +410,8 @@ Napi::Value QTableWidgetWrap::findItems(const Napi::CallbackInfo& info) { return napiItems; } -Napi::Value QTableWidgetWrap::isPersistentEditorOpen(const Napi::CallbackInfo& info) { +Napi::Value QTableWidgetWrap::isPersistentEditorOpen( + const Napi::CallbackInfo& info) { Napi::Env env = info.Env(); Napi::HandleScope scope(env); @@ -447,7 +450,8 @@ Napi::Value QTableWidgetWrap::itemAt(const Napi::CallbackInfo& info) { return instance; } -Napi::Value QTableWidgetWrap::openPersistentEditor(const Napi::CallbackInfo& info) { +Napi::Value QTableWidgetWrap::openPersistentEditor( + const Napi::CallbackInfo& info) { Napi::Env env = info.Env(); Napi::HandleScope scope(env); @@ -551,7 +555,6 @@ Napi::Value QTableWidgetWrap::visualRow(const Napi::CallbackInfo& info) { return Napi::Number::New(env, row); } - // FROM TABLEVIEW Napi::Value QTableWidgetWrap::hideColumn(const Napi::CallbackInfo& info) { @@ -745,4 +748,3 @@ Napi::Value QTableWidgetWrap::isSortingEnabled(const Napi::CallbackInfo& info) { bool enabled = this->instance->isSortingEnabled(); return Napi::Boolean::New(env, enabled); } - diff --git a/src/cpp/lib/QtWidgets/QTableWidgetItem/qtablewidgetitem_wrap.cpp b/src/cpp/lib/QtWidgets/QTableWidgetItem/qtablewidgetitem_wrap.cpp index 493b70f27..8e87ed8c0 100644 --- a/src/cpp/lib/QtWidgets/QTableWidgetItem/qtablewidgetitem_wrap.cpp +++ b/src/cpp/lib/QtWidgets/QTableWidgetItem/qtablewidgetitem_wrap.cpp @@ -46,7 +46,7 @@ Napi::Object QTableWidgetItemWrap::init(Napi::Env env, Napi::Object exports) { InstanceMethod("toolTip", &QTableWidgetItemWrap::toolTip), InstanceMethod("setWhatsThis", &QTableWidgetItemWrap::setWhatsThis), InstanceMethod("whatsThis", &QTableWidgetItemWrap::whatsThis), - InstanceMethod("type$", &QTableWidgetItemWrap::type), + InstanceMethod("type$", &QTableWidgetItemWrap::type), COMPONENT_WRAPPED_METHODS_EXPORT_DEFINE(QTableWidgetItemWrap)}); constructor = Napi::Persistent(func); exports.Set(CLASSNAME, func); @@ -92,7 +92,8 @@ Napi::Value QTableWidgetItemWrap::column(const Napi::CallbackInfo& info) { return Napi::Number::New(env, state); } -Napi::Value QTableWidgetItemWrap::setBackground(const Napi::CallbackInfo& info) { +Napi::Value QTableWidgetItemWrap::setBackground( + const Napi::CallbackInfo& info) { Napi::Env env = info.Env(); Napi::HandleScope scope(env); @@ -112,7 +113,8 @@ Napi::Value QTableWidgetItemWrap::background(const Napi::CallbackInfo& info) { return instance; } -Napi::Value QTableWidgetItemWrap::setCheckState(const Napi::CallbackInfo& info) { +Napi::Value QTableWidgetItemWrap::setCheckState( + const Napi::CallbackInfo& info) { Napi::Env env = info.Env(); Napi::HandleScope scope(env); @@ -189,7 +191,8 @@ Napi::Value QTableWidgetItemWrap::font(const Napi::CallbackInfo& info) { return instance; } -Napi::Value QTableWidgetItemWrap::setForeground(const Napi::CallbackInfo& info) { +Napi::Value QTableWidgetItemWrap::setForeground( + const Napi::CallbackInfo& info) { Napi::Env env = info.Env(); Napi::HandleScope scope(env); @@ -309,7 +312,8 @@ Napi::Value QTableWidgetItemWrap::setTextAlignment( return env.Null(); } -Napi::Value QTableWidgetItemWrap::textAlignment(const Napi::CallbackInfo& info) { +Napi::Value QTableWidgetItemWrap::textAlignment( + const Napi::CallbackInfo& info) { Napi::Env env = info.Env(); Napi::HandleScope scope(env); diff --git a/src/cpp/main.cpp b/src/cpp/main.cpp index c3a6d545e..359e93451 100644 --- a/src/cpp/main.cpp +++ b/src/cpp/main.cpp @@ -47,6 +47,7 @@ #include "QtWidgets/QComboBox/qcombobox_wrap.h" #include "QtWidgets/QDateEdit/qdateedit_wrap.h" #include "QtWidgets/QDateTimeEdit/qdatetimeedit_wrap.h" +#include "QtWidgets/QDesktopWidget/qdesktopwidget_wrap.h" #include "QtWidgets/QDial/qdial_wrap.h" #include "QtWidgets/QDialog/qdialog_wrap.h" #include "QtWidgets/QDoubleSpinBox/qdoublespinbox_wrap.h" @@ -99,7 +100,6 @@ #include "QtWidgets/QToolButton/qtoolbutton_wrap.h" #include "QtWidgets/QTreeWidget/qtreewidget_wrap.h" #include "QtWidgets/QTreeWidgetItem/qtreewidgetitem_wrap.h" -#include "QtWidgets/QDesktopWidget/qdesktopwidget_wrap.h" #include "QtWidgets/QWidget/qwidget_wrap.h" #include "core/FlexLayout/flexlayout_wrap.h" #include "core/Integration/integration.h" diff --git a/src/demo.ts b/src/demo.ts index 0adc1514b..0b0e9fd43 100644 --- a/src/demo.ts +++ b/src/demo.ts @@ -18,7 +18,7 @@ console.log(availableGeometry.width() + 'x' + availableGeometry.height()); console.log(screenGeometry.width() + 'x' + screenGeometry.height()); console.log(desktop.screenNumber()); // ex 2 -const qApp = QApplication.desktop() +const qApp = QApplication.desktop(); const availableGeometry2 = qApp.availableGeometry(); const screenGeometry2 = qApp.screenGeometry(); console.log(availableGeometry2.width() + 'x' + availableGeometry2.height());