update:全屏状态禁止电脑锁屏(qt未提供跨平台方案,目前仅windows,可参考sdl找到跨平台方案)

This commit is contained in:
Barry 2019-01-27 00:03:40 +08:00
parent d3421afc72
commit f6b5ec61d7

View file

@ -233,10 +233,18 @@ void VideoForm::switchFullScreen()
showNormal();
updateStyleSheet(height() > width());
showToolFrom(true);
#ifdef Q_OS_WIN32
::SetThreadExecutionState(ES_CONTINUOUS);
#endif
} else {
showToolFrom(false);
layout()->setContentsMargins(0, 0, 0, 0);
showFullScreen();
// 全屏状态禁止电脑休眠、息屏
#ifdef Q_OS_WIN32
::SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED);
#endif
}
}