From 850a089cf7df44b5a82d8ced0e4fd3e2db369e28 Mon Sep 17 00:00:00 2001
From: Stephen Kelly <stephen.kelly@kdab.com>
Date: Tue, 9 Oct 2012 18:20:22 +0200
Subject: [PATCH] Fix the use of Qt::GlobalColor with QVariant.

Before the patch, the code is setting an integer value, not a color.

Change-Id: I387759ac74149d5dea27ae59491682d63f37f843
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
---
 .../src/components/signalsloteditor/connectdialog.cpp         | 4 ++--
 .../components/signalsloteditor/signalsloteditorwindow.cpp    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/designer/src/components/signalsloteditor/connectdialog.cpp b/src/designer/src/components/signalsloteditor/connectdialog.cpp
index 648d59c3a..2785b706c 100644
--- a/src/designer/src/components/signalsloteditor/connectdialog.cpp
+++ b/src/designer/src/components/signalsloteditor/connectdialog.cpp
@@ -248,7 +248,7 @@ void ConnectDialog::populateSlotList(const QString &signal)
         // but may be used again in the future.
         if (deprecatedSlot) {
             item->setData(Qt::FontRole, variantFont);
-            item->setData(Qt::ForegroundRole, Qt::red);
+            item->setData(Qt::ForegroundRole, QColor(Qt::red));
         }
         ++itMember;
     }
@@ -291,7 +291,7 @@ void ConnectDialog::populateSignalList()
         // but may be used again in the future.
         if (deprecatedSignal) {
             item->setData(Qt::FontRole, variantFont);
-            item->setData(Qt::ForegroundRole, Qt::red);
+            item->setData(Qt::ForegroundRole, QColor(Qt::red));
         }
         ++itMember;
     }
diff --git a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
index f685c4ecb..f1d3bae96 100644
--- a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
+++ b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
@@ -275,7 +275,7 @@ QVariant ConnectionModel::data(const QModelIndex &index, int role) const
     // Mark deprecated slots red/italic. Not currently in use (historically for Qt 3 slots in Qt 4),
     // but may be used again in the future.
     if (deprecatedMember && role == Qt::ForegroundRole)
-        return Qt::red;
+        return QColor(Qt::red);
     if (deprecatedMember && role ==  Qt::FontRole) {
         QFont font = QApplication::font();
         font.setItalic(true);
@@ -475,7 +475,7 @@ void InlineEditorModel::addTextList(const QMap<QString, bool> &text_list)
         setData(text_idx, it.key(), Qt::DisplayRole);
         if (it.value()) {
             setData(text_idx, fontVariant, Qt::FontRole);
-            setData(text_idx, Qt::red, Qt::ForegroundRole);
+            setData(text_idx, QColor(Qt::red), Qt::ForegroundRole);
         }
         ++it;
     }
-- 
GitLab