| 86 | } |
| 87 | |
| 88 | void RectangleAnnotationTool::keyPressEvent(QKeyEvent *event) { |
| 89 | AnnotationTool::keyPressEvent(event); |
| 90 | if (event->key() == Qt::Key::Key_Delete) { |
| 91 | if (!_generating && _annotationPlugin->getActiveAnnotation()) { |
| 92 | if (_annotationPlugin->getActiveAnnotation()->getAnnotation()->getCoordinates().size() <= 2) { |
| 93 | _annotationPlugin->deleteAnnotation(_annotationPlugin->getActiveAnnotation()); |
| 94 | event->accept(); |
| 95 | } |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | void RectangleAnnotationTool::cancelAnnotation() { |
| 101 | if (_generating) { |
nothing calls this directly
no test coverage detected