为什么QPainter的操作不能写在Widget构造函数里面
如题,建一个QWidget应用,把如下代码
QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing,true); painter.setPen(QPen(Qt::black,6,Qt::SolidLine,Qt::RoundCap,Qt::MiterJoin)); painter.setBrush(QBrush(Qt::blue,Qt::DiagCrossPattern)); painter.drawPie(40,40,400,240,60*16,270*16);