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