Fix arrow navigation in TreeWidget
Closes #10488. This commit removes the code fragment that "swallowed" the key press events.
This commit is contained in:
@@ -1682,22 +1682,7 @@ void TreeWidget::keyPressEvent(QKeyEvent* event)
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (event->key() == Qt::Key_Left) {
|
||||
auto index = currentIndex();
|
||||
if (index.column() == 1) {
|
||||
setCurrentIndex(model()->index(index.row(), 0, index.parent()));
|
||||
event->accept();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (event->key() == Qt::Key_Right) {
|
||||
auto index = currentIndex();
|
||||
if (index.column() == 0) {
|
||||
setCurrentIndex(model()->index(index.row(), 1, index.parent()));
|
||||
event->accept();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QTreeWidget::keyPressEvent(event);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user