Fix pressing "Backspace" key on a playlist results in appending "^H" character to the filter

This commit is contained in:
Ivan Leontiev 2016-03-25 03:36:46 +03:00
parent 23c0fe9f12
commit 9afd71c651

View File

@ -397,10 +397,18 @@ void PlaylistContainer::resizeEvent(QResizeEvent* e) {
void PlaylistContainer::FocusOnFilter(QKeyEvent* event) { void PlaylistContainer::FocusOnFilter(QKeyEvent* event) {
ui_->filter->setFocus(); ui_->filter->setFocus();
if (event->key() == Qt::Key_Escape) {
ui_->filter->clear(); switch (event->key()) {
} else { case Qt::Key_Backspace:
ui_->filter->setText(ui_->filter->text() + event->text()); break;
case Qt::Key_Escape:
ui_->filter->clear();
break;
default:
ui_->filter->setText(ui_->filter->text() + event->text());
break;
} }
} }