aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects/KvsObject_tableWidget.cpp
diff options
context:
space:
mode:
authorGravatar ctrlaltca2024-03-24 11:39:46 +0100
committerGravatar GitHub2024-03-24 11:39:46 +0100
commite68e34095057a9d7d7aedbaf8ad9773913aa4794 (patch)
treed4953cef4477a68cacf76259a129653f2f080da8 /src/modules/objects/KvsObject_tableWidget.cpp
parentFix Wayland appId (#2621) (diff)
downloadKVIrc-e68e34095057a9d7d7aedbaf8ad9773913aa4794.tar.gz
KVIrc-e68e34095057a9d7d7aedbaf8ad9773913aa4794.tar.bz2
KVIrc-e68e34095057a9d7d7aedbaf8ad9773913aa4794.zip
More qt6 porting (#2622)
* Port QColor::setNamedColor to QColor::fromString * Port from QVariant::Type to QmetaType::Type * KviCoreActions: port from QAction::parentWidget to qobject_cast + QAction::parent * KviIrcView: port QString::fromUtf16 usage to the non-obsolete char16_t* overload * KviTopicWidget: port QMouseEvent to a non-obsolete overload * Port QMouseEvent from old pos(), x(), y(), to position() * Port obsolete QMessageBox usage to custom buttons * KviApplication: initialize the dbus notify message "replace ID" to 0 * KviIrcConnection: port deprecated QString::count() to QString::size() * KvsObject_*: port QColor::setNamedColor to QColor::fromString * KvsObject_widget: port QWidget::isTopLevel to QWidget::isWindow * KviMainWindow: use QKeyCombination instead of int for shortcuts * QHttp: avoid deprecated methods for QCryptographicHash * ScriptEditorWidget: use the new signature for QMenu::addAction() * KviInputEditor: Extract ACCEL_KEY from header and avoid warning * KviStringConversion: convert old Qt5 font weights to new "css" font weights * syntax fix
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"));