@Override protected void mouseReleaseEvent(QMouseEvent event) { if (event.button() == Qt.MouseButton.LeftButton && scribbling) { drawLineTo(event.pos()); scribbling = false; } }
@Override protected void mousePressEvent(QMouseEvent event) { if (event.button() == Qt.MouseButton.LeftButton) { lastPoint = event.pos(); scribbling = true; } }
// ! [6] protected void mousePressEvent(QMouseEvent event) { if (event.button().equals(Qt.MouseButton.LeftButton)) dragStartPosition = event.pos(); }