コード例 #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();
 }