From 9586c51c3fe2bfa2f5cb045266b9d23d42b9c7b5 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Thu, 6 May 2021 12:27:38 +0200 Subject: [PATCH] GuiSearch: prevent Tab key to switch to work area (part of #12170) QWidget::focusNextPrevChild() passes over to the parent (which is the work area here) if the current window is not a dialog (isWindow()) or a sub-window (window flag Qt::SubWindow). We set the latter here to prevent this unwanted behavior. Let's see if there are side-effects. --- src/frontends/qt/GuiSearch.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frontends/qt/GuiSearch.cpp b/src/frontends/qt/GuiSearch.cpp index 32a8fd15d6..9212ddd30c 100644 --- a/src/frontends/qt/GuiSearch.cpp +++ b/src/frontends/qt/GuiSearch.cpp @@ -126,6 +126,10 @@ GuiSearchWidget::GuiSearchWidget(QWidget * parent) replacePB->setEnabled(false); replacePrevPB->setEnabled(false); replaceallPB->setEnabled(false); + + // Make this a sub window to prevent focusNextPrevChild (Tab) + // switching to the parent (#12170) + setWindowFlags(Qt::SubWindow); }