Added hide to all widgets

This commit is contained in:
Atul R 2019-05-27 23:18:47 +02:00
parent 84a314f80c
commit e2686afff2
2 changed files with 13 additions and 1 deletions

View File

@ -44,7 +44,15 @@ Napi::Value setStyleSheet(const Napi::CallbackInfo& info) { \
std::string style = text.Utf8Value(); \
this->instance->setStyleSheet(style.c_str()); \
return env.Null(); \
}
} \
\
Napi::Value hide(const Napi::CallbackInfo& info) { \
Napi::Env env = info.Env(); \
Napi::HandleScope scope(env); \
this->instance->hide(); \
return env.Null(); \
}
#define QWIDGET_WRAPPED_METHODS_EXPORT_DEFINE(WidgetWrapName) \
\
@ -53,6 +61,7 @@ Napi::Value setStyleSheet(const Napi::CallbackInfo& info) { \
InstanceMethod("close",&WidgetWrapName::close), \
InstanceMethod("setLayout",&WidgetWrapName::setLayout), \
InstanceMethod("setStyleSheet",&WidgetWrapName::setStyleSheet), \
InstanceMethod("hide",&WidgetWrapName::hide), \
#endif

View File

@ -22,6 +22,9 @@ export abstract class NodeWidget extends Component {
setStyleSheet(style: string) {
this.native.setStyleSheet(style);
}
hide() {
this.native.hide();
}
}
export class QWidget extends NodeWidget {