diff --git a/src/cpp/core/FlexLayout/flexlayout.cpp b/src/cpp/core/FlexLayout/flexlayout.cpp index 232fdbe95..ad87c0ded 100644 --- a/src/cpp/core/FlexLayout/flexlayout.cpp +++ b/src/cpp/core/FlexLayout/flexlayout.cpp @@ -16,6 +16,7 @@ FlexLayout::NodeContext *FlexLayout::getNodeContext(YGNodeRef node) FlexLayout::FlexLayout(QWidget *parentWidget, YGNodeRef parentNode): QLayout(parentWidget) { + // spdlog::set_level(spdlog::level::off); this->node = parentNode; } diff --git a/src/lib/QtWidgets/QMainWindow/index.ts b/src/lib/QtWidgets/QMainWindow/index.ts index fc6f21b69..ab3d26398 100644 --- a/src/lib/QtWidgets/QMainWindow/index.ts +++ b/src/lib/QtWidgets/QMainWindow/index.ts @@ -1,7 +1,6 @@ import addon from "../../core/addon"; import { NodeWidget } from "../../QtGui/QWidget"; import { BaseWidgetEvents } from "../../core/EventWidget"; -import { FlexNode } from "../../core/YogaWidget"; import { NativeElement } from "../../core/Component"; import { NodeLayout } from "../QLayout"; @@ -24,7 +23,14 @@ export class QMainWindow extends NodeWidget { // bind member functions this.setCentralWidget.bind(this); this.setFixedSize.bind(this); - this.setLayout = this._setLayout.bind(this); + this.setLayout = (parentLayout: NodeLayout) => { + if (this.centralWidget) { + this.centralWidget.setLayout(parentLayout); + } else { + this.native.setLayout(parentLayout.native); + super.layout = parentLayout; + } + }; } setCentralWidget(widget: NodeWidget) { this.centralWidget = widget; @@ -40,13 +46,6 @@ export class QMainWindow extends NodeWidget { return super.layout; } } - private _setLayout(parentLayout: NodeLayout) { - if (this.centralWidget) { - return this.centralWidget.setLayout(parentLayout); - } else { - return super.setLayout(parentLayout); - } - } setFixedSize(width: number, height: number) { this.native.setFixedSize(width, height); }