From 3279d9c3f671e55eeeb098a9eb383253cea02f6b Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 3 Oct 2024 00:15:53 -0500 Subject: [PATCH] Fix QML component versioning error on Qt 5 --- app/gui/main.qml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/gui/main.qml b/app/gui/main.qml index 97532bbf..51d4b2db 100644 --- a/app/gui/main.qml +++ b/app/gui/main.qml @@ -23,6 +23,7 @@ ApplicationWindow { width: 1280 height: 600 + // This function runs prior to creation of the initial StackView item function doEarlyInit() { // Override the background color to Material 2 colors for Qt 6.5+ // in order to improve contrast between GFE's placeholder box art @@ -87,16 +88,14 @@ ApplicationWindow { StackView { id: stackView - initialItem: initialView anchors.fill: parent focus: true - onEmptyChanged: { - // Hijack this callback to perform our very early init - // that runs before the first StackView item is pushed - if (!empty) { - doEarlyInit(); - } + Component.onCompleted: { + // Perform our early initialization before constructing + // the initial view and pushing it to the StackView + doEarlyInit() + push(initialView) } onCurrentItemChanged: {