summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qguivariant.cpp4
-rw-r--r--src/gui/text/qcssparser.cpp2
-rw-r--r--src/gui/text/qtexthtmlparser.cpp10
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp3
4 files changed, 9 insertions, 10 deletions
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index 180be177b95..b86514c666c 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -122,7 +122,7 @@ static const struct : QMetaTypeModuleHelper
return true;
);
QMETATYPE_CONVERTER(QColor, QByteArray,
- result.setNamedColor(QLatin1String(source));
+ result = QColor::fromString(QLatin1String(source));
return result.isValid();
);
QMETATYPE_CONVERTER(QString, QColor,
@@ -131,7 +131,7 @@ static const struct : QMetaTypeModuleHelper
return true;
);
QMETATYPE_CONVERTER(QColor, QString,
- result.setNamedColor(source);
+ result = QColor::fromString(source);
return result.isValid();
);
#if QT_CONFIG(shortcut)
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index e3c7fe242d2..29bed8a0c65 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -2875,7 +2875,7 @@ bool Parser::parseFunction(QString *name, QString *args)
bool Parser::parseHexColor(QColor *col)
{
- col->setNamedColor(lexem());
+ *col = QColor::fromString(lexem());
if (!col->isValid()) {
qWarning("QCssParser::parseHexColor: Unknown color name '%s'",lexem().toLatin1().constData());
return false;
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index bb15feabfa4..34c33132ac1 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;
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index e2db3d3be78..a93c6fe6293 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -1400,9 +1400,8 @@ void QColorShower::hsvEd()
void QColorShower::htmlEd()
{
- QColor c;
QString t = htEd->text();
- c.setNamedColor(t);
+ QColor c = QColor::fromString(t);
if (!c.isValid())
return;
curCol = qRgba(c.red(), c.green(), c.blue(), currentAlpha());