Thank You. That's true. In fact api doc doesn't say it in explicit way. I was always using QPainter in this way:
So now I realized that it MUST be used in such way.Mostly, all this is done inside a paint event. (In fact, 99% of all QPainter use is in a reimplementation of QWidget::paintEvent(), and the painter is heavily optimized for such use.) Here's one very simple example:
Qt Code:
void SimpleExampleWidget::paintEvent() { paint.setPen( Qt::blue ); paint.drawText( rect(), AlignCenter, "The Text" ); }To copy to clipboard, switch view to plain text mode




Reply With Quote
Bookmarks