From 05cad85ab3f7f1654cbc8e823bbea2087417ab8d Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 23 Oct 2017 14:31:01 +0300 Subject: [PATCH] Fix bug with tool seam allowance cursor. --HG-- branch : feature --- src/libs/vtools/tools/vtoolseamallowance.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index d261adf37..6791982e6 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -1063,7 +1063,7 @@ void VToolSeamAllowance::mousePressEvent(QGraphicsSceneMouseEvent *event) //--------------------------------------------------------------------------------------------------------------------- void VToolSeamAllowance::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { - if (event->button() == Qt::LeftButton) + if (event->button() == Qt::LeftButton && (flags() & QGraphicsItem::ItemIsMovable)) { SetItemOverrideCursor(this, cursorArrowOpenHand, 1, 1); } @@ -1077,6 +1077,16 @@ void VToolSeamAllowance::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { SetItemOverrideCursor(this, cursorArrowOpenHand, 1, 1); } + else + { + if (QGraphicsScene *scene = this->scene()) + { + if (QGraphicsView *view = scene->views().at(0)) + { + setCursor(view->viewport()->cursor()); + } + } + } QGraphicsPathItem::hoverEnterEvent(event); }