QDesktopWidget is not required in Qt5, the Qt6 code works

This commit is contained in:
Jean-Marc Lasgouttes 2023-03-05 21:54:08 +01:00
parent 9156843ec2
commit e2e1fd6ea9
2 changed files with 1 additions and 16 deletions

View File

@ -89,9 +89,6 @@
#include <QByteArray>
#include <QBitmap>
#include <QDateTime>
#if QT_VERSION < 0x060000
#include <QDesktopWidget>
#endif
#include <QEvent>
#include <QFileOpenEvent>
#include <QFileInfo>
@ -2638,11 +2635,7 @@ void GuiApplication::createView(QString const & geometry_arg, bool autoShow,
// Negative displacements must be interpreted as distances
// from the right or bottom screen borders.
if (sx == '-' || sy == '-') {
#if QT_VERSION < 0x060000
QRect rec = QApplication::desktop()->screenGeometry();
#else
QRect rec = QGuiApplication::primaryScreen()->geometry();
#endif
if (sx == '-')
x += rec.width() - w - framewidth;
if (sy == '-')

View File

@ -19,17 +19,13 @@
#include <QToolTip>
#include <QToolBar>
#include <QApplication>
#if QT_VERSION < 0x060000
#include <QDesktopWidget>
#endif
#include <QPainter>
#include <QScreen>
#include <QStyle>
#include <QStyleOptionFrame>
#include <QMouseEvent>
#include <QVBoxLayout>
#if QT_VERSION >= 0x060000
#include <QWindow>
#endif
namespace lyx {
namespace frontend {
@ -181,11 +177,7 @@ void IconPalette::showEvent(QShowEvent * /*event*/)
voffset -= parheight;
}
#if QT_VERSION < 0x060000
QRect const screen = qApp->desktop()->availableGeometry(this);
#else
QRect const screen = window()->windowHandle()->screen()->availableGeometry();
#endif
QPoint const gpos = parentWidget()->mapToGlobal(
parentWidget()->geometry().bottomLeft());