diff --git a/src/Gui/GuiApplication.cpp b/src/Gui/GuiApplication.cpp index eb7801544..00b15f2c4 100644 --- a/src/Gui/GuiApplication.cpp +++ b/src/Gui/GuiApplication.cpp @@ -62,6 +62,8 @@ using namespace Gui; GUIApplication::GUIApplication(int & argc, char ** argv) : GUIApplicationNativeEventAware(argc, argv) { + connect(this, SIGNAL(commitDataRequest(QSessionManager &)), + SLOT(slotCommitData(QSessionManager &)), Qt::DirectConnection); } GUIApplication::~GUIApplication() @@ -130,7 +132,7 @@ bool GUIApplication::notify (QObject * receiver, QEvent * event) return true; } -void GUIApplication::commitData(QSessionManager &manager) +void GUIApplication::slotCommitData(QSessionManager &manager) { if (manager.allowsInteraction()) { if (!Gui::getMainWindow()->close()) { diff --git a/src/Gui/GuiApplication.h b/src/Gui/GuiApplication.h index b245ae02f..1f781a93f 100644 --- a/src/Gui/GuiApplication.h +++ b/src/Gui/GuiApplication.h @@ -49,11 +49,13 @@ public: * where an unhandled exception comes from. */ bool notify (QObject * receiver, QEvent * event); - void commitData(QSessionManager &manager); /// Pointer to exceptions caught in Qt event handler boost::shared_ptr caughtException; +public Q_SLOTS: + void slotCommitData(QSessionManager &manager); + protected: bool event(QEvent * event); };