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).
This commit is contained in:
Roman Telezhynskyi 2021-09-27 11:33:09 +03:00
parent 72da739e90
commit ac3679b10b
2 changed files with 1 additions and 24 deletions

View File

@ -132,7 +132,7 @@ void VPGraphicsPiece::mousePressEvent(QGraphicsSceneMouseEvent *event)
QGraphicsObject::mousePressEvent(event); QGraphicsObject::mousePressEvent(event);
// change the cursor when clicking the left button // change the cursor when clicking the left button
if((event->button() == Qt::LeftButton)) if(event->button() == Qt::LeftButton)
{ {
setCursor(Qt::ClosedHandCursor); setCursor(Qt::ClosedHandCursor);

View File

@ -466,29 +466,6 @@ void VPMainGraphicsView::on_ItemClicked(QGraphicsItem *item)
} }
} }
} }
else
{
if (item->type() == VPGraphicsPiece::Type)
{
auto *pieceItem = dynamic_cast<VPGraphicsPiece*>(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);
}
}
}
}
}
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------