From 678ab325c0a38b475a60a9045691789d115b2491 Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Sun, 9 Jan 2022 22:33:43 +0100 Subject: [PATCH] #12423 fix a focus change problem The search widget triggers a showEvent() in updateTitle() leading to setting the focus to the default push button. The check in updateTitle() for the need to restore the title avoids superfluous show events and avoids the unwanted focus change. --- src/frontends/qt/GuiSearch.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt/GuiSearch.cpp b/src/frontends/qt/GuiSearch.cpp index e387ce8ee6..f12d42c11d 100644 --- a/src/frontends/qt/GuiSearch.cpp +++ b/src/frontends/qt/GuiSearch.cpp @@ -649,9 +649,10 @@ void GuiSearch::updateTitle() // remove title bar setTitleBarWidget(new QWidget()); titleBarWidget()->hide(); - } else + } else if (titleBarWidget()) { // restore title bar setTitleBarWidget(nullptr); + } }