Qt: Inhibit screensaver for all platforms using Qt5.

This commit is contained in:
Sacha 2014-07-22 16:03:42 +10:00
parent db6a57c8fe
commit 8c1a48b90c

View File

@ -15,6 +15,7 @@
#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0) #if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
#include <QStandardPaths> #include <QStandardPaths>
#include <QScreenSaver>
#endif #endif
#ifdef __SYMBIAN32__ #ifdef __SYMBIAN32__
@ -122,11 +123,14 @@ static int mainInternal(QApplication &a)
emugl->showFullScreen(); emugl->showFullScreen();
#endif #endif
EnableFZ(); EnableFZ();
#ifdef __SYMBIAN32__
// Disable screensaver // Disable screensaver
QScopedPointer<QSystemScreenSaver> ssObject(new QSystemScreenSaver(emugl)); #ifdef __SYMBIAN32__
ssObject->setScreenSaverInhibit(); QSystemScreenSaver ssObject(emugl);
ssObject.setScreenSaverInhibit();
QScopedPointer<SymbianMediaKeys> mediakeys(new SymbianMediaKeys()); QScopedPointer<SymbianMediaKeys> mediakeys(new SymbianMediaKeys());
#elif QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
QScreenSaver ssObject(emugl);
ssObject.setScreenSaverEnabled(false);
#endif #endif
#ifdef QT_HAS_SDL #ifdef QT_HAS_SDL