From 1aa6482a59315c635c545525d2abfb2c84aad7e3 Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 24 Feb 2016 21:50:37 +0200 Subject: [PATCH] Fix bug #1845, closing the Qt launcher Intercept the close event and quit the app instead of continuing to run the main FlightGear application. https://sourceforge.net/p/flightgear/codetickets/1845/ --- src/GUI/QtLauncher.cxx | 5 +++++ src/GUI/QtLauncher_private.hxx | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/GUI/QtLauncher.cxx b/src/GUI/QtLauncher.cxx index 2a8b049c0..3cc0f201d 100644 --- a/src/GUI/QtLauncher.cxx +++ b/src/GUI/QtLauncher.cxx @@ -725,6 +725,11 @@ void QtLauncher::setEnableDisableOptionFromCheckbox(QCheckBox* cbox, QString nam } } +void QtLauncher::closeEvent(QCloseEvent *event) +{ + qApp->exit(-1); +} + void QtLauncher::onRun() { flightgear::Options* opt = flightgear::Options::sharedInstance(); diff --git a/src/GUI/QtLauncher_private.hxx b/src/GUI/QtLauncher_private.hxx index f5eea7ade..c2a06b639 100644 --- a/src/GUI/QtLauncher_private.hxx +++ b/src/GUI/QtLauncher_private.hxx @@ -53,6 +53,10 @@ public: void setSceneryPaths(); +protected: + virtual void closeEvent(QCloseEvent *event); + + private slots: // run is used when the launcher is invoked before the main app is // started -- 2.39.5