From 7f5c59625365cd4d353380b10289e59dce604c45 Mon Sep 17 00:00:00 2001 From: Ning Chi Date: Tue, 18 Jan 2011 18:24:40 +0200 Subject: 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. --- src/corelib/widgets/mcompleter.cpp | 8 ++++---- 1 file 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 -- cgit v1.2.3