Add QWidget.winId(), useful for forcing window creation
This commit is contained in:
parent
ed7da32952
commit
2865212937
@ -533,6 +533,11 @@
|
||||
int w = info[0].As<Napi::Number>().Int32Value(); \
|
||||
int result = this->instance->heightForWidth(w); \
|
||||
return Napi::Number::New(env, result); \
|
||||
} \
|
||||
Napi::Value winId(const Napi::CallbackInfo& info) { \
|
||||
Napi::Env env = info.Env(); \
|
||||
int result = this->instance->winId(); \
|
||||
return Napi::Number::New(env, result); \
|
||||
}
|
||||
|
||||
#endif // QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
@ -621,7 +626,8 @@
|
||||
&WidgetWrapName::unsetLayoutDirection), \
|
||||
InstanceMethod("unsetLocale", &WidgetWrapName::unsetLocale), \
|
||||
InstanceMethod("windowRole", &WidgetWrapName::windowRole), \
|
||||
InstanceMethod("heightForWidth", &WidgetWrapName::heightForWidth),
|
||||
InstanceMethod("heightForWidth", &WidgetWrapName::heightForWidth), \
|
||||
InstanceMethod("winId", &WidgetWrapName::winId),
|
||||
|
||||
#endif // QWIDGET_WRAPPED_METHODS_EXPORT_DEFINE
|
||||
|
||||
|
||||
@ -538,7 +538,9 @@ export abstract class NodeWidget<Signals extends QWidgetSignals> extends YogaWid
|
||||
width(): number {
|
||||
return this.property('width').toInt();
|
||||
}
|
||||
// TODO: WId winId() const
|
||||
winId(): number {
|
||||
return this.native.winId();
|
||||
}
|
||||
// TODO: QWidget * window() const
|
||||
windowFilePath(): string {
|
||||
return this.property('windowFilePath').toString();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user