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

@@ -1133,7 +1133,12 @@ void NetHackQtTextWindow::Display(bool block UNUSED)
search.show();
rip.hide();
}
int mh = screen()->size().height()*3/5;
#if QT_VERSION < 0x060000
QSize screensize = QApplication::desktop()->size();
#else
QSize screensize = screen()->size();
#endif
int mh = screensize.height()*3/5;
if ( (qt_compact_mode && lines->TotalHeight() > mh) || use_rip ) {
// big, so make it fill
showMaximized();