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

There is a border when painting two adjacent QPolygonF

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P3: Somewhat important
    • None
    • 4.5.1
    • GUI: Painting
    • None

    Description

      t4id: 254216

      When two adjacents QPolygonF are painted, there is a space between them. This only happen with the Raster engine.

      Here is the code to reproduce the problem:

      #include <QtGui>
      
      class Widget : public QWidget {
      public:
          Widget() {
              resize(750, 500);
          }
          void paintEvent(QPaintEvent* e) {
      
              QWidget::paintEvent(e);
              QPixmap pix(750, 500);
              QPainter painter(&pix);
      
              painter.setPen(Qt::NoPen);
      
              painter.setBrush(Qt::white);
              painter.drawRect(0, 0, 750, 500);
      
              QPolygonF array;
              painter.setBrush(Qt::black);
              float height = 5.049f;
              for(float x = 0; x < 750; x += 11) {
                  for(float y = 0; y < 500; y += height) {
                      array.clear();
                      array << QPointF(x, y);
                      array << QPointF(x + 10, y);
                      array << QPointF(x + 10, y + height);
                      array << QPointF(x, y + height);
                      painter.drawPolygon(array);
                  }
                  height += 0.0013f;
              }
      
              painter.end();
      
              QPainter painter2(this);
              painter2.drawPixmap(0, 0, pix);
      
          }
      
      };
      
      int main( int argc, char ** argv )
      {
          QApplication a( argc, argv );
      
          Widget win;;
          win.show();
      
          return a.exec();
      }
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            jasmcdon Jason McDonald (Closed Nokia Identity. Please assign to "macadder" instead) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes