| 21 | } |
| 22 | |
| 23 | void AnnotationTool::mouseMoveEvent(QMouseEvent *event) { |
| 24 | if (_viewer) { |
| 25 | if (_generating) { |
| 26 | QPointF scenePos = _viewer->mapToScene(event->pos()); |
| 27 | if (event->buttons() == Qt::LeftButton) { |
| 28 | if (QLineF(_viewer->mapFromScene(scenePos), _viewer->mapFromScene(QPointF(_last.getX(), _last.getY()))).length() > 40) { |
| 29 | addCoordinate(scenePos); |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 | else if (_startSelectionMove && event->modifiers() == Qt::AltModifier) { |
| 34 | QPointF scenePos = _viewer->mapToScene(event->pos()); |
| 35 | QSet<QtAnnotation*> selected = _annotationPlugin->getSelectedAnnotations(); |
| 36 | for (QSet<QtAnnotation*>::iterator it = selected.begin(); it != selected.end(); ++it) { |
| 37 | QPointF delta = (scenePos - _moveStart); |
| 38 | (*it)->moveCoordinatesBy(Point(delta.x(), delta.y())); |
| 39 | } |
| 40 | _moveStart = scenePos; |
| 41 | } |
| 42 | else if (_startSelectionMove) { |
| 43 | QPointF scenePos = _viewer->mapToScene(event->pos()); |
| 44 | QtAnnotation* active = _annotationPlugin->getActiveAnnotation(); |
| 45 | if (active && active->getEditable()) { |
| 46 | int activeSeedPoint = active->getActiveSeedPoint(); |
| 47 | if (activeSeedPoint >= 0) { |
| 48 | QPointF delta = (scenePos - _moveStart); |
| 49 | active->moveCoordinateBy(activeSeedPoint, Point(delta.x(), delta.y())); |
| 50 | _moveStart = scenePos; |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | event->accept(); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | void AnnotationTool::mouseDoubleClickEvent(QMouseEvent *event) { |
| 59 | } |
nothing calls this directly
no test coverage detected