From 3d0cd6e5fc7498f28e72dcdbd576d3de3613d800 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 23 Dec 2016 14:14:46 +0100 Subject: [PATCH] make some Qt5 specific changes for session management --- src/Gui/GuiApplication.cpp | 10 ++++++++-- src/Gui/GuiApplication.h | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Gui/GuiApplication.cpp b/src/Gui/GuiApplication.cpp index 00b15f2c46..76f9d39478 100644 --- a/src/Gui/GuiApplication.cpp +++ b/src/Gui/GuiApplication.cpp @@ -62,8 +62,14 @@ using namespace Gui; GUIApplication::GUIApplication(int & argc, char ** argv) : GUIApplicationNativeEventAware(argc, argv) { +#if QT_VERSION > 0x050000 + // In Qt 4.x 'commitData' is a virtual method connect(this, SIGNAL(commitDataRequest(QSessionManager &)), - SLOT(slotCommitData(QSessionManager &)), Qt::DirectConnection); + SLOT(commitData(QSessionManager &)), Qt::DirectConnection); +#endif +#if QT_VERSION >= 0x050600 + setFallbackSessionManagementEnabled(false); +#endif } GUIApplication::~GUIApplication() @@ -132,7 +138,7 @@ bool GUIApplication::notify (QObject * receiver, QEvent * event) return true; } -void GUIApplication::slotCommitData(QSessionManager &manager) +void GUIApplication::commitData(QSessionManager &manager) { if (manager.allowsInteraction()) { if (!Gui::getMainWindow()->close()) { diff --git a/src/Gui/GuiApplication.h b/src/Gui/GuiApplication.h index 1f781a93f5..de026baff4 100644 --- a/src/Gui/GuiApplication.h +++ b/src/Gui/GuiApplication.h @@ -54,7 +54,7 @@ public: boost::shared_ptr caughtException; public Q_SLOTS: - void slotCommitData(QSessionManager &manager); + void commitData(QSessionManager &manager); protected: bool event(QEvent * event);