fix searchbar that doesn't search after switching from another app

Same problem as this problem https://github.com/kiwix/kiwix-desktop/pull/180

The openCompletion has to be connected every time the searchbar gains the focus.
This commit is contained in:
luddens 2020-01-13 19:03:52 +01:00 committed by Kelson
parent a4844b6aea
commit d92240e3ec

View File

@ -93,6 +93,9 @@ void SearchBar::focusInEvent( QFocusEvent* event)
{
if (event->reason() == Qt::MouseFocusReason) {
clear();
}
if (event->reason() == Qt::ActiveWindowFocusReason ||
event->reason() == Qt::MouseFocusReason) {
connect(&m_completer, QOverload<const QModelIndex &>::of(&QCompleter::activated),
this, &SearchBar::openCompletion);
}