Qt QPainter

To paint on a device, usually a widget, we need to overload the function void QWidget::paintEvent(QPainteEvent *event){}

We also need to construct the object of QPainter in the function of paintEvent like this: QPainter painter(this);

Then we will be able to use QPainter whataver we like.

原文地址:https://www.cnblogs.com/johnpher/p/2673333.html