From ac3679b10bfb0a1f7610c6fea9dca68529c93b49 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 27 Sep 2021 11:33:09 +0300 Subject: [PATCH] if i open the context menu on a piece (right click) and directly after open the context menu (again right click) on another piece, then a multiple selection occurs. Expectation: the same behaviour as when doing several left clicks after another (no multiple selection). --- src/app/puzzle/scene/vpgraphicspiece.cpp | 2 +- src/app/puzzle/scene/vpmaingraphicsview.cpp | 23 --------------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/src/app/puzzle/scene/vpgraphicspiece.cpp b/src/app/puzzle/scene/vpgraphicspiece.cpp index 46ec8a283..b9535575d 100644 --- a/src/app/puzzle/scene/vpgraphicspiece.cpp +++ b/src/app/puzzle/scene/vpgraphicspiece.cpp @@ -132,7 +132,7 @@ void VPGraphicsPiece::mousePressEvent(QGraphicsSceneMouseEvent *event) QGraphicsObject::mousePressEvent(event); // change the cursor when clicking the left button - if((event->button() == Qt::LeftButton)) + if(event->button() == Qt::LeftButton) { setCursor(Qt::ClosedHandCursor); diff --git a/src/app/puzzle/scene/vpmaingraphicsview.cpp b/src/app/puzzle/scene/vpmaingraphicsview.cpp index 7b328a1cf..03582bc7f 100644 --- a/src/app/puzzle/scene/vpmaingraphicsview.cpp +++ b/src/app/puzzle/scene/vpmaingraphicsview.cpp @@ -466,29 +466,6 @@ void VPMainGraphicsView::on_ItemClicked(QGraphicsItem *item) } } } - else - { - if (item->type() == VPGraphicsPiece::Type) - { - auto *pieceItem = dynamic_cast(item); - if (pieceItem != nullptr) - { - VPPiecePtr piece = pieceItem->GetPiece(); - if (not piece.isNull()) - { - if (not piece->IsSelected()) - { - piece->SetSelected(true); - VPLayoutPtr layout = m_layout.toStrongRef(); - if (not layout.isNull()) - { - emit layout->PieceSelectionChanged(piece); - } - } - } - } - } - } } //---------------------------------------------------------------------------------------------------------------------