summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qcompleter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/util/qcompleter.cpp')
-rw-r--r--src/gui/util/qcompleter.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp
index aeb7e91..7571dfe 100644
--- a/src/gui/util/qcompleter.cpp
+++ b/src/gui/util/qcompleter.cpp
@@ -1079,7 +1079,14 @@ void QCompleter::setPopup(QAbstractItemView *popup)
popup->setModel(d->proxy);
popup->hide();
popup->setParent(0, Qt::Popup);
+
+ Qt::FocusPolicy origPolicy;
+ if (d->widget)
+ origPolicy = d->widget->focusPolicy();
popup->setFocusPolicy(Qt::NoFocus);
+ if (d->widget)
+ d->widget->setFocusPolicy(origPolicy);
+
popup->setFocusProxy(d->widget);
popup->installEventFilter(this);
popup->setItemDelegate(new QCompleterItemDelegate(popup));