Add QWidget.setFixedHeight(), QWidget.setFixedWidth(), and QWidget.sizeHint()
This commit is contained in:
parent
47b3d514bb
commit
1ab7d13b96
@ -493,6 +493,18 @@
|
|||||||
} else { \
|
} else { \
|
||||||
return env.Null(); \
|
return env.Null(); \
|
||||||
} \
|
} \
|
||||||
|
} \
|
||||||
|
Napi::Value setFixedHeight(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int h = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
|
this->instance->setFixedHeight(h); \
|
||||||
|
return env.Null(); \
|
||||||
|
} \
|
||||||
|
Napi::Value setFixedWidth(const Napi::CallbackInfo& info) { \
|
||||||
|
Napi::Env env = info.Env(); \
|
||||||
|
int w = info[0].As<Napi::Number>().Int32Value(); \
|
||||||
|
this->instance->setFixedWidth(w); \
|
||||||
|
return env.Null(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QWIDGET_WRAPPED_METHODS_DECLARATION
|
#endif // QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||||
@ -570,7 +582,9 @@
|
|||||||
InstanceMethod("setHidden", &WidgetWrapName::setHidden), \
|
InstanceMethod("setHidden", &WidgetWrapName::setHidden), \
|
||||||
InstanceMethod("setVisible", &WidgetWrapName::setVisible), \
|
InstanceMethod("setVisible", &WidgetWrapName::setVisible), \
|
||||||
InstanceMethod("setWindowModified", &WidgetWrapName::setWindowModified), \
|
InstanceMethod("setWindowModified", &WidgetWrapName::setWindowModified), \
|
||||||
InstanceMethod("windowHandle", &WidgetWrapName::windowHandle),
|
InstanceMethod("windowHandle", &WidgetWrapName::windowHandle), \
|
||||||
|
InstanceMethod("setFixedHeight", &WidgetWrapName::setFixedHeight), \
|
||||||
|
InstanceMethod("setFixedWidth", &WidgetWrapName::setFixedWidth),
|
||||||
|
|
||||||
#endif // QWIDGET_WRAPPED_METHODS_EXPORT_DEFINE
|
#endif // QWIDGET_WRAPPED_METHODS_EXPORT_DEFINE
|
||||||
|
|
||||||
|
|||||||
@ -277,12 +277,16 @@ export abstract class NodeWidget<Signals extends QWidgetSignals> extends YogaWid
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO: void setEditFocus(bool enable)
|
// TODO: void setEditFocus(bool enable)
|
||||||
// TODO: void setFixedHeight(int h)
|
setFixedHeight(h: number): void {
|
||||||
|
this.native.setFixedHeight(h);
|
||||||
|
}
|
||||||
// TODO: void setFixedSize(const QSize &s)
|
// TODO: void setFixedSize(const QSize &s)
|
||||||
setFixedSize(width: number, height: number): void {
|
setFixedSize(width: number, height: number): void {
|
||||||
this.native.setFixedSize(width, height);
|
this.native.setFixedSize(width, height);
|
||||||
}
|
}
|
||||||
// TODO: void setFixedWidth(int w)
|
setFixedWidth(w: number): void {
|
||||||
|
this.native.setFixedWidth(w);
|
||||||
|
}
|
||||||
setFocusPolicy(policy: FocusPolicy): void {
|
setFocusPolicy(policy: FocusPolicy): void {
|
||||||
this.setProperty('focusPolicy', policy);
|
this.setProperty('focusPolicy', policy);
|
||||||
}
|
}
|
||||||
@ -386,7 +390,9 @@ export abstract class NodeWidget<Signals extends QWidgetSignals> extends YogaWid
|
|||||||
size(): QSize {
|
size(): QSize {
|
||||||
return new QSize(this.native.size());
|
return new QSize(this.native.size());
|
||||||
}
|
}
|
||||||
// TODO: virtual QSize sizeHint() const
|
sizeHint(): QSize {
|
||||||
|
return QSize.fromQVariant(this.property('sizeHint'));
|
||||||
|
}
|
||||||
// TODO: QSize sizeIncrement() const
|
// TODO: QSize sizeIncrement() const
|
||||||
// TODO: QSizePolicy sizePolicy() const
|
// TODO: QSizePolicy sizePolicy() const
|
||||||
// TODO: void stackUnder(QWidget *w)
|
// TODO: void stackUnder(QWidget *w)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user