From 340c9a25a8a8d3143415cf130d0fd5f16e0bc2e8 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Tue, 21 Jan 2025 22:59:33 +0200
Subject: [PATCH 28/28] Clean out qt5 support code

See RM #1219

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 client/gui-qt/citydlg.cpp    | 16 ----------------
 client/gui-qt/citydlg.h      |  9 ---------
 client/gui-qt/dialogs.cpp    |  8 ++++----
 client/gui-qt/fc_client.cpp  | 11 -----------
 client/gui-qt/fonts.cpp      |  7 -------
 client/gui-qt/gui_main.cpp   |  8 +++-----
 client/gui-qt/gui_main.h     |  8 --------
 client/gui-qt/hudwidget.cpp  | 12 ------------
 client/gui-qt/hudwidget.h    |  8 --------
 client/gui-qt/mapview.cpp    | 13 +++++++------
 client/gui-qt/messagewin.cpp | 18 +++---------------
 client/gui-qt/messagewin.h   |  4 ----
 client/gui-qt/pages.cpp      | 23 +++++++----------------
 client/gui-qt/repodlgs.cpp   |  6 +-----
 client/gui-qt/repodlgs.h     |  4 ----
 client/gui-qt/sidebar.cpp    |  4 ----
 client/gui-qt/sidebar.h      |  4 ----
 client/gui-qt/sprite.cpp     | 30 ------------------------------
 tools/fcmp/mpgui_qt.cpp      |  8 +++-----
 tools/ruledit/ruledit_qt.cpp |  8 +++-----
 20 files changed, 31 insertions(+), 178 deletions(-)

diff --git a/client/gui-qt/citydlg.cpp b/client/gui-qt/citydlg.cpp
index 370831f688..a2184d6257 100644
--- a/client/gui-qt/citydlg.cpp
+++ b/client/gui-qt/citydlg.cpp
@@ -412,11 +412,7 @@ void impr_item::init_pix()
 /************************************************************************//**
   Mouse enters widget
 ****************************************************************************/
-#ifndef FC_QT5_MODE
 void impr_item::enterEvent(QEnterEvent *event)
-#else  // FC_QT5_MODE
-void impr_item::enterEvent(QEvent *event)
-#endif // FC_QT5_MODE
 {
   struct sprite *sprite;
   QPainter p;
@@ -962,11 +958,7 @@ void unit_item::fortify_unit()
 /************************************************************************//**
   Mouse entered widget
 ****************************************************************************/
-#ifndef FC_QT5_MODE
 void unit_item::enterEvent(QEnterEvent *event)
-#else  // FC_QT5_MODE
-void unit_item::enterEvent(QEvent *event)
-#endif // FC_QT5_MODE
 {
   QImage temp_img(unit_img.size(), QImage::Format_ARGB32_Premultiplied);
   QPainter p;
@@ -2842,11 +2834,7 @@ void city_dialog::display_worklist_menu(const QPoint &p)
       return;
     }
 
-#ifndef FC_QT5_MODE
     fc_assert_ret(id.typeId() == QMetaType::Int);
-#else  // FC_QT5_MODE
-    fc_assert_ret(id.type() == QVariant::Int);
-#endif // FC_QT5_MODE
 
     worklist = global_worklist_get(global_worklist_by_id(id.toInt()));
     city_set_queue(pcity, worklist);
@@ -2862,11 +2850,7 @@ void city_dialog::display_worklist_menu(const QPoint &p)
       return;
     }
 
-#ifndef FC_QT5_MODE
     fc_assert_ret(id.typeId() == QMetaType::Int);
-#else  // FC_QT5_MODE
-    fc_assert_ret(id.type() == QVariant::Int);
-#endif // FC_QT5_MODE
 
     worklist = global_worklist_get(global_worklist_by_id(id.toInt()));
     city_queue_insert_worklist(pcity, selected_row_p + 1, worklist);
