configure.ac                   |    2 +-
 vcl/qt5/QtAccessibleWidget.cxx |    4 ----
 vcl/qt5/QtFrame.cxx            |   28 +---------------------------
 vcl/qt5/QtGraphics_GDI.cxx     |    7 -------
 vcl/qt5/QtSvpGraphics.cxx      |    7 -------
 vcl/qt5/QtWidget.cxx           |    4 ----
 6 files changed, 2 insertions(+), 50 deletions(-)

New commits:
commit afb4c96d271958ced3175dfc2cf8bb9e8b0a9d3b
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Aug 3 21:30:22 2023 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Oct 18 08:04:32 2023 +0200

    qt: Drop code for Qt < 5.15
    
    Our new AlmaLinux 8 baseline provides Qt 5.15.3,
    so require 5.15 and drop the code for older, now
    unsupported Qt versions.
    
    Change-Id: I512ade1ba503fc7a86527a45142f37f043db6784
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155325
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/configure.ac b/configure.ac
index 189ef4a55222..39857bb25f6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13039,7 +13039,7 @@ then
             AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root 
of your Qt5 installation by exporting QT5DIR before running "configure".])
         fi
         qmake5_minor_version="`echo $qmake5_test_ver | cut -d. -f2`"
-        qt5_minimal_minor="6"
+        qt5_minimal_minor="15"
         if test "$qmake5_minor_version" -lt "$qt5_minimal_minor"; then
             AC_MSG_ERROR([The minimal supported Qt5 version is 
5.${qt5_minimal_minor}, but your 'qmake -v' reports Qt5 version 
$qmake5_test_ver.])
         else
diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index d6112bdf8223..cd50af4aed9f 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -452,11 +452,7 @@ QAccessible::Role QtAccessibleWidget::role() const
         case AccessibleRole::MENU_ITEM:
             return QAccessible::MenuItem;
         case AccessibleRole::NOTIFICATION:
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 5)
             return QAccessible::Notification;
-#else
-            return QAccessible::StaticText;
-#endif
         case AccessibleRole::OPTION_PANE:
             return QAccessible::Pane;
         case AccessibleRole::PAGE_TAB:
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index f3cc0facfe8a..7a9b5f3861f8 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -50,9 +50,6 @@
 #include <QtWidgets/QStyle>
 #include <QtWidgets/QToolTip>
 #include <QtWidgets/QApplication>
-#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
-#include <QtWidgets/QDesktopWidget>
-#endif
 #include <QtWidgets/QMenuBar>
 #include <QtWidgets/QMainWindow>
 #if CHECK_QT5_USING_X11
@@ -341,18 +338,7 @@ QWindow* QtFrame::windowHandle() const
     return pChild->windowHandle();
 }
 
-QScreen* QtFrame::screen() const
-{
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
-    return asChild()->screen();
-#else
-    // QWidget::screen only available from Qt 5.14 on, call windowHandle(),
-    // with the indirect result that mouse move events on Wayland will not be
-    // emitted reliably, s. QTBUG-75766
-    QWindow* const pWindow = windowHandle();
-    return pWindow ? pWindow->screen() : nullptr;
-#endif
-}
+QScreen* QtFrame::screen() const { return asChild()->screen(); }
 
 bool QtFrame::GetUseDarkMode() const
 {
@@ -515,13 +501,7 @@ Size QtFrame::CalcDefaultSize()
         }
         else
         {
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
             QScreen* pScreen = QGuiApplication::screenAt(QPoint(0, 0));
-#else
-            // QGuiApplication::screenAt was added in Qt 5.10, use deprecated 
QDesktopWidget
-            int nLeftScreen = QApplication::desktop()->screenNumber(QPoint(0, 
0));
-            QScreen* pScreen = QGuiApplication::screens()[nLeftScreen];
-#endif
             aSize = toSize(pScreen->availableVirtualGeometry().size());
         }
     }
@@ -1321,13 +1301,7 @@ void QtFrame::SetScreenNumber(unsigned int nScreen)
         {
             assert(m_bFullScreen);
             // left-most screen
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
             QScreen* pScreen = QGuiApplication::screenAt(QPoint(0, 0));
-#else
-            // QGuiApplication::screenAt was added in Qt 5.10, use deprecated 
QDesktopWidget
-            int nLeftScreen = QApplication::desktop()->screenNumber(QPoint(0, 
0));
-            QScreen* pScreen = QGuiApplication::screens()[nLeftScreen];
-#endif
             // entire virtual desktop
             screenGeo = pScreen->availableVirtualGeometry();
             pWindow->setScreen(pScreen);
diff --git a/vcl/qt5/QtGraphics_GDI.cxx b/vcl/qt5/QtGraphics_GDI.cxx
index a8ec20f60080..2005de80f7ba 100644
--- a/vcl/qt5/QtGraphics_GDI.cxx
+++ b/vcl/qt5/QtGraphics_GDI.cxx
@@ -702,14 +702,7 @@ void QtGraphics::GetResolution(sal_Int32& rDPIX, 
sal_Int32& rDPIY)
     if (!m_pFrame)
         return;
 
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
     QScreen* pScreen = m_pFrame->GetQWidget()->screen();
-#else
-    if (!m_pFrame->GetQWidget()->window()->windowHandle())
-        return;
-
-    QScreen* pScreen = 
m_pFrame->GetQWidget()->window()->windowHandle()->screen();
-#endif
     rDPIX = pScreen->logicalDotsPerInchX() * pScreen->devicePixelRatio() + 0.5;
     rDPIY = pScreen->logicalDotsPerInchY() * pScreen->devicePixelRatio() + 0.5;
 }
diff --git a/vcl/qt5/QtSvpGraphics.cxx b/vcl/qt5/QtSvpGraphics.cxx
index 8ae869a1c247..903fee1f56a4 100644
--- a/vcl/qt5/QtSvpGraphics.cxx
+++ b/vcl/qt5/QtSvpGraphics.cxx
@@ -106,14 +106,7 @@ void QtSvpGraphics::GetResolution(sal_Int32& rDPIX, 
sal_Int32& rDPIY)
     if (!m_pFrame)
         return;
 
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
     QScreen* pScreen = m_pFrame->GetQWidget()->screen();
-#else
-    if (!m_pFrame->GetQWidget()->window()->windowHandle())
-        return;
-
-    QScreen* pScreen = 
m_pFrame->GetQWidget()->window()->windowHandle()->screen();
-#endif
     rDPIX = pScreen->logicalDotsPerInchX() * pScreen->devicePixelRatio() + 0.5;
     rDPIY = pScreen->logicalDotsPerInchY() * pScreen->devicePixelRatio() + 0.5;
 }
diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx
index 48c0d22c58fd..aae1f52c4ec8 100644
--- a/vcl/qt5/QtWidget.cxx
+++ b/vcl/qt5/QtWidget.cxx
@@ -240,12 +240,8 @@ void QtWidget::enterEvent(QEvent* pEvent)
 void QtWidget::wheelEvent(QWheelEvent* pEvent)
 {
     SalWheelMouseEvent aEvent;
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
     fillSalAbstractMouseEvent(m_rFrame, pEvent, pEvent->position().toPoint(), 
pEvent->buttons(),
                               width(), aEvent);
-#else
-    fillSalAbstractMouseEvent(m_rFrame, pEvent, pEvent->pos(), 
pEvent->buttons(), width(), aEvent);
-#endif
 
     // mouse wheel ticks are 120, which we map to 3 lines.
     // we have to accumulate for touch scroll to keep track of the absolute 
delta.

Reply via email to