From f72f4f2a16f38957b5fa8e60ba38a5d96ab22c31 Mon Sep 17 00:00:00 2001
From: Marco Matthies <71844+marcom@users.noreply.github.com>
Date: Thu, 23 May 2024 19:58:43 +0200
Subject: [PATCH] Fix crash when opening Configuration window from the menubar

---
 src/config.qml | 4 ++--
 src/main.qml   | 7 ++++++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/config.qml b/src/config.qml
index 3d8711f..c6ee13c 100644
--- a/src/config.qml
+++ b/src/config.qml
@@ -10,7 +10,7 @@ import QtQuick.Layouts
 import QtQuick.Dialogs
 import org.julialang
 
-ApplicationWindow {
+Window {
     id: configWindow
     title: "Configure simulation"
     width: 700
@@ -222,7 +222,7 @@ ApplicationWindow {
         // insectmodel
     }
 
-    footer: ToolBar {
+    ToolBar {
         RowLayout {
             anchors.right: parent.right
             layoutDirection: Qt.RightToLeft
diff --git a/src/main.qml b/src/main.qml
index c047a52..eca6820 100644
--- a/src/main.qml
+++ b/src/main.qml
@@ -17,6 +17,10 @@ ApplicationWindow {
     visibility: "Maximized"
     visible: true
 
+    Loader {
+        id: loader
+    }
+
     menuBar: MenuBar {
         Menu {
             title: "&Simulation"
@@ -26,7 +30,8 @@ ApplicationWindow {
             }
             Action {
                 text: "&Configure Simulation"
-                onTriggered: { Julia.configwindow() }
+                //onTriggered: { Julia.configwindow() }
+                onTriggered: loader.source = "config.qml"
             }
             Action {
                 text: "&Load Saved State"
-- 
GitLab