diff options
author | Ning Chi <ext-chi.ning@nokia.com> | 2011-01-18 18:24:40 +0200 |
---|---|---|
committer | Pekka Vuorela <pekka.ta.vuorela@nokia.com> | 2011-01-25 15:55:40 +0200 |
commit | 7f5c59625365cd4d353380b10289e59dce604c45 (patch) | |
tree | de7e129fe1c6bf3239d7be5fd8b37cff4ee20ca8 | |
parent | 02c2ae5be89dac0f02248fc717b771b4b5524c9f (diff) |
Fixes: NB#211829 - Not able to see a contact list when using completer
RevBy: Pekka Vuorela
Details: completer isActive should also return true if popup list is
shown. And completer should trigger pollModel() when model data is changed.
-rw-r--r-- | src/corelib/widgets/mcompleter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/widgets/mcompleter.cpp b/src/corelib/widgets/mcompleter.cpp index c72c6990..2f2abf7a 100644 --- a/src/corelib/widgets/mcompleter.cpp +++ b/src/corelib/widgets/mcompleter.cpp @@ -271,7 +271,7 @@ void MCompleterPrivate::setCompletionModel(QAbstractItemModel *m, bool own) //default value column is the last column q->model()->setValueColumnIndex(completionModel->columnCount() - 1); QObject::connect(completionModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), - q, SLOT(_q_modelUpdate())); + q, SLOT(_q_pollModel())); QObject::connect(completionModel, SIGNAL(modelAboutToBeReset()), q, SLOT(_q_modelAboutToBeReset())); QObject::connect(completionModel, SIGNAL(modelReset()), @@ -497,7 +497,7 @@ void MCompleter::complete() void MCompleter::confirm() { Q_D(MCompleter); - if (!widget() || (!isActive() && !model()->popupActive())) + if (!widget() || !isActive()) return; //fetch prefix again, ensure the prefix is not null @@ -536,7 +536,7 @@ void MCompleter::setAcceptMultipleEntries(bool enable) bool MCompleter::isActive() const { - return model()->active(); + return model()->active() || model()->popupActive(); } void MCompleter::queryAll() @@ -591,7 +591,7 @@ bool MCompleter::eventFilter(QObject *object, QEvent *e) { Q_D(MCompleter); bool eaten = false; - if (isActive() && object == widget()) { + if (model()->active() && object == widget()) { switch (e->type()) { case QEvent::GraphicsSceneMouseRelease: //User relocates the cursor by tapping the text entry will hide completer |