// 设置画笔的宽度就可以了QPen pen;pen.setWidth(5);painter.setPen(pen);
pen.setWidth(5); painter.setPen(pen); for(int i = 0;i<lines.size();i++){ myLine* pLine = lines[i]; painter.drawLine(pLine->startPnt,pLine->endPnt); } } void MyPainterWidget::mousePressEvent(QMouseEvent *e){ setCursor(Qt::PointingHandCursor); startPnt = e->pos(); endPnt ...
Try repaint() or update().Good Luck.
pen.setWidth(5); painter.setPen(pen); for(int i = 0;i<lines.size();i++){ myLine* pLine = lines[i]; painter.drawLine(pLine->startPnt,pLine->endPnt); } } void MyPainterWidget::mousePressEvent(QMouseEvent *e){ setCursor(Qt::PointingHandCursor); startPnt = e->pos(); endPnt ...