I have a problem with drawing lines. It works well when the mouse moves slowly, but when the mouse is moved faster, there are some gaps and I don't have any idea why. This is the code:
if(QEvent::MouseButtonPress&&event->buttons()==Qt::LeftButton){
QPointF pt=mapToScene(event->pos());
band->setGeometry(0,0,0,0);
band->hide();
band->update();
this->scene()->addLine(pt.x(),pt.y(),pt.x(),pt.y(),QPen(color, size));
qDebug()<<event->pos();
}
Here is a screenshot:
Left is drawed slower, right faster.