diff --git a/binding.gyp b/binding.gyp index b9a20b5b2..ed9bd2c2f 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,8 +1,8 @@ { "includes": [ + './config/deps.gypi', "./config/application.gypi", "./config/moc.gypi", - './config/deps.gypi' ], "targets": [] } diff --git a/src/cpp/QtGui/QWidget/qwidget_macro.h b/src/cpp/QtGui/QWidget/qwidget_macro.h index 9771a255b..fd6322204 100644 --- a/src/cpp/QtGui/QWidget/qwidget_macro.h +++ b/src/cpp/QtGui/QWidget/qwidget_macro.h @@ -77,6 +77,13 @@ Napi::Value setMouseTracking(const Napi::CallbackInfo& info){ \ this->instance->setMouseTracking(isMouseTracked.Value()); \ return env.Null(); \ } \ +Napi::Value setEnabled(const Napi::CallbackInfo& info){ \ + Napi::Env env = info.Env(); \ + Napi::HandleScope scope(env); \ + Napi::Boolean enabled = info[0].As(); \ + this->instance->setEnabled(enabled.Value()); \ + return env.Null(); \ +} \ #endif //QWIDGET_WRAPPED_METHODS_DECLARATION @@ -93,6 +100,7 @@ Napi::Value setMouseTracking(const Napi::CallbackInfo& info){ \ InstanceMethod("hide",&WidgetWrapName::hide), \ InstanceMethod("setObjectName",&WidgetWrapName::setObjectName), \ InstanceMethod("setMouseTracking",&WidgetWrapName::setMouseTracking), \ + InstanceMethod("setEnabled",&WidgetWrapName::setEnabled), \ #endif // QWIDGET_WRAPPED_METHODS_EXPORT_DEFINE diff --git a/src/cpp/main.cpp b/src/cpp/main.cpp index 26454a1a4..e667fbacc 100644 --- a/src/cpp/main.cpp +++ b/src/cpp/main.cpp @@ -12,7 +12,6 @@ #include "src/cpp/core/FlexLayout/flexlayout_wrap.h" #include "src/cpp/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.h" #include - // These cant be instantiated in JS Side void InitPrivateHelpers(Napi::Env env){ QLayoutWrap::init(env); //Abstact class wrapper for pointing to any layout diff --git a/src/lib/QtGui/QWidget/index.ts b/src/lib/QtGui/QWidget/index.ts index 5203ad717..ed7871324 100644 --- a/src/lib/QtGui/QWidget/index.ts +++ b/src/lib/QtGui/QWidget/index.ts @@ -33,6 +33,9 @@ export abstract class NodeWidget extends EventWidget { setMouseTracking = (isMouseTracked: boolean) => { this.native.setMouseTracking(isMouseTracked); }; + setEnabled = (enabled: boolean)=>{ + this.native.setEnabled(enabled); + } } export class QWidget extends NodeWidget {