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

QPainter fillRect() transparency issue

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.7.1
    • GUI: Painting
    • None
    • Windows XP, using PyQt 4.8.1.

    Description

      Filling a paint device through QPainter.fillRect() with QColor(41,51,123,177) gives a completely different result compared to QColor(42,52,124,176). As shown in [color_issues.png] (which can be reproduced with [test_color.py]), the alpha/transparency settings are not honored when using fillRect(), but work when using QPixmap.fill(). Also, above/below certain threshold values, the color changes to pitch black.

      [1][2]
      [3][4]

      [1] QPainter.fillRect() with QColor(41,51,123,177)
      [2] QPainter.fillRect() with QColor(49,123,226,40)
      [3] QPixmap.fill() with QColor(41,51,123,177)
      [4] QPixmap.fill() with QColor(49,123,226,40)

      Attachments

        1. color_issues.png
          color_issues.png
          2 kB
        2. test_color.py
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rodal Samuel Rødal
            han Han Genuit
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes