scribblearea.cpp
void ScribbleArea::mousePressEvent(QMouseEvent *event)
{
    if (event->button() == Qt::LeftButton) {
        lastPoint = event->pos();
        isDrawing = true;
    }
}
// If a mouse button is pressed check if it was the
// left button and if so store the current position
// Set that we are currently drawing
If a mouse button is pressed check if it was the
left button and if so store the current position
Set that we are currently drawing
If a mouse button is pressed check if it was the left button and if so store the current position Set that we are currently drawing
void ScribbleArea::mousePressEvent(QMouseEvent *event)
{
    if (event->button() == Qt::LeftButton) {
        lastPoint = event->pos();
        isDrawing = true;
    }
}
void ScribbleArea :: mousePressEvent ( QMouseEvent * event ) { if ( event -> button ( ) == Qt :: LeftButton ) { lastPoint = event -> pos ( ) ; isDrawing = true ; } }
If a mouse button is pressed check if it was the
left button and if so store the current position
Set that we are currently drawing
If a mouse button is pressed check if it was the left button and if so store the current position Set that we are currently drawing