From f003bfbb4cc18c7d2183b67d4a65b21cd642aae7 Mon Sep 17 00:00:00 2001 From: afaina Date: Fri, 22 Oct 2021 20:21:10 +0200 Subject: [PATCH] fixes jump label behavior in right clicks (fixes #3895) --- src/items/partlabel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/items/partlabel.cpp b/src/items/partlabel.cpp index 8000b27db..d6bda1329 100644 --- a/src/items/partlabel.cpp +++ b/src/items/partlabel.cpp @@ -182,6 +182,11 @@ void PartLabel::mousePressEvent(QGraphicsSceneMouseEvent *event) return; } + if(event->button() == Qt::RightButton) { + //Return but do not ignore the event (we will handle the context menu event) + return; + } + InfoGraphicsView *infographics = InfoGraphicsView::getInfoGraphicsView(this); if (infographics && infographics->spaceBarIsPressed()) { m_spaceBarWasPressed = true; @@ -238,6 +243,7 @@ void PartLabel::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (m_doDrag) { m_owner->partLabelMoved(m_initialPosition, m_initialOffset, pos(), m_offset); + m_doDrag = false; } QGraphicsSvgItem::mouseReleaseEvent(event);