mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-19 17:09:40 +00:00
Do not use deprecated Qt API in the launcher
This commit is contained in:
parent
e44021b369
commit
47a13f1ed2
1 changed files with 16 additions and 0 deletions
|
@ -5,6 +5,10 @@
|
|||
#include <QMessageBox>
|
||||
#include <QDir>
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
#include <QScreen>
|
||||
#endif
|
||||
|
||||
#ifdef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
// We need to do this because of Qt: https://bugreports.qt-project.org/browse/QTBUG-22154
|
||||
|
@ -311,6 +315,17 @@ QStringList Launcher::GraphicsPage::getAvailableResolutions(int screen)
|
|||
QRect Launcher::GraphicsPage::getMaximumResolution()
|
||||
{
|
||||
QRect max;
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
for (QScreen* screen : QGuiApplication::screens())
|
||||
{
|
||||
QRect res = screen->geometry();
|
||||
if (res.width() > max.width())
|
||||
max.setWidth(res.width());
|
||||
if (res.height() > max.height())
|
||||
max.setHeight(res.height());
|
||||
}
|
||||
#else
|
||||
int screens = QApplication::desktop()->screenCount();
|
||||
for (int i = 0; i < screens; ++i)
|
||||
{
|
||||
|
@ -320,6 +335,7 @@ QRect Launcher::GraphicsPage::getMaximumResolution()
|
|||
if (res.height() > max.height())
|
||||
max.setHeight(res.height());
|
||||
}
|
||||
#endif
|
||||
return max;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue