summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2010-03-03 12:29:29 (GMT)
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2010-03-03 12:54:52 (GMT)
commitaf430b618a196a45e45c87afca446d60b4a3552d (patch)
tree0afb0d935c4b635f6ac5536301edbea319f2f073
parent66586707ae875bd1caa802fd7ca88a29727396e5 (diff)
downloadQt-af430b618a196a45e45c87afca446d60b4a3552d.zip
Qt-af430b618a196a45e45c87afca446d60b4a3552d.tar.gz
Qt-af430b618a196a45e45c87afca446d60b4a3552d.tar.bz2
Don't print a warning when passing an empty string to QColor
Qt 4.6 didn't used to warn about this, and it should be a valid way of setting a color to invalid. QColor::isValidColor has been adapted to still return false when passed an empty string. Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
-rw-r--r--src/gui/painting/qcolor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 0b735a2..cd448a7 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -548,14 +548,14 @@ void QColor::setNamedColor(const QString &name)
*/
bool QColor::isValidColor(const QString &name)
{
- return QColor().setColorFromString(name);
+ return !name.isEmpty() && QColor().setColorFromString(name);
}
bool QColor::setColorFromString(const QString &name)
{
if (name.isEmpty()) {
invalidate();
- return false;
+ return true;
}
if (name.startsWith(QLatin1Char('#'))) {