From d92240e3ec5389b52ed6cc04f2730286332046c0 Mon Sep 17 00:00:00 2001 From: luddens Date: Mon, 13 Jan 2020 19:03:52 +0100 Subject: [PATCH] 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. --- src/searchbar.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/searchbar.cpp b/src/searchbar.cpp index 54c0422..32eeb98 100644 --- a/src/searchbar.cpp +++ b/src/searchbar.cpp @@ -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::of(&QCompleter::activated), this, &SearchBar::openCompletion); }