Fixes to ctrl+backspace behavior (#5013)

This commit is contained in:
Herman Stornes
2023-12-16 14:40:05 +01:00
committed by GitHub
parent 918b8ca4bd
commit b78b57b454
7 changed files with 44 additions and 4 deletions
+3 -4
View File
@@ -202,11 +202,10 @@ bool SearchPopup::eventFilter(QObject *object, QEvent *event)
if (object == this->searchInput_ && event->type() == QEvent::KeyPress)
{
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
if (keyEvent->key() == Qt::Key_Backspace &&
keyEvent->modifiers() == Qt::ControlModifier &&
this->searchInput_->text() == this->searchInput_->selectedText())
if (keyEvent == QKeySequence::DeleteStartOfWord &&
this->searchInput_->selectionLength() > 0)
{
this->searchInput_->clear();
this->searchInput_->backspace();
return true;
}
}