aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOrgad Shaneh <[email protected]>2018-06-25 23:56:41 +0300
committerOrgad Shaneh <[email protected]>2018-06-26 08:52:37 +0000
commit64b8f98a351a4af2e3e98c57e60d4eb0402b278d (patch)
treedcd832a46647bda749981e2e961d035cf2fe619a /src
parent5b95d912944a37a0f97a3cf1108e00b7de710e66 (diff)
FancyTabWidget: Set focus on widget change
If the locator popup is open, and the user changes mode using the keyboard (Ctrl+num), the popup was not closed. Change-Id: I7d5cb93229715dd293b6eb4d36cf2a9cb4467123 Reviewed-by: Eike Ziller <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/coreplugin/fancytabwidget.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/coreplugin/fancytabwidget.cpp b/src/plugins/coreplugin/fancytabwidget.cpp
index a9050029217..4fad26bc12c 100644
--- a/src/plugins/coreplugin/fancytabwidget.cpp
+++ b/src/plugins/coreplugin/fancytabwidget.cpp
@@ -29,6 +29,7 @@
#include "fancyactionbar.h"
#include <utils/hostosinfo.h>
+#include <utils/qtcassert.h>
#include <utils/styledbar.h>
#include <utils/stylehelper.h>
#include <utils/theme/theme.h>
@@ -599,6 +600,12 @@ void FancyTabWidget::showWidget(int index)
{
emit currentAboutToShow(index);
m_modesStack->setCurrentIndex(index);
+ QWidget *w = m_modesStack->currentWidget();
+ if (QTC_GUARD(w)) {
+ if (QWidget *focusWidget = w->focusWidget())
+ w = focusWidget;
+ w->setFocus();
+ }
emit currentChanged(index);
}