added enabled prop to widgets
This commit is contained in:
parent
b8b3dd53e7
commit
789d28ed99
@ -1,8 +1,8 @@
|
||||
{
|
||||
"includes": [
|
||||
'./config/deps.gypi',
|
||||
"./config/application.gypi",
|
||||
"./config/moc.gypi",
|
||||
'./config/deps.gypi'
|
||||
],
|
||||
"targets": []
|
||||
}
|
||||
|
||||
@ -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<Napi::Boolean>(); \
|
||||
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
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
#include "src/cpp/core/FlexLayout/flexlayout_wrap.h"
|
||||
#include "src/cpp/QtGui/QEvent/QKeyEvent/qkeyevent_wrap.h"
|
||||
#include <napi.h>
|
||||
|
||||
// These cant be instantiated in JS Side
|
||||
void InitPrivateHelpers(Napi::Env env){
|
||||
QLayoutWrap::init(env); //Abstact class wrapper for pointing to any layout
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user