diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-05-06 13:23:43 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-05-06 13:33:12 (GMT) |
commit | a423ff5474b89028eeca95b254f5184311c8223b (patch) | |
tree | 604540e9ca4b26fae91c1b8a121e9a92677bee0f | |
parent | 891b6ac7236d21b69bdb54b00051422cee004059 (diff) | |
download | Qt-a423ff5474b89028eeca95b254f5184311c8223b.zip Qt-a423ff5474b89028eeca95b254f5184311c8223b.tar.gz Qt-a423ff5474b89028eeca95b254f5184311c8223b.tar.bz2 |
Remove warning from QColor::setNamedColor().
This warning is pointless as the user can anyway check if the color is
valid after making the call by calling isValid(). Using isValidColor()
could be used but it has a big performance overhead as validation then
needs to be done twice.
Task-number: QTBUG-19098
Reviewed-by: Erik Verbruggen
-rw-r--r-- | src/gui/painting/qcolor.cpp | 3 | ||||
-rw-r--r-- | tests/auto/qcolor/tst_qcolor.cpp | 2 |
2 files changed, 1 insertions, 4 deletions
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index ff6c24e..cd87d21 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -532,8 +532,7 @@ QString QColor::name() const void QColor::setNamedColor(const QString &name) { - if (!setColorFromString(name)) - qWarning("QColor::setNamedColor: Unknown color name '%s'", name.toLatin1().constData()); + setColorFromString(name); } /*! diff --git a/tests/auto/qcolor/tst_qcolor.cpp b/tests/auto/qcolor/tst_qcolor.cpp index d42c26c..b02537e 100644 --- a/tests/auto/qcolor/tst_qcolor.cpp +++ b/tests/auto/qcolor/tst_qcolor.cpp @@ -1506,7 +1506,6 @@ void tst_QColor::setallowX11ColorNames() for (int i = 0; i < x11RgbTblSize; ++i) { QString colorName = QLatin1String(x11RgbTbl[i].name); QColor color; - QTest::ignoreMessage(QtWarningMsg, QString("QColor::setNamedColor: Unknown color name '%1'").arg(colorName).toLatin1()); color.setNamedColor(colorName); QVERIFY(!color.isValid()); } @@ -1528,7 +1527,6 @@ void tst_QColor::setallowX11ColorNames() for (int i = 0; i < x11RgbTblSize; ++i) { QString colorName = QLatin1String(x11RgbTbl[i].name); QColor color; - QTest::ignoreMessage(QtWarningMsg, QString("QColor::setNamedColor: Unknown color name '%1'").arg(colorName).toLatin1()); color.setNamedColor(colorName); QVERIFY(!color.isValid()); } |