diff --git a/src/cpp/QtGui/QWidget/qwidget_macro.h b/src/cpp/QtGui/QWidget/qwidget_macro.h index 118020166..a2f405645 100644 --- a/src/cpp/QtGui/QWidget/qwidget_macro.h +++ b/src/cpp/QtGui/QWidget/qwidget_macro.h @@ -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 \ No newline at end of file diff --git a/src/lib/QtGui/QWidget/index.ts b/src/lib/QtGui/QWidget/index.ts index 92dcf597d..012159787 100644 --- a/src/lib/QtGui/QWidget/index.ts +++ b/src/lib/QtGui/QWidget/index.ts @@ -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 {