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

QOpenGLPaintDevice doesn't work with QPen that has alpha other than 255

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 5.2.0
    • GUI: OpenGL
    • None

    Description

      If I draw something that uses a QPen to a QPainter created with QOpenGLPaintDevice then I get incorrect results if the alpha component of the pen's color is other than 255.

      Here's an example:

      QOpenGLPaintDevice device(size);
      QPainter painter(&device);

      painter.setPen(QPen(QColor(255, 0, 0, 255), 5));
      painter.setBrush(Qt::NoBrush);
      painter.drawEllipse(QRect(size.width() / 2 - 100, size.height() / 2 - 100, 200, 200));

      With that code, I get the following results (this is on top of a map that is already rendered using other methods)...
      http://m2.i.pbase.com/o9/09/605909/1/154046342.nGGAoY9D.Screenshot_01.png

      If I change the alpha value of the pen color to 128 then here's what I get...
      http://m4.i.pbase.com/o9/09/605909/1/154046344.QoJtHhK0.Screenshot_02.png

      Attachments

        Issue Links

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

          Activity

            People

              lagocs Laszlo Agocs
              esperantisto Ivan Trombley
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes