From 4070d968c1451a22d8cf302806d6b6d21940630c Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Wed, 28 May 2025 00:03:41 +0300
Subject: [PATCH 83/83] Qt: Unconditionally assume at least Qt-6.4

It's the minimum requirement, so it's safe to drop
compatibility code for older versions.

See RM #1440

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 client/gui-qt/chatline.cpp  | 14 +-------------
 client/gui-qt/optiondlg.cpp | 20 ++------------------
 2 files changed, 3 insertions(+), 31 deletions(-)

diff --git a/client/gui-qt/chatline.cpp b/client/gui-qt/chatline.cpp
index 85b770ec3c..f2e2bbe6b0 100644
--- a/client/gui-qt/chatline.cpp
+++ b/client/gui-qt/chatline.cpp
@@ -623,12 +623,7 @@ QString apply_tags(QString str, const struct text_tag_list *tags,
           if (color == "#00008B") {
             color = bg_color.name();
           } else {
-#ifdef FC_QT6X_MODE
-            // Qt-6.4
             qc = QColor::fromString(color);
-#else  // FC_QT6X_MODE
-            qc.setNamedColor(color);
-#endif // FC_QT6X_MODE
             qc = qc.lighter(200);
             color = qc.name();
           }
@@ -638,14 +633,7 @@ QString apply_tags(QString str, const struct text_tag_list *tags,
       }
       if (text_tag_color_background(ptag)) {
         color = text_tag_color_background(ptag);
-        if (
-#ifdef FC_QT6X_MODE
-            // Qt-6.4
-            QColor::isValidColorName(color)
-#else  // FC_QT6X_MODE
-            QColor::isValidColor(color)
-#endif // FC_QT6X_MODE
-            ) {
+        if (QColor::isValidColorName(color)) {
           str_col = QString("<span style= background-color:%1;>").arg(color);
           mm.insert(stop, "</span>");
           mm.insert(start, str_col);
diff --git a/client/gui-qt/optiondlg.cpp b/client/gui-qt/optiondlg.cpp
index 0536b32b32..8a6eaacf13 100644
--- a/client/gui-qt/optiondlg.cpp
+++ b/client/gui-qt/optiondlg.cpp
@@ -477,14 +477,8 @@ void option_dialog::set_button_color(QPushButton *button,
   if (button != nullptr && colorname != nullptr && colorname[0] != '\0') {
     QString s1 = "QPushButton { background-color: ";
     QString s2 = ";}";
-    QColor col;
-
-#ifdef FC_QT6X_MODE
-    // Qt-6.4
-    col = QColor::fromString(colorname);
-#else  // FC_QT6X_MODE
-    col.setNamedColor(colorname);
-#endif // FC_QT6X_MODE
+    QColor col = QColor::fromString(colorname);
+
     button->setStyleSheet(s1 + col.name() + s2);
   }
 }
@@ -725,12 +719,7 @@ void option_dialog::add_option(struct option *poption)
     button->setObjectName("text_color");
     button->setAutoFillBackground(true);
     button->setAutoDefault(false);
-#ifdef FC_QT6X_MODE
-    // Qt-6.4
     c = QColor::fromString(ft_color.foreground);
-#else  // FC_QT6X_MODE
-    c.setNamedColor(ft_color.foreground);
-#endif // FC_QT6X_MODE
     pal = button->palette();
     pal.setColor(QPalette::Button, c);
     button->setPalette(pal);
@@ -742,12 +731,7 @@ void option_dialog::add_option(struct option *poption)
     button->setObjectName("text_background");
     button->setAutoFillBackground(true);
     button->setAutoDefault(false);
-#ifdef FC_QT6X_MODE
-    // Qt-6.4
     c = QColor::fromString(ft_color.background);
-#else  // FC_QT6X_MODE
-    c.setNamedColor(ft_color.background);
-#endif // FC_QT6X_MODE
     pal = button->palette();
     pal.setColor(QPalette::Button, c);
     button->setPalette(pal);
-- 
2.47.2

