Fixes to ctrl+backspace behavior (#5013)
This commit is contained in:
@@ -113,6 +113,7 @@ void SettingsDialog::initUi()
|
||||
edit->setClearButtonEnabled(true);
|
||||
edit->findChild<QAbstractButton *>()->setIcon(
|
||||
QPixmap(":/buttons/clearSearch.png"));
|
||||
this->ui_.search->installEventFilter(this);
|
||||
|
||||
QObject::connect(edit.getElement(), &QLineEdit::textChanged, this,
|
||||
&SettingsDialog::filterElements);
|
||||
@@ -206,6 +207,21 @@ void SettingsDialog::setElementFilter(const QString &query)
|
||||
this->ui_.search->setText(query);
|
||||
}
|
||||
|
||||
bool SettingsDialog::eventFilter(QObject *object, QEvent *event)
|
||||
{
|
||||
if (object == this->ui_.search && event->type() == QEvent::KeyPress)
|
||||
{
|
||||
auto *keyEvent = dynamic_cast<QKeyEvent *>(event);
|
||||
if (keyEvent == QKeySequence::DeleteStartOfWord &&
|
||||
this->ui_.search->selectionLength() > 0)
|
||||
{
|
||||
this->ui_.search->backspace();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SettingsDialog::addTabs()
|
||||
{
|
||||
this->ui_.tabContainer->setSpacing(0);
|
||||
|
||||
Reference in New Issue
Block a user