diff --git a/src/lib/QtWidgets/QBoxLayout.ts b/src/lib/QtWidgets/QBoxLayout.ts index 980d05fe3..8c9e6787d 100644 --- a/src/lib/QtWidgets/QBoxLayout.ts +++ b/src/lib/QtWidgets/QBoxLayout.ts @@ -6,7 +6,7 @@ import { Direction } from '../QtEnums'; export class QBoxLayout extends NodeLayout { native: NativeElement; - layout: NodeLayout | null; + childLayouts: Set; constructor(dir: Direction, parent?: NodeWidget) { let native: NativeElement; if (parent) { @@ -17,11 +17,11 @@ export class QBoxLayout extends NodeLayout { super(native); this.nodeParent = parent; this.native = native; - this.layout = null; + this.childLayouts = new Set(); } addLayout(layout: NodeLayout, stretch = 0): void { this.native.addLayout(layout.native, stretch); - this.layout = layout; + this.childLayouts.add(layout); } addSpacing(size: number): void { this.native.addSpacing(size); @@ -41,7 +41,7 @@ export class QBoxLayout extends NodeLayout { } insertLayout(index: number, layout: NodeLayout, stretch = 0): void { this.native.insertLayout(index, layout.native, stretch); - this.layout = layout; + this.childLayouts.add(layout); } removeWidget(widget: NodeWidget): void { this.native.removeWidget(widget.native);