Details
-
Bug
-
Resolution: Done
-
P4: Low
-
4.6.1
-
None
-
X11
-
72da039e54a62bf3a481fefc753e0e50ba75df57
Description
The documentation of QColor::setNamedColor() says "The color is invalid if name cannot be parsed." And indeed isValid() can be used to check whether the setNamedColor() call succeeded. But even though the error handling is well defined the X11-specific code still emits the following warning:
qWarning("QColor::setNamedColor: Unknown color name '%s'", name.toLatin1().constData());
That gives false alarms in cases the programmer expects wrong or unknown color names and is already handling them via isValid(). Currently there is no way to silence the warning. There is none on invalid #RRGGBB names either btw. So I suggest to simply remove this qWarning() call. It's a well defined case and it's not like the input data is so bad that the application is going to crash.