Replace deprecated QDesktop::numScreens() call
parent
c7432f10b2
commit
6e871064e4
|
@ -38,6 +38,7 @@
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include <QScreen>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -446,10 +447,9 @@ void CelestiaAppWindow::readSettings()
|
||||||
// Make sure that the saved size fits on screen; it's possible for the previous saved
|
// Make sure that the saved size fits on screen; it's possible for the previous saved
|
||||||
// position to be off-screen if the monitor settings have changed.
|
// position to be off-screen if the monitor settings have changed.
|
||||||
bool onScreen = false;
|
bool onScreen = false;
|
||||||
for (int screenIndex = 0; screenIndex < desktop.numScreens(); screenIndex++)
|
foreach (const QScreen *screen, QGuiApplication::screens())
|
||||||
{
|
{
|
||||||
QRect screenGeometry = desktop.screenGeometry(screenIndex);
|
if (screen->geometry().contains(windowPosition))
|
||||||
if (screenGeometry.contains(windowPosition))
|
|
||||||
onScreen = true;
|
onScreen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue