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.

 

 posted on 2012-09-06 13:48  Jiang, X.  阅读(418)  评论(0编辑  收藏  举报