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

Add QColor::isOpaque() method

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • Some future release
    • 5.11.0 RC 1
    • GUI: Painting
    • None

      From QBrush::isOpaque():

      ... The alpha component of the color() is 255 ...

      This is wrong. When I use setAlphaF(0.999) then alpha() will be == 255, but the color is not opaque, because QColor (currently) stores in 16 bit precision.

      I could use alphaF() but that would require a conversion from qreal to int (implying a floating point division), which is slower then the integer access method.

      A function QColor::isOpaque() which would just compare the alpha member to 65535 would be nice.

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

            Unassigned Unassigned
            cfeck Christoph Feck
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes