Add default to switch

This commit is contained in:
Jonas Kvinge
2024-06-12 17:41:17 +02:00
parent 7b43a94055
commit 05358cdfe4
7 changed files with 34 additions and 9 deletions

View File

@@ -157,12 +157,12 @@ void AutoExpandingTreeView::keyPressEvent(QKeyEvent *e) {
switch (e->key()) {
case Qt::Key_Backspace:
case Qt::Key_Escape:
case Qt::Key_Escape:{
emit FocusOnFilterSignal(e);
e->accept();
break;
case Qt::Key_Left:
}
case Qt::Key_Left:{
// Set focus on the root of the current branch
const QModelIndex idx = currentIndex();
if (idx.isValid() && idx.parent() != rootIndex() && (!isExpanded(idx) || model()->rowCount(idx) == 0)) {
@@ -171,6 +171,9 @@ void AutoExpandingTreeView::keyPressEvent(QKeyEvent *e) {
e->accept();
}
break;
}
default:
break;
}
QTreeView::keyPressEvent(e);