Use QApplication::desktop for screen size on Qt5

5.15 has QWidget::screen, but older versions don't.
This commit is contained in:
Ray Chason
2021-12-29 01:44:02 -05:00
committed by PatR
parent 1f7541e496
commit 1f2a1efee5
3 changed files with 20 additions and 5 deletions

View File

@@ -861,9 +861,14 @@ NetHackQtMainWindow::NetHackQtMainWindow(NetHackQtKeyBuffer& ks) :
setMenu (menubar);
#endif
#if QT_VERSION < 0x060000
QSize screensize = QApplication::desktop()->size();
#else
QSize screensize = screen()->size();
#endif
int x=0,y=0;
int w=screen()->size().width()-10; // XXX arbitrary extra space for frame
int h=screen()->size().height()-50;
int w=screensize.width()-10; // XXX arbitrary extra space for frame
int h=screensize.height()-50;
int maxwn;
int maxhn;