-
Type:
Bug
-
Status: Reported
-
Priority:
P2: Important
-
Resolution: Unresolved
-
Affects Version/s: 5.15.0
-
Fix Version/s: None
-
Component/s: GUI: High-DPI, GUI: Painting
-
Platform/s:
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; };