From 29c61b977892e07733457608a07c5899e6001419 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 4 Feb 2017 20:30:32 +0200 Subject: [PATCH] Fix minore bugs in Seam allowance tool. --HG-- branch : develop --- src/libs/vtools/tools/vtoolseamallowance.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index 7a13ae281..665170820 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -342,6 +342,7 @@ void VToolSeamAllowance::AllowSelecting(bool enabled) //--------------------------------------------------------------------------------------------------------------------- void VToolSeamAllowance::ResetChildren(QGraphicsItem *pItem) { + const bool selected = isSelected(); const VPiece detail = VAbstractTool::data.GetPiece(id); VTextGraphicsItem* pVGI = qgraphicsitem_cast(pItem); if (pVGI != m_dataLabel) @@ -367,6 +368,7 @@ void VToolSeamAllowance::ResetChildren(QGraphicsItem *pItem) } } + setSelected(selected); update(); } @@ -703,10 +705,7 @@ void VToolSeamAllowance::paint(QPainter *painter, const QStyleOptionGraphicsItem if (m_dataLabel->IsIdle() == false || m_patternInfo->IsIdle() == false || m_grainLine->IsIdle() == false) { - painter->save(); - painter->setPen(QPen(Qt::black, 3, Qt::DashLine)); - painter->drawRect(boundingRect().adjusted(1, 1, -1, -1)); - painter->restore(); + setSelected(true); } QGraphicsPathItem::paint(painter, option, widget); }