diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2022-03-15 13:02:41 +0100 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2022-03-17 17:14:38 +0100 |
commit | 4b8c20a29715a83aeabc5bc325e0e05e33c859f7 (patch) | |
tree | 74710b6a835edf618b605ac8207e7c318aff5b13 /src/gui/text/qtexthtmlparser.cpp | |
parent | fb0c7a9956824fbc3e3a3ab70cf7e2e5a622e85d (diff) |
Fix deprecated use of QColor::setNamedColor
'Use fromString() instead.'
Change-Id: I4efef147a8b0486f2664fd7fe6c35a9c82479b90
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/gui/text/qtexthtmlparser.cpp')
-rw-r--r-- | src/gui/text/qtexthtmlparser.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index bb15feabfa..34c33132ac 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -1641,7 +1641,7 @@ void QTextHtmlParser::applyAttributes(const QStringList &attributes) node->charFormat.setFontFamilies(QStringList(value)); } } else if (key == QLatin1String("color")) { - QColor c; c.setNamedColor(value); + QColor c = QColor::fromString(value); if (!c.isValid()) qWarning("QTextHtmlParser::applyAttributes: Unknown color name '%s'",value.toLatin1().constData()); node->charFormat.setForeground(c); @@ -1698,7 +1698,7 @@ void QTextHtmlParser::applyAttributes(const QStringList &attributes) case Html_tr: case Html_body: if (key == QLatin1String("bgcolor")) { - QColor c; c.setNamedColor(value); + QColor c = QColor::fromString(value); if (!c.isValid()) qWarning("QTextHtmlParser::applyAttributes: Unknown color name '%s'",value.toLatin1().constData()); node->charFormat.setBackground(c); @@ -1711,7 +1711,7 @@ void QTextHtmlParser::applyAttributes(const QStringList &attributes) if (key == QLatin1String("width")) { setWidthAttribute(&node->width, value); } else if (key == QLatin1String("bgcolor")) { - QColor c; c.setNamedColor(value); + QColor c = QColor::fromString(value); if (!c.isValid()) qWarning("QTextHtmlParser::applyAttributes: Unknown color name '%s'",value.toLatin1().constData()); node->charFormat.setBackground(c); @@ -1729,12 +1729,12 @@ void QTextHtmlParser::applyAttributes(const QStringList &attributes) if (key == QLatin1String("border")) { setFloatAttribute(&node->tableBorder, value); } else if (key == QLatin1String("bgcolor")) { - QColor c; c.setNamedColor(value); + QColor c = QColor::fromString(value); if (!c.isValid()) qWarning("QTextHtmlParser::applyAttributes: Unknown color name '%s'",value.toLatin1().constData()); node->charFormat.setBackground(c); } else if (key == QLatin1String("bordercolor")) { - QColor c; c.setNamedColor(value); + QColor c = QColor::fromString(value); if (!c.isValid()) qWarning("QTextHtmlParser::applyAttributes: Unknown color name '%s'",value.toLatin1().constData()); node->borderBrush = c; |