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

anti-aliasing+hi-dpi Scaling -> The drawing area and the refresh area do not match

    XMLWordPrintable

Details

    • All, Linux/X11

    Description

      As shown in the attachment, when setting anti-aliasing under zooming, the drawing area and refresh area are not synchronized.

       

      class TestWindow : public QWidget
      {
      public:
          explicit TestWindow(QWidget *parent = 0)
              : QWidget(parent)
          {
      
          }
      
          void mousePressEvent(QMouseEvent *e)
          {
              if (e->button() == Qt::LeftButton) {
                  press_pos = e->pos();
              }
          }
      
          void mouseReleaseEvent(QMouseEvent *e)
          {
      
          }
      
          void mouseMoveEvent(QMouseEvent *e)
          {
              update(rect);
      
              rect.setLeft(qMin(press_pos.x(), e->pos().x()));
              rect.setTop(qMin(press_pos.y(), e->pos().y()));
              rect.setRight(qMax(press_pos.x(), e->pos().x()));
              rect.setBottom(qMax(press_pos.y(), e->pos().y()));
      
              update(rect);
          }
      
          void paintEvent(QPaintEvent *e)
          {
              QPainter pa(this);
              pa.setRenderHints(QPainter::Antialiasing);
              //pa.setRenderHints(QPainter::Antialiasing, false);
              pa.fillRect(rect, color);
          }
      
          QPoint press_pos;
          QRect rect;
          QColor color;
      };
      

       

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            tanghaixiang haixiang tang
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes