From: James Turner Date: Wed, 24 Feb 2016 19:50:37 +0000 (+0200) Subject: Fix bug #1845, closing the Qt launcher X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1aa6482a59315c635c545525d2abfb2c84aad7e3;p=flightgear.git 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/ --- 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