From d16255577c6eb184e4764b02f8634c22e66354ea Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 24 May 2025 13:14:00 +0300
Subject: [PATCH 73/73] Qt: Document FC_QT6X_MODE blocks

For each block, list which Qt version provides
the symbols used by the block. The goal is to make
it easy to know which blocks can be cleaned up when
the minimum Qt version requirement gets bumped for
the regular Qt6-client.

See RM #1439

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 client/gui-qt/chatline.cpp  | 3 +++
 client/gui-qt/citydlg.cpp   | 2 ++
 client/gui-qt/gotodlg.cpp   | 1 +
 client/gui-qt/optiondlg.cpp | 3 +++
 client/gui-qt/pages.cpp     | 1 +
 5 files changed, 10 insertions(+)

diff --git a/client/gui-qt/chatline.cpp b/client/gui-qt/chatline.cpp
index 95bf2b2d1c..85b770ec3c 100644
--- a/client/gui-qt/chatline.cpp
+++ b/client/gui-qt/chatline.cpp
@@ -301,6 +301,7 @@ chatwdg::chatwdg(QWidget *parent)
           this, &chatwdg::toggle_size);
   connect(remove_links, &QAbstractButton::clicked, this, &chatwdg::rm_links);
 #ifdef FC_QT6X_MODE
+  // Qt-6.7
   connect(cb, &QCheckBox::checkStateChanged, this, &chatwdg::state_changed);
 #else  // FC_QT6X_MODE
   connect(cb, &QCheckBox::stateChanged, this, &chatwdg::state_changed_depr);
@@ -623,6 +624,7 @@ QString apply_tags(QString str, const struct text_tag_list *tags,
             color = bg_color.name();
           } else {
 #ifdef FC_QT6X_MODE
+            // Qt-6.4
             qc = QColor::fromString(color);
 #else  // FC_QT6X_MODE
             qc.setNamedColor(color);
@@ -638,6 +640,7 @@ QString apply_tags(QString str, const struct text_tag_list *tags,
         color = text_tag_color_background(ptag);
         if (
 #ifdef FC_QT6X_MODE
+            // Qt-6.4
             QColor::isValidColorName(color)
 #else  // FC_QT6X_MODE
             QColor::isValidColor(color)
diff --git a/client/gui-qt/citydlg.cpp b/client/gui-qt/citydlg.cpp
index a2184d6257..425c65fd33 100644
--- a/client/gui-qt/citydlg.cpp
+++ b/client/gui-qt/citydlg.cpp
@@ -1939,6 +1939,7 @@ city_dialog::city_dialog(QWidget *parent): qfc_dialog(parent)
       cma_celeb_checkbox = new QCheckBox;
       slider_grid->addWidget(cma_celeb_checkbox, i + 1, 2 , 1 , 1);
 #ifdef FC_QT6X_MODE
+      // Qt-6.7
       connect(cma_celeb_checkbox,
               &QCheckBox::checkStateChanged, this, &city_dialog::cma_toggle_changed);
 #else  // FC_QT6X_MODE
@@ -1951,6 +1952,7 @@ city_dialog::city_dialog(QWidget *parent): qfc_dialog(parent)
       cma_max_growth = new QCheckBox;
       slider_grid->addWidget(cma_max_growth, i + 1, 2 , 1 , 1);
 #ifdef FC_QT6X_MODE
+      // Qt-6.7
       connect(cma_max_growth,
               &QCheckBox::checkStateChanged, this, &city_dialog::cma_toggle_changed);
 #else  // FC_QT6X_MODE
diff --git a/client/gui-qt/gotodlg.cpp b/client/gui-qt/gotodlg.cpp
index 6df0916db6..893c672334 100644
--- a/client/gui-qt/gotodlg.cpp
+++ b/client/gui-qt/gotodlg.cpp
@@ -122,6 +122,7 @@ goto_dialog::goto_dialog(QWidget *parent): qfc_dialog(parent)
   connect(goto_city, &QAbstractButton::clicked, this, &goto_dialog::go_to_city);
   connect(airlift_city, &QAbstractButton::clicked, this, &goto_dialog::airlift_to);
 #ifdef FC_QT6X_MODE
+  // Qt-6.7
   connect(show_all, &QCheckBox::checkStateChanged,
           this, &goto_dialog::checkbox_changed);
 #else  // FC_QT6X_MODE
diff --git a/client/gui-qt/optiondlg.cpp b/client/gui-qt/optiondlg.cpp
index bc5390ea2a..0536b32b32 100644
--- a/client/gui-qt/optiondlg.cpp
+++ b/client/gui-qt/optiondlg.cpp
@@ -480,6 +480,7 @@ void option_dialog::set_button_color(QPushButton *button,
     QColor col;
 
 #ifdef FC_QT6X_MODE
+    // Qt-6.4
     col = QColor::fromString(colorname);
 #else  // FC_QT6X_MODE
     col.setNamedColor(colorname);
@@ -725,6 +726,7 @@ void option_dialog::add_option(struct option *poption)
     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);
@@ -741,6 +743,7 @@ void option_dialog::add_option(struct option *poption)
     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);
diff --git a/client/gui-qt/pages.cpp b/client/gui-qt/pages.cpp
index c2d3f2335d..3e2c5af4ee 100644
--- a/client/gui-qt/pages.cpp
+++ b/client/gui-qt/pages.cpp
@@ -538,6 +538,7 @@ void fc_client::create_load_page()
           &QItemSelectionModel::selectionChanged, this,
           &fc_client::slot_selection_changed);
 #ifdef FC_QT6X_MODE
+  // Qt-6.7
   connect(show_preview, &QCheckBox::checkStateChanged, this,
           &fc_client::state_preview);
 #else  // FC_QT6X_MODE
-- 
2.47.2

