Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-8656

Unavoidable warning in QColor::setNamedColor()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 4.7.0
    • 4.6.1
    • GUI: Painting
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            erikv Erik Verbruggen
            porten Harri Porten (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes