diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2009-08-06 03:55:27 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2009-08-06 03:55:27 (GMT) |
commit | 06d57fc65c47d12047e985202ae1e394c48f78ca (patch) | |
tree | a897a8f91ad5e919e7cc66671b60d83248c96e72 /src/gui/itemviews | |
parent | 31fa1d0f6144e7e92748b33f8633eeb2f52483a1 (diff) | |
parent | 56b349951a70f3ab95e334e41e37f017e91cf481 (diff) | |
download | Qt-06d57fc65c47d12047e985202ae1e394c48f78ca.zip Qt-06d57fc65c47d12047e985202ae1e394c48f78ca.tar.gz Qt-06d57fc65c47d12047e985202ae1e394c48f78ca.tar.bz2 |
Merge commit 'origin/4.5'
Conflicts:
src/gui/dialogs/qfiledialog.cpp
src/gui/dialogs/qfiledialog_win.cpp
tests/auto/qicoimageformat/tst_qicoimageformat.cpp
tests/auto/qscriptqobject/qscriptqobject.pro
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 94569ec..ed2b3c5 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -2676,6 +2676,7 @@ void QAbstractItemView::keyboardSearch(const QString &search) QModelIndex current = start; QModelIndexList match; QModelIndex firstMatch; + QModelIndex startMatch; QModelIndexList previous; do { match = d->model->match(current, Qt::DisplayRole, searchString); @@ -2692,6 +2693,12 @@ void QAbstractItemView::keyboardSearch(const QString &search) if (row >= d->model->rowCount(firstMatch.parent())) row = 0; current = firstMatch.sibling(row, firstMatch.column()); + + //avoid infinite loop if all the matching items are disabled. + if (!startMatch.isValid()) + startMatch = firstMatch; + else if (startMatch == firstMatch) + break; } } while (current != start && firstMatch.isValid()); } |