diff --git a/client/gui-qt/citydlg.h b/client/gui-qt/citydlg.h
index dc4be42fa0..2b064e8813 100644
--- a/client/gui-qt/citydlg.h
+++ b/client/gui-qt/citydlg.h
@@ -184,11 +184,7 @@ protected:
   void wheelEvent(QWheelEvent *event);
   void mousePressEvent(QMouseEvent *event);
   void leaveEvent(QEvent *event);
-#ifndef FC_QT5_MODE
   void enterEvent(QEnterEvent *event);
-#else  // FC_QT5_MODE
-  void enterEvent(QEvent *event);
-#endif // FC_QT5_MODE
 };
 
 /****************************************************************************
@@ -237,14 +233,9 @@ protected:
   void wheelEvent(QWheelEvent *event);
   void mouseDoubleClickEvent(QMouseEvent *event);
   void leaveEvent(QEvent *event);
-#ifndef FC_QT5_MODE
   void enterEvent(QEnterEvent *event);
-#else  // FC_QT5_MODE
-  void enterEvent(QEvent *event);
-#endif // FC_QT5_MODE
 };
 
-
 /****************************************************************************
   Shows list of improvements
 ****************************************************************************/
diff --git a/client/gui-qt/dialogs.cpp b/client/gui-qt/dialogs.cpp
index 48b6e9dbd5..ea867300a7 100644
--- a/client/gui-qt/dialogs.cpp
+++ b/client/gui-qt/dialogs.cpp
@@ -392,7 +392,7 @@ void qfc_dialog::paintEvent(QPaintEvent *event)
 void qfc_dialog::mouseMoveEvent(QMouseEvent *event)
 {
   if (moving_now) {
-    move(mevent_gpos(event) - point);
+    move(event->globalPosition().toPoint() - point);
   }
 }
 
