Qt - draw inside QScrollArea in a QDialog
问题 In Qt 5, I have a QDialog window on which I have drawn a circle as follows: void MyDialog::paintEvent(QPaintEvent *pe) { QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing,true); QPen pen(Qt::blue,2); painter.setPen(pen); QRect r=QRect(0,0,100,100); painter.drawEllipse(r); } If I draw a larger circle, for example by using QRect(0,0,500,500); , the circle being greater than the dialog window is clipped. So I dragged a QScrollArea onto the the dialog window and decide to draw