nodeview: select on right click

This commit is contained in:
itsmattkc
2020-08-07 20:17:01 +10:00
parent 849e051fa4
commit c6dd0e0204
+13
View File
@@ -341,6 +341,19 @@ void NodeView::mousePressEvent(QMouseEvent *event)
{
if (HandPress(event)) return;
if (event->button() == Qt::RightButton) {
// Qt doesn't do this by default for some reason
if (!(event->modifiers() & Qt::ShiftModifier)) {
scene_.clearSelection();
}
// If there's an item here, select it
QGraphicsItem* item = itemAt(event->pos());
if (item) {
item->setSelected(true);
}
}
super::mousePressEvent(event);
}