From 625eae2cc53abf66043451632ccd55d2a3f00904 Mon Sep 17 00:00:00 2001 From: Geert Litjens Date: Wed, 7 Feb 2018 17:30:50 +0100 Subject: [PATCH] - Reverted some chances related to potential initial bug fix for DotAnnotations - Upgrade to version 1.7.4 - Slightly enlarged default selection area for dot annotations --- .../AnnotationWorkstationExtensionPlugin.cpp | 34 ++++++++----------- ASAP/annotation/DotQtAnnotation.cpp | 7 +--- ASAP/annotation/QtAnnotation.cpp | 1 + CMakeLists.txt | 2 +- 4 files changed, 18 insertions(+), 26 deletions(-) diff --git a/ASAP/annotation/AnnotationWorkstationExtensionPlugin.cpp b/ASAP/annotation/AnnotationWorkstationExtensionPlugin.cpp index 8b1b70e0..b20360d2 100644 --- a/ASAP/annotation/AnnotationWorkstationExtensionPlugin.cpp +++ b/ASAP/annotation/AnnotationWorkstationExtensionPlugin.cpp @@ -793,25 +793,21 @@ void AnnotationWorkstationExtensionPlugin::deleteAnnotation(QtAnnotation* annota QTreeWidgetItemIterator it(_treeWidget); while (*it) { if (annotation == (*it)->data(1, Qt::UserRole).value()) { - if (_annotationService) { - std::vector > annots = _annotationService->getList()->getAnnotations(); - int annotInd = std::find(annots.begin(), annots.end(), annotation->getAnnotation()) - annots.begin(); - _annotationService->getList()->removeAnnotation(annotInd); - } - - _annotToItem.remove(annotation); - _qtAnnotations.removeOne(annotation); - _selectedAnnotations.remove(annotation); - (*it)->setSelected(false); - delete (*it); - - // Interacts with the deleteLater, causing a race condition. - /*if (_viewer) { - _viewer->scene()->removeItem(annotation); - }*/ - annotation->deleteLater(); - - break; + if (_viewer) { + _viewer->scene()->removeItem(annotation); + } + if (_annotationService) { + std::vector > annots = _annotationService->getList()->getAnnotations(); + int annotInd = std::find(annots.begin(), annots.end(), annotation->getAnnotation()) - annots.begin(); + _annotationService->getList()->removeAnnotation(annotInd); + } + annotation->deleteLater(); + _annotToItem.remove(annotation); + _qtAnnotations.removeOne(annotation); + _selectedAnnotations.remove(annotation); + (*it)->setSelected(false); + delete (*it); + break; } ++it; } diff --git a/ASAP/annotation/DotQtAnnotation.cpp b/ASAP/annotation/DotQtAnnotation.cpp index 703d3898..be899b6a 100644 --- a/ASAP/annotation/DotQtAnnotation.cpp +++ b/ASAP/annotation/DotQtAnnotation.cpp @@ -36,12 +36,7 @@ QRectF DotQtAnnotation::boundingRect() const { QPainterPath DotQtAnnotation::shape() const { QPainterPath path; - if (isSelected()) { - path.addEllipse(QPointF(), 1.5 * _rectSize / _currentLOD, 1.5 * _rectSize / _currentLOD); - } - else { - path.addEllipse(QPointF(), _rectSize / _currentLOD, _rectSize / _currentLOD); - } + path.addEllipse(QPointF(), 1.5 * _rectSize / _currentLOD, 1.5 * _rectSize / _currentLOD); return path; } diff --git a/ASAP/annotation/QtAnnotation.cpp b/ASAP/annotation/QtAnnotation.cpp index f6bb5aa7..2848a927 100644 --- a/ASAP/annotation/QtAnnotation.cpp +++ b/ASAP/annotation/QtAnnotation.cpp @@ -24,6 +24,7 @@ _lastClickedSecondCoordinateIndex(-1) } QtAnnotation::~QtAnnotation() { + _annotation = NULL; } std::shared_ptr QtAnnotation::getAnnotation() const { diff --git a/CMakeLists.txt b/CMakeLists.txt index 4af2244a..18f06534 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ PROJECT(DIAGPathology) SET(CURRENT_MAJOR_VERSION 1) SET(CURRENT_MINOR_VERSION 7) -SET(CURRENT_PATCH_VERSION 3) +SET(CURRENT_PATCH_VERSION 4) set(ASAP_VERSION ${CURRENT_MAJOR_VERSION}.${CURRENT_MINOR_VERSION}.${CURRENT_PATCH_VERSION}) include (GenerateExportHeader)