]> git.lyx.org Git - features.git/commitdiff
QDesktopWidget is not required in Qt5, the Qt6 code works
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 5 Mar 2023 20:54:08 +0000 (21:54 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 5 Mar 2023 20:54:08 +0000 (21:54 +0100)
src/frontends/qt/GuiApplication.cpp
src/frontends/qt/IconPalette.cpp

index 5750df925056005e5434b4c255d852398b7484f6..f8a3e7607517cf44c91c491c17ded1227736e6fe 100644 (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 == '-')
index a3ed7b25007d4e781f6a1e3d53f61c0b9df650da..7a5b1f33331e26e064f040ebc7bf3b9f12f67c9b 100644 (file)
 #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());