diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-09-02 10:08:08 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-09-02 10:12:25 (GMT) |
commit | 1bce9d21d72a30cc7a17ae646d8fefd71a37c525 (patch) | |
tree | 0aa9c62b8a9ac7144cab9d2e403909f294f84c2f /src/gui/util | |
parent | 456feb3c8ecbf5d2349a747f19e742052ecd9762 (diff) | |
download | Qt-1bce9d21d72a30cc7a17ae646d8fefd71a37c525.zip Qt-1bce9d21d72a30cc7a17ae646d8fefd71a37c525.tar.gz Qt-1bce9d21d72a30cc7a17ae646d8fefd71a37c525.tar.bz2 |
QCompleter could crash when setting the completion prefix
This fixes the autotest that was crashing
Task-number: 246056
Reviewed-by: ogoffart
Diffstat (limited to 'src/gui/util')
-rw-r--r-- | src/gui/util/qcompleter.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp index 6196f0f..87dab42 100644 --- a/src/gui/util/qcompleter.cpp +++ b/src/gui/util/qcompleter.cpp @@ -823,12 +823,11 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted) Q_Q(QCompleter); QString completion; - if (!(index.flags() & Qt::ItemIsEnabled)) - return; - if (!index.isValid() || (!proxy->showAll && (index.row() >= proxy->engine->matchCount()))) { completion = prefix; } else { + if (!(index.flags() & Qt::ItemIsEnabled)) + return; QModelIndex si = proxy->mapToSource(index); si = si.sibling(si.row(), column); // for clicked() completion = q->pathFromIndex(si); |