@@ -407,7 +407,7 @@ void qfc_dialog::mousePressEvent(QMouseEvent *event)
 
   if (y <= titlebar_height
       && x <= width() - close_pix.width()) {
-    point = mevent_gpos(event) - geometry().topLeft();
+    point = event->globalPosition().toPoint() - geometry().topLeft();
     moving_now = true;
     setCursor(Qt::SizeAllCursor);
   } else if (y <= titlebar_height
@@ -982,7 +982,7 @@ void notify_dialog::paintEvent(QPaintEvent *paint_event)
 ***************************************************************************/
 void notify_dialog::mousePressEvent(QMouseEvent *event)
 {
-  cursor = mevent_gpos(event) - geometry().topLeft();
+  cursor = event->globalPosition().toPoint() - geometry().topLeft();
 
   if (event->button() == Qt::RightButton) {
     was_destroyed = true;
@@ -995,7 +995,7 @@ void notify_dialog::mousePressEvent(QMouseEvent *event)
 ***************************************************************************/
 void notify_dialog::mouseMoveEvent(QMouseEvent *event)
 {
-  move(mevent_gpos(event) - cursor);
+  move(event->globalPosition().toPoint() - cursor);
 
   setCursor(Qt::SizeAllCursor);
 }
diff --git a/client/gui-qt/fc_client.cpp b/client/gui-qt/fc_client.cpp
index 6b1d349d54..0eff5db65e 100644
--- a/client/gui-qt/fc_client.cpp
+++ b/client/gui-qt/fc_client.cpp
@@ -33,11 +33,6 @@
 #include <QStyleFactory>
 #include <QTabBar>
 #include <QTextBlock>
-
-#ifdef FC_QT5_MODE
-#include <QTextCodec>
-#endif // FC_QT5_MODE
-
 #include <QTextEdit>
 
 // common
@@ -70,10 +65,6 @@ fc_client::fc_client() : QMainWindow()
 {
   QString wtitle;
 
-#ifdef FC_QT5_MODE
-  QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
-#endif // FC_QT5_MODE
-
   /**
    * Somehow client-common asks to switch to page when all widgets
    * haven't been created yet by Qt, even constructor finished job,
@@ -137,8 +128,6 @@ fc_client::fc_client() : QMainWindow()
   wtitle = wtitle.arg(
 #ifdef FC_QT6X_MODE
                       "Qt6x"
-#elif FC_QT5_MODE
-                      "Qt5"
 #else  // FC_QT6X_MODE
                       "Qt6"
 #endif // FC_QT6X_MODE
diff --git a/client/gui-qt/fonts.cpp b/client/gui-qt/fonts.cpp
index 21b62d3f66..4a552762de 100644
--- a/client/gui-qt/fonts.cpp
+++ b/client/gui-qt/fonts.cpp
@@ -217,9 +217,6 @@ void configure_fonts()
 QString configure_font(QString font_name, QStringList sl, int size,
                        bool bold)
 {
-#ifdef FC_QT5_MODE
-  QFontDatabase database;
-#endif
   QString str;
   QFont *f;
   QString style;
@@ -229,11 +226,7 @@ QString configure_font(QString font_name, QStringList sl, int size,
   }
 
   foreach (str, sl)  {
-#ifndef FC_QT5_MODE
     QList<int> sizes = QFontDatabase::smoothSizes(str, style);
-#else  // FC_QT5_MODE
-    QList<int> sizes = database.smoothSizes(str, style);
-#endif // FC_QT5_MODE
 
     if (!sizes.isEmpty()) {
       QListIterator<int> i(sizes);
diff --git a/client/gui-qt/gui_main.cpp b/client/gui-qt/gui_main.cpp
index 43684c1cf2..e8766b8676 100644
--- a/client/gui-qt/gui_main.cpp
+++ b/client/gui-qt/gui_main.cpp
@@ -591,13 +591,11 @@ void qtg_insert_client_build_info(char *outbuf, size_t outlen)
   cat_snprintf(outbuf, outlen, _("\nBuilt against Qt %s, using %s"),
                QT_VERSION_STR, ver.data());
 
-#ifdef FC_QT5_MODE
-  cat_snprintf(outbuf, outlen, _("\nBuilt in Qt5 mode."));
-#elif defined(FC_QT6X_MODE)
+#if defined(FC_QT6X_MODE)
   cat_snprintf(outbuf, outlen, _("\nBuilt in Qt6x mode."));
-#else  // FC_QT5_MODE
+#else  // FC_QT6X_MODE
   cat_snprintf(outbuf, outlen, _("\nBuilt in Qt6 mode."));
-#endif // FC_QT5_MODE
+#endif // FC_QT6X_MODE
 }
 
 /**********************************************************************//**
diff --git a/client/gui-qt/gui_main.h b/client/gui-qt/gui_main.h
index 6e675ff855..d825cba768 100644
--- a/client/gui-qt/gui_main.h
+++ b/client/gui-qt/gui_main.h
@@ -17,14 +17,6 @@
 void popup_quit_dialog();
 QApplication *current_app();
 
-// Compatibility layer between Qt5 and Qt6 while we support
-// also the former.
-#ifndef FC_QT5_MODE
-#define mevent_gpos(__ev__) (__ev__)->globalPosition().toPoint()
-#else  // FC_QT5_MODE
-#define mevent_gpos(__ev__) (__ev__)->globalPos()
-#endif // FC_QT5_MODE
-
 #ifdef FREECIV_HAVE_CXX20_CAPTURE_THIS
 #define CAPTURE_DEFAULT_THIS [=, this]
 #else  // FREECIV_HAVE_CXX20_CAPTURE_THIS
diff --git a/client/gui-qt/hudwidget.cpp b/client/gui-qt/hudwidget.cpp
index 7cd9950cdc..08522fc671 100644
--- a/client/gui-qt/hudwidget.cpp
+++ b/client/gui-qt/hudwidget.cpp
@@ -900,11 +900,7 @@ void hud_action::leaveEvent(QEvent *event)
 /************************************************************************//**
   Enter event for hud_action, used to get status of pixmap highlight
 ****************************************************************************/
-#ifndef FC_QT5_MODE
 void hud_action::enterEvent(QEnterEvent *event)
-#else  // FC_QT5_MODE
-void hud_action::enterEvent(QEvent *event)
-#endif // FC_QT5_MODE
 {
   focus = true;
   update();
@@ -1921,11 +1917,7 @@ void hud_unit_combat::leaveEvent(QEvent *event)
 /************************************************************************//**
   Leave event for hud unit combat. Shows highlight.
 ****************************************************************************/
-#ifndef FC_QT5_MODE
 void hud_unit_combat::enterEvent(QEnterEvent *event)
-#else  // FC_QT5_MODE
-void hud_unit_combat::enterEvent(QEvent *event)
-#endif // FC_QT5_MODE
 {
   focus = true;
   update();
@@ -1972,11 +1964,7 @@ void scale_widget::paintEvent(QPaintEvent *event)
 void scale_widget::mousePressEvent(QMouseEvent *event)
 {
   if (event->button() == Qt::LeftButton) {
-#ifndef FC_QT5_MODE
     if (event->position().x() <= size) {
-#else  // FC_QT5_MODE
-    if (event->localPos().x() <= size) {
-#endif // FC_QT5_MODE
       scale = scale / 1.2;
     } else {
       scale = scale * 1.2;
diff --git a/client/gui-qt/hudwidget.h b/client/gui-qt/hudwidget.h
index 8a7a8a3fb0..2d506c833a 100644
--- a/client/gui-qt/hudwidget.h
+++ b/client/gui-qt/hudwidget.h
@@ -171,11 +171,7 @@ protected:
   void mousePressEvent(QMouseEvent *e);
   void mouseMoveEvent(QMouseEvent *event);
   void leaveEvent(QEvent *event);
-#ifndef FC_QT5_MODE
   void enterEvent(QEnterEvent *event);
-#else  // FC_QT5_MODE
-  void enterEvent(QEvent *event);
-#endif // FC_QT5_MODE
 private slots:
   void on_clicked();
   void on_right_clicked();
@@ -307,11 +303,7 @@ protected:
   void paintEvent(QPaintEvent *event);
   void mousePressEvent(QMouseEvent *e);
   void leaveEvent(QEvent *event);
-#ifndef FC_QT5_MODE
   void enterEvent(QEnterEvent *event);
-#else  // FC_QT5_MODE
-  void enterEvent(QEvent *event);
-#endif // FC_QT5_MODE
 private:
   void init_images(bool redraw = false);
   int att_hp;
diff --git a/client/gui-qt/mapview.cpp b/client/gui-qt/mapview.cpp
index b237266e23..c641926d04 100644
--- a/client/gui-qt/mapview.cpp
+++ b/client/gui-qt/mapview.cpp
@@ -407,7 +407,7 @@ void move_widget::put_to_corner()
 void move_widget::mouseMoveEvent(QMouseEvent *event)
 {
   if (!gui()->interface_locked) {
-    parentWidget()->move(mevent_gpos(event) - point);
+    parentWidget()->move(event->globalPosition().toPoint() - point);
   }
 }
 
@@ -417,7 +417,8 @@ void move_widget::mouseMoveEvent(QMouseEvent *event)
 void move_widget::mousePressEvent(QMouseEvent *event)
 {
   if (!gui()->interface_locked) {
-    point = mevent_gpos(event) - parentWidget()->geometry().topLeft();
+    point = event->globalPosition().toPoint()
+      - parentWidget()->geometry().topLeft();
   }
 
   update();
@@ -457,7 +458,7 @@ void resize_widget::mouseMoveEvent(QMouseEvent *event)
     return;
   }
 
-  qp = mevent_gpos(event);
+  qp = event->globalPosition().toPoint();
   np.setX(qp.x() - point.x());
   np.setY(qp.y() - point.y());
   np.setX(qMax(np.x(), 32));
@@ -476,7 +477,7 @@ void resize_widget::mousePressEvent(QMouseEvent *event)
     return;
   }
 
-  qp = mevent_gpos(event);
+  qp = event->globalPosition().toPoint();
   point.setX(qp.x() - parentWidget()->width());
   point.setY(qp.y() - parentWidget()->height());
   update();
@@ -926,7 +927,7 @@ void minimap_view::mousePressEvent(QMouseEvent *event)
     if (gui()->interface_locked) {
       return;
     }
-    cursor = mevent_gpos(event) - geometry().topLeft();
+    cursor = event->globalPosition().toPoint() - geometry().topLeft();
   }
 
   if (event->button() == Qt::RightButton) {
@@ -965,7 +966,7 @@ void minimap_view::mouseMoveEvent(QMouseEvent *event)
     p = event->pos();
     r = mapTo(gui()->mapview_wdg, p);
     p = r - p;
-    move(mevent_gpos(event) - cursor);
+    move(event->globalPosition().toPoint() - cursor);
     setCursor(Qt::SizeAllCursor);
     gui()->qt_settings.minimap_x = static_cast<float>(p.x()) / mapview.width;
     gui()->qt_settings.minimap_y = static_cast<float>(p.y())
diff --git a/client/gui-qt/messagewin.cpp b/client/gui-qt/messagewin.cpp
index 4c42d09ac0..945f45ff9d 100644
--- a/client/gui-qt/messagewin.cpp
+++ b/client/gui-qt/messagewin.cpp
@@ -95,7 +95,7 @@ void info_tab::mousePressEvent(QMouseEvent *event)
     int x = pos.x();
     int y = pos.y();
 
-    cursor = mevent_gpos(event) - geometry().topLeft();
+    cursor = event->globalPosition().toPoint() - geometry().topLeft();
     if (y > 0 && y < 25 && x > width() - 25 && x < width()) {
       resize_mode = true;
       resxy = true;
@@ -161,14 +161,10 @@ void info_tab::mouseMoveEvent(QMouseEvent *event)
 
   if ((event->buttons() & Qt::LeftButton) && resize_mode && resy) {
     QPoint to_move;
-#ifndef FC_QT5_MODE
     int newheight = event->globalPosition().y() - cursor.y() - geometry().y();
-#else  // FC_QT5_MODE
-    int newheight = event->globalY() - cursor.y() - geometry().y();
-#endif // FC_QT5_MODE
 
     resize(width(), this->geometry().height()-newheight);
-    to_move = mevent_gpos(event) - cursor;
+    to_move = event->globalPosition().toPoint() - cursor;
     move(this->x(), to_move.y());
     setCursor(Qt::SizeVerCursor);
     restore_chat();
@@ -183,14 +179,10 @@ void info_tab::mouseMoveEvent(QMouseEvent *event)
     setCursor(Qt::SizeVerCursor);
   } else if (resxy && (event->buttons() & Qt::LeftButton)) {
     QPoint to_move;
-#ifndef FC_QT5_MODE
     int newheight = event->globalPosition().y() - cursor.y() - geometry().y();
-#else  // FC_QT5_MODE
-    int newheight = event->globalY() - cursor.y() - geometry().y();
-#endif // FC_QT5_MODE
 
     resize(ex, this->geometry().height()- newheight);
-    to_move = mevent_gpos(event) - cursor;
+    to_move = event->globalPosition().toPoint() - cursor;
     move(this->x(), to_move.y());
     setCursor(Qt::SizeBDiagCursor);
     restore_chat();
@@ -288,11 +280,7 @@ void messagewdg::item_selected(const QItemSelection &sl,
 /***********************************************************************//**
   Mouse entered messagewdg
 ***************************************************************************/
-#ifndef FC_QT5_MODE
 void messagewdg::enterEvent(QEnterEvent *event)
-#else  // FC_QT5_MODE
-void messagewdg::enterEvent(QEvent *event)
-#endif // FC_QT5_MODE
 {
   setCursor(Qt::ArrowCursor);
 }
diff --git a/client/gui-qt/messagewin.h b/client/gui-qt/messagewin.h
index 450e9e0840..baea49c0e2 100644
--- a/client/gui-qt/messagewin.h
+++ b/client/gui-qt/messagewin.h
@@ -52,11 +52,7 @@ private:
   QGridLayout *layout;
   QPixmap *pix;
 protected:
-#ifndef FC_QT5_MODE
   void enterEvent(QEnterEvent *event);
-#else  // FC_QT5_MODE
-  void enterEvent(QEvent *event);
-#endif // FC_QT5_MODE
   void leaveEvent(QEvent *event);
   void paint(QPainter *painter, QPaintEvent *event);
   void paintEvent(QPaintEvent *event);
diff --git a/client/gui-qt/pages.cpp b/client/gui-qt/pages.cpp
index d2fb8ffc9d..c2d3f2335d 100644
--- a/client/gui-qt/pages.cpp
+++ b/client/gui-qt/pages.cpp
@@ -159,17 +159,14 @@ void fc_client::create_main_page(void)
   rev_ver = fc_git_revision();
 
   if (rev_ver == nullptr) {
-    // TRANS: "version 3.1.0, Qt5 client"
-#ifdef FC_QT5_MODE
-    fc_snprintf(msgbuf, sizeof(msgbuf), _("%s%s, Qt5 client"),
-                word_version(), VERSION_STRING);
-#elif defined(FC_QT6X_MODE)
+    // TRANS: "version 3.4.0, Qt6 client"
+#if defined(FC_QT6X_MODE)
     fc_snprintf(msgbuf, sizeof(msgbuf), _("%s%s, Qt6x client"),
                 word_version(), VERSION_STRING);
-#else  // FC_QT5_MODE
+#else  // FC_QT6X_MODE
     fc_snprintf(msgbuf, sizeof(msgbuf), _("%s%s, Qt6 client"),
                 word_version(), VERSION_STRING);
-#endif // FC_QT5_MODE
+#endif // FC_QT6X_MODE
   } else {
     fc_snprintf(msgbuf, sizeof(msgbuf), "%s%s",
                 word_version(), VERSION_STRING);
@@ -183,13 +180,11 @@ void fc_client::create_main_page(void)
                      main_graphics.height() - fm.descent() - fm.height(),
                      msgbuf);
 
-#ifdef FC_QT5_MODE
-    strncpy(msgbuf, _("Qt5 client"), sizeof(msgbuf) - 1);
-#elif defined(FC_QT6X_MODE)
+#if defined(FC_QT6X_MODE)
     strncpy(msgbuf, _("Qt6x client"), sizeof(msgbuf) - 1);
-#else  // FC_QT5_MODE
+#else  // FC_QT6X_MODE
     strncpy(msgbuf, _("Qt6 client"), sizeof(msgbuf) - 1);
-#endif // FC_QT5_MODE
+#endif // FC_QT6X_MODE
   }
 
   painter.drawText(main_graphics.width() - fm.horizontalAdvance (msgbuf)
@@ -1405,11 +1400,7 @@ void fc_client::slot_selection_changed(const QItemSelection &selected,
           load_pix->setPixmap(*(new QPixmap));
         }
 
-#ifdef FC_QT5_MODE
-        QPixmap pm = load_pix->pixmap(Qt::ReturnByValue);
-#else  // FC_QT5_MODE
         QPixmap pm = load_pix->pixmap();
-#endif // FC_QT5_MODE
 
         load_pix->setFixedSize(pm.width(),
                                pm.height());
diff --git a/client/gui-qt/repodlgs.cpp b/client/gui-qt/repodlgs.cpp
index 8b65388609..c76af56ce9 100644
--- a/client/gui-qt/repodlgs.cpp
+++ b/client/gui-qt/repodlgs.cpp
@@ -236,11 +236,7 @@ void unittype_item::upgrade_units()
 /************************************************************************//**
   Mouse entered widget
 ****************************************************************************/
-#ifndef FC_QT5_MODE
 void unittype_item::enterEvent(QEnterEvent *event)
-#else  // FC_QT5_MODE
-void unittype_item::enterEvent(QEvent *event)
-#endif // FC_QT5_MODE
 {
   entered = true;
   update();
@@ -811,7 +807,7 @@ void research_diagram::mouseMoveEvent(QMouseEvent *event)
       tt_text = def_str + tt_text.toHtmlEscaped();
       tooltip_text = tt_text.trimmed();
       tooltip_rect = rttp->rect;
-      tooltip_pos = mevent_gpos(event);
+      tooltip_pos = event->globalPosition().toPoint();
       if (!QToolTip::isVisible() && !timer_active) {
         timer_active = true;
         QTimer::singleShot(500, this, SLOT(show_tooltip()));
diff --git a/client/gui-qt/repodlgs.h b/client/gui-qt/repodlgs.h
index e7ec15bcce..3d9fded97b 100644
--- a/client/gui-qt/repodlgs.h
+++ b/client/gui-qt/repodlgs.h
@@ -69,11 +69,7 @@ private slots:
   void upgrade_units();
 
 protected:
-#ifndef FC_QT5_MODE
   void enterEvent(QEnterEvent *event);
-#else  // FC_QT5_MODE
-  void enterEvent(QEvent *event);
-#endif // FC_QT5_MODE
   void leaveEvent(QEvent *event);
   void paintEvent(QPaintEvent *event);
   void wheelEvent(QWheelEvent *event);
diff --git a/client/gui-qt/sidebar.cpp b/client/gui-qt/sidebar.cpp
index cfcfcdce04..06da365e4b 100644
--- a/client/gui-qt/sidebar.cpp
+++ b/client/gui-qt/sidebar.cpp
@@ -224,11 +224,7 @@ void fc_sidewidget::paint(QPainter *painter, QPaintEvent *event)
 /***********************************************************************//**
   Mouse entered on widget area
 ***************************************************************************/
-#ifndef FC_QT5_MODE
 void fc_sidewidget::enterEvent(QEnterEvent *event)
-#else  // FC_QT5_MODE
-void fc_sidewidget::enterEvent(QEvent *event)
-#endif // FC_QT5_MODE
 {
   if (!hover) {
     hover = true;
diff --git a/client/gui-qt/sidebar.h b/client/gui-qt/sidebar.h
index b25eeefcb8..2587166466 100644
--- a/client/gui-qt/sidebar.h
+++ b/client/gui-qt/sidebar.h
@@ -78,11 +78,7 @@ public slots:
   void some_slot();
 protected:
   void contextMenuEvent(QContextMenuEvent *event);
-#ifndef FC_QT5_MODE
   void enterEvent(QEnterEvent *event);
-#else  // FC_QT5_MODE
-  void enterEvent(QEvent *event);
-#endif // FC_QT5_MODE
   void leaveEvent(QEvent *event);
   void mousePressEvent(QMouseEvent *event);
   void paintEvent(QPaintEvent *event);
diff --git a/client/gui-qt/sprite.cpp b/client/gui-qt/sprite.cpp
index 41a7cd2d67..9b57b8c23f 100644
--- a/client/gui-qt/sprite.cpp
+++ b/client/gui-qt/sprite.cpp
@@ -243,35 +243,6 @@ struct sprite *qtg_load_gfxnumber(int num)
       u8"\u24F4"
     };
 
-#ifdef FC_QT5_MODE
-    ns = QString((const char *)numsbuf[num]);
-  }
-
-  w = fm.horizontalAdvance(ns);
-  h = fm.height();
-  pm = new QPixmap(w, h);
-  pm->fill(Qt::transparent);
-
-  QPainter paint(pm);
-
-  paint.setFont(*qf);
-  paint.setBrush(Qt::transparent);
-  paint.setPen(QColor(Qt::black));
-  paint.drawText(QRect(0, 0, w, h), Qt::AlignLeft | Qt::AlignVCenter,
-                 QString((const char *)u8"\u26AB"));
-
-  if (num > 20) {
-    paint.setPen(QColor(Qt::yellow));
-    paint.drawText(QRect(-2, 0, w, h), Qt::AlignLeft | Qt::AlignVCenter,
-                   QString((const char *)u8"\u2B24"));
-    paint.drawText(QRect(4, -2, w, h), Qt::AlignLeft | Qt::AlignVCenter,
-                   QString((const char *)u8"\u2B24"));
-    paint.drawText(QRect(4, 2, w, h), Qt::AlignLeft | Qt::AlignVCenter,
-                   QString((const char *)u8"\u2B24"));
-    paint.drawText(QRect(8, 0, w, h), Qt::AlignLeft | Qt::AlignVCenter,
-                   QString((const char *)u8"\u2B24"));
-  }
-#else  // FC_QT5_MODE
     ns = QString(numsbuf[num]);
   }
 
@@ -299,7 +270,6 @@ struct sprite *qtg_load_gfxnumber(int num)
     paint.drawText(QRect(8, 0, w, h), Qt::AlignLeft | Qt::AlignVCenter,
                    QString(u8"\u2B24"));
   }
-#endif // FC_QT5_MODE
 
   paint.setPen(QColor((num > 20) ? Qt::black : Qt::yellow));
   paint.drawText(QRect(0, 0, w, h), Qt::AlignLeft | Qt::AlignVCenter, ns);
diff --git a/tools/fcmp/mpgui_qt.cpp b/tools/fcmp/mpgui_qt.cpp
index 62cfb35531..a8c29e2071 100644
--- a/tools/fcmp/mpgui_qt.cpp
+++ b/tools/fcmp/mpgui_qt.cpp
@@ -203,13 +203,11 @@ void mpgui::setup(QWidget *central, struct fcmp_params *params)
 
   rev_ver = fc_git_revision();
 
-#ifdef FC_QT5_MODE
-  mode = R__("built in Qt5 mode.");
-#elif defined(FC_QT6X_MODE)
+#if defined(FC_QT6X_MODE)
   mode = R__("built in Qt6x mode.");
-#else  // FC_QT5_MODE
+#else  // FC_QT6X_MODE
   mode = R__("built in Qt6 mode.");
-#endif // FC_QT5_MODE
+#endif // FC_QT6X_MODE
 
   if (rev_ver == nullptr) {
     fc_snprintf(verbuf, sizeof(verbuf), "%s%s\n%s", word_version(),
diff --git a/tools/ruledit/ruledit_qt.cpp b/tools/ruledit/ruledit_qt.cpp
index e8b53061c4..59d7d30bf9 100644
--- a/tools/ruledit/ruledit_qt.cpp
+++ b/tools/ruledit/ruledit_qt.cpp
@@ -123,13 +123,11 @@ void ruledit_gui::setup(QWidget *central_in)
 
   rev_ver = fc_git_revision();
 
-#ifdef FC_QT5_MODE
-  mode = R__("built in Qt5 mode.");
-#elif defined(FC_QT6X_MODE)
+#if defined(FC_QT6X_MODE)
   mode = R__("built in Qt6x mode.");
-#else  // FC_QT5_MODE
+#else  // FC_QT6X_MODE
   mode = R__("built in Qt6 mode.");
-#endif // FC_QT5_MODE
+#endif // FC_QT6X_MODE
 
   if (rev_ver == nullptr) {
     fc_snprintf(verbuf, sizeof(verbuf), "%s%s\n%s", word_version(),
-- 
2.45.2

