From d84fd78a38e3e0b808cf68338d4360d61b4f5542 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 21 Feb 2017 16:16:02 +0200 Subject: [PATCH] Fixed bug. Operation tools did not obey tool selection type. --HG-- branch : develop --- .../drawTools/operation/vabstractoperation.cpp | 17 +++++++++++++++++ .../drawTools/operation/vabstractoperation.h | 1 + 2 files changed, 18 insertions(+) diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp index cb6ed67f8..493f24ead 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp @@ -340,6 +340,23 @@ void VAbstractOperation::AllowElArcSelecting(bool enabled) AllowCurveSelecting(enabled, GOType::EllipticalArc); } +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractOperation::ToolSelectionType(const SelectionType &type) +{ + VAbstractTool::ToolSelectionType(type); + QMapIterator i(operatedObjects); + while (i.hasNext()) + { + i.next(); + if (i.value()->GetType() == GOType::Point) + { + VSimplePoint *item = qobject_cast(i.value()); + SCASSERT(item != nullptr) + item->ToolSelectionType(selectionType); + } + } +} + //--------------------------------------------------------------------------------------------------------------------- void VAbstractOperation::Disable(bool disable, const QString &namePP) { diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h index 27d21bb59..dbd7e5217 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h @@ -102,6 +102,7 @@ public slots: void AllowElArcHover(bool enabled); void AllowElArcSelecting(bool enabled); + virtual void ToolSelectionType(const SelectionType &type); virtual void Disable(bool disable, const QString &namePP) Q_DECL_OVERRIDE; void ObjectSelected(bool selected, quint32 objId); void DeleteFromLabel();