If you hold down the LMB and hold the mouse, you get a line, as it should be. This is the project itself: https://vk.com/doc66577607_445871169
This is the code snippet with the drawing itself:
void paintScene::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton) { addEllipse(event->scenePos().x() - brushSize, event->scenePos().y() - brushSize, (brushSize*2), (brushSize*2), pen, brush); previousPoint = event->scenePos(); } } void paintScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { if (event->buttons() == Qt::LeftButton) { addLine(previousPoint.x(), previousPoint.y(), event->scenePos().x(), event->scenePos().y(), QPen(color,brushSize*2,Qt::SolidLine,Qt::RoundCap)); previousPoint = event->scenePos(); } } UPD: figured out. In changeColor, I did not set the brush and pen colors. Thank.
