aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects/KvsObject_tableWidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/objects/KvsObject_tableWidget.cpp')
-rw-r--r--src/modules/objects/KvsObject_tableWidget.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/modules/objects/KvsObject_tableWidget.cpp b/src/modules/objects/KvsObject_tableWidget.cpp
index f1e15edc5..a462db55b 100644
--- a/src/modules/objects/KvsObject_tableWidget.cpp
+++ b/src/modules/objects/KvsObject_tableWidget.cpp
@@ -336,11 +336,19 @@ KVSO_CLASS_FUNCTION(tableWidget, setForeground)
QString szColor;
pColArray->asString(szColor);
// maybe a color name?
+#if (QT_VERSION < QT_VERSION_CHECK(6, 4, 0))
color.setNamedColor(szColor);
+#else
+ color = QColor::fromString(szColor);
+#endif
if(!color.isValid())
{
// isn't a color name: lets try with an hex triplet
+#if (QT_VERSION < QT_VERSION_CHECK(6, 4, 0))
color.setNamedColor("#" + szColor);
+#else
+ color = QColor::fromString("#" + szColor);
+#endif
if(!color.isValid())
{
c->warning(__tr2qs_ctx("Not a valid color!", "objects"));