PDA

View Full Version : painter not active



athulms
16th August 2011, 15:04
i used the code add when i run the program it shows painter is not active
what is the solution for this error.




void mainwindow::paintEvent(QPaintEvent *e)
{

QPainter painter(this);
QPen linepen(Qt::red);
linepen.setCapStyle(Qt::RoundCap);
linepen.setWidth(30);
painter.setRenderHint(QPainter::Antialiasing,true) ;
painter.setPen(linepen);
painter.drawPoint(100,100);

}


waiting response

high_flyer
17th August 2011, 17:02
when i run the program it shows painter is not active
how do you see that the painter is not active? what do you meant "it shows painter is not active"?