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:
parent
72da739e90
commit
ac3679b10b
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user