From 39a1c500229df854085e066dde5272844d571895 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 26 Apr 2017 08:19:39 +0300 Subject: [PATCH] Fix bug. Labels created tools from Operation section should be not movable when use a tool. --HG-- branch : release --- .../drawTools/operation/vabstractoperation.cpp | 16 ++++++++++++++++ .../drawTools/operation/vabstractoperation.h | 1 + 2 files changed, 17 insertions(+) diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp index 8497ec0f0..fa3b6c50f 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp @@ -223,6 +223,22 @@ void VAbstractOperation::AllowSelecting(bool enabled) } } +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractOperation::EnableToolMove(bool move) +{ + QMapIterator i(operatedObjects); + while (i.hasNext()) + { + i.next(); + if (i.value()->GetType() == GOType::Point) + { + VSimplePoint *item = qobject_cast(i.value()); + SCASSERT(item != nullptr) + item->EnableToolMove(move); + } + } +} + //--------------------------------------------------------------------------------------------------------------------- void VAbstractOperation::AllowPointHover(bool enabled) { diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h index 7e57adde6..689bf28c8 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h @@ -83,6 +83,7 @@ public slots: virtual void AllowHover(bool enabled) Q_DECL_OVERRIDE; virtual void AllowSelecting(bool enabled) Q_DECL_OVERRIDE; + virtual void EnableToolMove(bool move) Q_DECL_OVERRIDE; void AllowPointHover(bool enabled); void AllowPointSelecting(bool enabled);