diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-05-06 00:17:39 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-05-06 00:17:39 +0200 |
commit | d40815a568c4dce58360659c098f928789500d18 (patch) | |
tree | 41454c2734e40d53793659c836c7d2f49a6b2c4e /src/mainwindow/widgets/searchform.cpp | |
parent | Bump cmake version (diff) | |
download | smolbote-d40815a568c4dce58360659c098f928789500d18.tar.xz |
QTBUG-18665 workaround
Diffstat (limited to 'src/mainwindow/widgets/searchform.cpp')
-rw-r--r-- | src/mainwindow/widgets/searchform.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/mainwindow/widgets/searchform.cpp b/src/mainwindow/widgets/searchform.cpp index b400079..c6038ff 100644 --- a/src/mainwindow/widgets/searchform.cpp +++ b/src/mainwindow/widgets/searchform.cpp @@ -8,7 +8,8 @@ #include "searchform.h" #include "ui_searchform.h" -#include <QFocusEvent> +#include <QShowEvent> +#include <QHideEvent> #include <QWebEngineView> SearchForm::SearchForm(QWidget *parent) @@ -42,24 +43,18 @@ void SearchForm::setView(QWebEngineView *view) this->view = view; } -void SearchForm::showEvent(QShowEvent *e) +void SearchForm::showEvent(QShowEvent *event) { - e->accept(); ui->lineEdit->setFocus(); ui->lineEdit->selectAll(); + event->accept(); } -void SearchForm::hideEvent(QHideEvent *e) +void SearchForm::hideEvent(QHideEvent *event) { - e->accept(); // clear highlighted text when hiding if(view) { view->findText(""); } -} - -void SearchForm::focusInEvent(QFocusEvent *e) -{ - ui->lineEdit->setFocus(); - e->accept(); + event->accept(); } |