diff --git a/src/cpp/QtGui/QWidget/qwidget_macro.h b/src/cpp/QtGui/QWidget/qwidget_macro.h index 6f0756643..17524112e 100644 --- a/src/cpp/QtGui/QWidget/qwidget_macro.h +++ b/src/cpp/QtGui/QWidget/qwidget_macro.h @@ -49,7 +49,7 @@ Napi::Value setLayout(const Napi::CallbackInfo& info){ \ return env.Null(); \ } \ \ -Napi::Value setStyleSheet(const Napi::CallbackInfo& info) { \ +Napi::Value setStyleSheet(const Napi::CallbackInfo& info){ \ Napi::Env env = info.Env(); \ Napi::HandleScope scope(env); \ Napi::String text = info[0].As(); \ @@ -122,6 +122,12 @@ Napi::Value update(const Napi::CallbackInfo& info){ \ this->instance->update(); \ return env.Null(); \ } \ +Napi::Value updateGeometry(const Napi::CallbackInfo& info){ \ + Napi::Env env = info.Env(); \ + Napi::HandleScope scope(env); \ + this->instance->updateGeometry(); \ + return env.Null(); \ +} \ Napi::Value size(const Napi::CallbackInfo& info){ \ Napi::Env env = info.Env(); \ Napi::HandleScope scope(env); \ @@ -154,9 +160,7 @@ Napi::Value size(const Napi::CallbackInfo& info){ \ InstanceMethod("setMinimumSize",&WidgetWrapName::setMinimumSize), \ InstanceMethod("repaint",&WidgetWrapName::repaint), \ InstanceMethod("update",&WidgetWrapName::update), \ + InstanceMethod("updateGeometry",&WidgetWrapName::updateGeometry), \ InstanceMethod("size",&WidgetWrapName::size), \ #endif // QWIDGET_WRAPPED_METHODS_EXPORT_DEFINE - - - diff --git a/src/lib/QtGui/QWidget/index.ts b/src/lib/QtGui/QWidget/index.ts index 38ed53d56..2bc48bf4b 100644 --- a/src/lib/QtGui/QWidget/index.ts +++ b/src/lib/QtGui/QWidget/index.ts @@ -57,6 +57,9 @@ export abstract class NodeWidget extends EventWidget { update = () => { this.native.update(); }; + updateGeometry = () => { + this.native.updateGeometry(); + }; size = (): { width: number; height: number } => { return this.native.size(); };