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

QOpenGLPaintEngine not support QPainter::Antialiasing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.15.1
    • GUI: OpenGL
    • None
    • Linux/X11
    • All

    Description

      Example:

      // The left widget is base with QOpenGLWidget, The right widget is base with QWidget
      #include <QApplication>
      #include <QHBoxLayout>
      #include <QOpenGLWidget>
      #include <QPainter>
      #include <QPainterPath>
      
      static void paint(QWidget *w)
      {
          QPainter pa(w);
          QPainterPath path;
      
          pa.fillRect(w->rect(), Qt::black);
          path.addEllipse(QRect(50, 50, 100, 100));
          pa.setRenderHint(QPainter::Antialiasing);
          pa.setClipPath(path);
          pa.fillRect(w->rect(), Qt::red);
      }
      
      class GLWidget : public QOpenGLWidget
      {
      public:
          void paintEvent(QPaintEvent *e) override
          {
              paint(this);
          }
      };
      
      class Widget : public QWidget
      {
      public:
          void paintEvent(QPaintEvent *e) override
          {
              paint(this);
          }
      };
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QWidget main;
          QHBoxLayout layout(&main);
      
          GLWidget glw;
          Widget w;
      
          layout.addWidget(&glw);
          layout.addWidget(&w);
      
          main.resize(500, 500);
          main.show();
      
          return a.exec();
      }
      

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            zccrs JiDe Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes