diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-16 09:46:06 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-16 09:46:06 (GMT) |
commit | 1cc498e36725e4019afad367b08e992e5e497be4 (patch) | |
tree | eaa6a5de673891d79eab5974029f26676810ae38 /src/gui/util/qcompleter.cpp | |
parent | 4d9d3ed84c3bf1f6d08a9ddd36f834b9c8972b38 (diff) | |
parent | fa0b5ef33467868d895d925e34f539f28ddb2d8b (diff) | |
download | Qt-1cc498e36725e4019afad367b08e992e5e497be4.zip Qt-1cc498e36725e4019afad367b08e992e5e497be4.tar.gz Qt-1cc498e36725e4019afad367b08e992e5e497be4.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (27 commits)
Revert "QWorkspace: fix hardcoded min size overwriting the real min size"
Disable the unified toolbar before entering
QWorkspace: fix hardcoded min size overwriting the real min size
Fix tst_moduleqt47::accidentalImport
tst_qcompleter: Fix the QTBUG_14292_filesystem test on X11
tst_qcompleter.cpp: fix test on mac.
Fixed autotest that was missing focus on Windows
QGraphicsLayoutItem - user set sizes should always override, even if there's a constraint
QGridLayoutEngine - Rework height-for-width support so that row/col spanning works
Revert "Revert "Fix (implement!) hfw/wfh in QGridLayoutEngine""
Fixed statement about const_iterator and some whitespace fixes.
Adjust the parent index for the itemsMoved call.
Correctly handle both 16bit and 32bit live pixmaps in meego graphics system.
Correctly remove the egl alpha surface flags in meego graphics system.
Proper dither & proper alpha checking.
In meego graphics system, use always 16bit textures.
QCompleter: do not auto complete when directory is changed.
tst_qcompleter: Add a test for QFileSystemModel
Doc: adjusting the search field width
Doc - remove disclaimer
...
Diffstat (limited to 'src/gui/util/qcompleter.cpp')
-rw-r--r-- | src/gui/util/qcompleter.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp index e718212..bcd601b 100644 --- a/src/gui/util/qcompleter.cpp +++ b/src/gui/util/qcompleter.cpp @@ -782,7 +782,8 @@ QMatchData QUnsortedModelEngine::filter(const QString& part, const QModelIndex& /////////////////////////////////////////////////////////////////////////////// QCompleterPrivate::QCompleterPrivate() : widget(0), proxy(0), popup(0), cs(Qt::CaseSensitive), role(Qt::EditRole), column(0), - maxVisibleItems(7), sorting(QCompleter::UnsortedModel), wrap(true), eatFocusOut(true) + maxVisibleItems(7), sorting(QCompleter::UnsortedModel), wrap(true), eatFocusOut(true), + hiddenBecauseNoMatch(false) { } @@ -921,12 +922,14 @@ void QCompleterPrivate::showPopup(const QRect& rect) void QCompleterPrivate::_q_fileSystemModelDirectoryLoaded(const QString &path) { Q_Q(QCompleter); -#ifndef QT_NO_LINEEDIT - QLineEdit *lineEdit = qobject_cast<QLineEdit *>(widget); - //the path given by QFileSystemModel does not end with / - if (lineEdit && !lineEdit->text().isEmpty() && !q->completionPrefix().isEmpty() && q->completionPrefix() != path + QLatin1Char('/')) + // Slot called when QFileSystemModel has finished loading. + // If we hide the popup because there was no match because the model was not loaded yet, + // we re-start the completion when we get the results + if (hiddenBecauseNoMatch + && prefix.startsWith(path) && prefix != (path + '/') + && widget) { q->complete(); -#endif + } } /*! @@ -1200,6 +1203,7 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e) Q_D(QCompleter); if (d->eatFocusOut && o == d->widget && e->type() == QEvent::FocusOut) { + d->hiddenBecauseNoMatch = false; if (d->popup && d->popup->isVisible()) return true; } @@ -1378,6 +1382,7 @@ void QCompleter::complete(const QRect& rect) { Q_D(QCompleter); QModelIndex idx = d->proxy->currentIndex(false); + d->hiddenBecauseNoMatch = false; if (d->mode == QCompleter::InlineCompletion) { if (idx.isValid()) d->_q_complete(idx, true); @@ -1389,6 +1394,7 @@ void QCompleter::complete(const QRect& rect) || (d->mode == QCompleter::UnfilteredPopupCompletion && d->proxy->rowCount() == 0)) { if (d->popup) d->popup->hide(); // no suggestion, hide + d->hiddenBecauseNoMatch = true; return; } |