make some Qt5 specific changes for session management
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
boost::shared_ptr<Base::SystemExitException> caughtException;
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotCommitData(QSessionManager &manager);
|
||||
void commitData(QSessionManager &manager);
|
||||
|
||||
protected:
|
||||
bool event(QEvent * event);
|
||||
|
||||
Reference in New Issue
Block a user