Add some missing geometry methods to QWidget

This commit is contained in:
Simon Edwards 2021-08-13 15:53:00 +02:00
parent c26a194694
commit 080bb3626d

View File

@ -106,6 +106,9 @@ export abstract class NodeWidget<Signals extends QWidgetSignals> extends YogaWid
const preparedSheet = prepareInlineStyleSheet(this, style);
this.native.setStyleSheet(preparedSheet);
}
frameGeometry(): QRect {
return QRect.fromQVariant(this.property('frameGeometry'));
}
setGeometry(x: number, y: number, w: number, h: number): void {
this.native.setGeometry(x, y, w, h);
}
@ -295,6 +298,12 @@ export abstract class NodeWidget<Signals extends QWidgetSignals> extends YogaWid
clearFocus(): void {
this.native.clearFocus();
}
x(): number {
return this.property('x').toInt();
}
y(): number {
return this.property('y').toInt();
}
}
export interface QWidgetSignals extends QObjectSignals {