ProjectExplorer: Let the user delete sessions via the "Delete" key

Task-number: QTCREATORBUG-17668
Change-Id: Id827be147627a54953e6495be503c97b31232cf3
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2019-05-09 15:17:31 +02:00
parent e3def98c00
commit e919a9f545
2 changed files with 14 additions and 3 deletions

View File

@@ -141,5 +141,16 @@ void SessionView::showEvent(QShowEvent *event)
setFocus();
}
void SessionView::keyPressEvent(QKeyEvent *event)
{
if (event->key() != Qt::Key_Delete) {
TreeView::keyPressEvent(event);
return;
}
const QString session = currentSession();
if (!session.isEmpty() && session != "default" && session != SessionManager::activeSession())
deleteCurrentSession();
}
} // namespace Internal
} // namespace ProjectExplorer