summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp')
-rw-r--r--Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp b/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp
index 2b775f9..8ed6efb 100644
--- a/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp
+++ b/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp
@@ -132,6 +132,11 @@ void QtSuggestingJIDInput::keyPressEvent(QKeyEvent* event) {
}
}
+void QtSuggestingJIDInput::hideEvent(QHideEvent* /* event */) {
+ // Hide our popup when we are hidden (can happen when a dialog is closed by the user).
+ treeViewPopup_->hide();
+}
+
void QtSuggestingJIDInput::handleApplicationFocusChanged(QWidget* /*old*/, QWidget* /*now*/) {
/* Using the now argument gives use the wrong widget. This is part of the code needed
to prevent stealing of focus when opening a the suggestion window. */
@@ -196,6 +201,9 @@ void QtSuggestingJIDInput::showPopup() {
void QtSuggestingJIDInput::hidePopup() {
disconnect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), this, SLOT(handleApplicationFocusChanged(QWidget*, QWidget*)));
treeViewPopup_->hide();
+
+ // Give focus back to input widget because the hide() call passes the focus to the wrong widget.
+ setFocus();
}
}