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

[Linux] Wrong paintings of QPainterPath with CompositionMode_Clear

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.4.3
    • GUI: Painting
    • None

    Description

      In the code below, if one changes composition mode or makes rect non-transparent, everything works fine.

      Code to reproduce:
      //------------------------------------------
      #include <QtGui>
      #include <math.h>

      class Test : public QWidget
      {
      public:
      Test() : QWidget() {}
      ~Test() {}

      protected:
      virtual void paintEvent( QPaintEvent * )

      { QPainter pnt( this ); // fill the background of window pnt.fillRect( 0, 0, width(), height(), QBrush( Qt::white ) ); int twidth = 10; int ax = 2*twidth, ay = 2*twidth; QPainterPath tpath; double width = 400+2*twidth; // build the rounded rect with the width '2*twidth' tpath.addRoundedRect( ax-twidth, ay-twidth, width, 2*twidth, twidth, twidth ); // rotate it on PI/4 around on of the ends tpath = QTransform().translate( ax, ay ).rotateRadians( M_PI / 4 ) .translate( -ax, -ay ).map( tpath ); // draw pnt.setBrush( QBrush( Qt::transparent ) ); pnt.setCompositionMode( QPainter::CompositionMode_Clear ); pnt.drawPath( tpath ); }

      };

      int main( int argc, char * argv[] )
      {
      QApplication app( argc, argv );
      Test t;
      t.show();
      return app.exec();
      }
      //------------------------------------------

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes