diff --git a/mix/qml/MainContent.qml b/mix/qml/MainContent.qml index 06dd863dc..c9495b81f 100644 --- a/mix/qml/MainContent.qml +++ b/mix/qml/MainContent.qml @@ -175,7 +175,6 @@ Rectangle { Layout.fillHeight: true Connections { target: projectModel.codeEditor - } } diff --git a/mix/qml/main.qml b/mix/qml/main.qml index fdb94c78b..a36307767 100644 --- a/mix/qml/main.qml +++ b/mix/qml/main.qml @@ -17,6 +17,25 @@ ApplicationWindow { minimumHeight: 300 title: qsTr("Mix") + Connections + { + target: mainApplication + onClosing: + { + mainApplication.close(); + close.accepted = false; + } + } + + function close() + { + projectModel.appIsClosing = true; + if (projectModel.projectPath !== "") + projectModel.closeProject(function() { Qt.quit(); }) + else + Qt.quit(); + } + menuBar: MenuBar { Menu { title: qsTr("File") @@ -95,9 +114,7 @@ ApplicationWindow { shortcut: "Ctrl+Q" onTriggered: { - projectModel.appIsClosing = true; - if (projectModel.projectPath !== "") - projectModel.closeProject(function() { Qt.quit(); }) + mainApplication.close(); } }