From fd658631b39df53d7298cb14ce73a9b820b373f4 Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Sun, 20 Dec 2015 21:51:14 +0200 Subject: [PATCH 1/3] We don't need to move nodePoints --HG-- branch : feature --- src/libs/vtools/tools/nodeDetails/vnodepoint.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp index cb1d10d1c..dc25e90d0 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp @@ -294,6 +294,5 @@ void VNodePoint::RefreshLine() //--------------------------------------------------------------------------------------------------------------------- void VNodePoint::EnableToolMove(bool move) { - this->setFlag(QGraphicsItem::ItemIsMovable, move); namePoint->setFlag(QGraphicsItem::ItemIsMovable, move); } From 73c544c45dfdbd93b4aea0f8b4305e2a157c30ae Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Sun, 20 Dec 2015 21:53:59 +0200 Subject: [PATCH 2/3] Resolved issue #271. Deny move workpieces when tool union is active. --HG-- branch : feature --- src/libs/vtools/tools/vtooldetail.cpp | 8 ++++++++ src/libs/vtools/tools/vtooldetail.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/libs/vtools/tools/vtooldetail.cpp b/src/libs/vtools/tools/vtooldetail.cpp index ef7540a99..3b560902f 100644 --- a/src/libs/vtools/tools/vtooldetail.cpp +++ b/src/libs/vtools/tools/vtooldetail.cpp @@ -105,6 +105,8 @@ VToolDetail::VToolDetail(VAbstractPattern *doc, VContainer *data, const quint32 RefreshGeometry(); this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true); + + connect(scene, &VMainGraphicsScene::EnableToolMove, this, &VToolDetail::EnableToolMove); if (typeCreation == Source::FromGui || typeCreation == Source::FromTool) { AddToFile(); @@ -607,3 +609,9 @@ void VToolDetail::InitTool(VMainGraphicsScene *scene, const VNodeDetail &node) tool->setParentItem(this); doc->IncrementReferens(node.getId()); } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolDetail::EnableToolMove(bool move) +{ + this->setFlag(QGraphicsItem::ItemIsMovable, move); +} diff --git a/src/libs/vtools/tools/vtooldetail.h b/src/libs/vtools/tools/vtooldetail.h index f9f60740b..91670dd09 100644 --- a/src/libs/vtools/tools/vtooldetail.h +++ b/src/libs/vtools/tools/vtooldetail.h @@ -89,6 +89,7 @@ public: public slots: virtual void FullUpdateFromFile () Q_DECL_OVERRIDE; virtual void FullUpdateFromGuiOk(int result); + void EnableToolMove(bool move); protected: virtual void AddToFile () Q_DECL_OVERRIDE; virtual void RefreshDataInFile() Q_DECL_OVERRIDE; From 1dce05b23927b570427543b9a2cbcff791138b64 Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Sun, 20 Dec 2015 21:55:27 +0200 Subject: [PATCH 3/3] Show openHand cursor only if we can move the detail --HG-- branch : feature --- src/libs/vtools/tools/vtooldetail.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/libs/vtools/tools/vtooldetail.cpp b/src/libs/vtools/tools/vtooldetail.cpp index 3b560902f..8f8f05247 100644 --- a/src/libs/vtools/tools/vtooldetail.cpp +++ b/src/libs/vtools/tools/vtooldetail.cpp @@ -428,14 +428,20 @@ void VToolDetail::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void VToolDetail::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - SetOverrideCursor(cursorArrowOpenHand, 1, 1); + if (flags() & QGraphicsItem::ItemIsMovable) + { + SetOverrideCursor(cursorArrowOpenHand, 1, 1); + } } //--------------------------------------------------------------------------------------------------------------------- void VToolDetail::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - SetOverrideCursor(cursorArrowOpenHand, 1, 1); + if (flags() & QGraphicsItem::ItemIsMovable) + { + SetOverrideCursor(cursorArrowOpenHand, 1, 1); + } } ////--------------------------------------------------------------------------------------------------------------------- @@ -443,7 +449,10 @@ void VToolDetail::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); //Disable cursor-arrow-openhand - RestoreOverrideCursor(cursorArrowOpenHand); + if (flags() & QGraphicsItem::ItemIsMovable) + { + RestoreOverrideCursor(cursorArrowOpenHand); + } } //---------------------------------------------------------------------------------------------------------------------