Qt6: deal with changes to window and layout geometry APIs

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2022-02-09 17:00:48 -08:00
parent e29ecf2c9a
commit e61509b032
3 changed files with 15 additions and 1 deletions

View file

@ -20,7 +20,9 @@
#include <QItemSelectionModel>
#include <qmessagebox.h>
#include <cstdlib>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QDesktopWidget>
#endif
#include <QFileDialog>
#include <QScrollBar>
@ -587,7 +589,11 @@ void DiveLocationLineEdit::keyPressEvent(QKeyEvent *ev)
void DiveLocationLineEdit::fixPopupPosition()
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
const QRect screen = this->screen()->availableGeometry();
#else
const QRect screen = QApplication::desktop()->availableGeometry(this);
#endif
const int maxVisibleItems = 5;
QPoint pos;
int rh, w;