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