aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKåre Särs <[email protected]>2015-10-08 10:59:34 +0300
committerKåre Särs <[email protected]>2015-10-08 11:08:01 +0300
commit3d1834e1e18e2198ac62a91ccaecb06aff685f7f (patch)
tree913606472aca5e6edf877fdde8c7d966795abc64
parent31ac3db0a96228df8026ae86d1853d8b6212f2bd (diff)
S&R: Focus the correct object in searchWhileTypingDone
BUG:350411
-rw-r--r--addons/search/plugin_search.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/search/plugin_search.cpp b/addons/search/plugin_search.cpp
index 7324454..d8508c0 100644
--- a/addons/search/plugin_search.cpp
+++ b/addons/search/plugin_search.cpp
@@ -1176,10 +1176,12 @@ void KatePluginSearchView::searchWhileTypingDone()
m_curResults->tree->setColumnWidth(0, m_curResults->tree->width()-30);
}
+ QWidget *focusObject = 0;
QTreeWidgetItem *root = m_curResults->tree->topLevelItem(0);
if (root) {
QTreeWidgetItem *child = root->child(0);
if (!m_searchJustOpened) {
+ focusObject = qobject_cast<QWidget *>(QGuiApplication::focusObject());
itemSelected(child);
}
indicateMatch(child);
@@ -1190,7 +1192,9 @@ void KatePluginSearchView::searchWhileTypingDone()
}
m_curResults = 0;
- m_ui.searchCombo->lineEdit()->setFocus();
+ if (focusObject) {
+ focusObject->setFocus();
+ }
if (popupVisible) {
m_ui.searchCombo->lineEdit()->completer()->complete();
}