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

Stroking thick arcs with QPainterPath generates different results with different graphics systems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: P2: Important P2: Important
    • None
    • 4.6.2
    • GUI: Painting
    • None

      The code below generates very different results depending on the graphics system in use.
      See attached image for results on raster, native (X11) and opengl.

      The opengl result is the correct one.

      test.cpp
      #include <QtGui>
      
      class ArcTest : public QWidget
      {
          Q_OBJECT
      public:
          ArcTest()
          {
              setFixedSize(200, 200);
          }
      
          void paintEvent(QPaintEvent*)
          {
              QPainter p(this);
      
              p.fillRect(rect(), Qt::white);
      
              QPainterPath path;
      
              path.arcMoveTo(99, 99, 2, 2, 0);
              path.arcTo(99, 99, 2, 2, 0, 360);
      
              QPen pen(Qt::black);
              pen.setWidth(185);
      
              p.strokePath(path, pen);
          }
      };
      
      int main(int argc, char** argv)
      {
          QApplication app(argc, argv);
          ArcTest at;
          at.show();
          return app.exec();
      }
      
      #include "test.moc"
      

        1. thick-arc.png
          9 kB
          Andreas Kling (closed Nokia identity)
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            sletta Gunnar Sletta
            akling Andreas Kling (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes