summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2009-08-06 03:55:27 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2009-08-06 03:55:27 (GMT)
commit06d57fc65c47d12047e985202ae1e394c48f78ca (patch)
treea897a8f91ad5e919e7cc66671b60d83248c96e72 /src/gui/itemviews
parent31fa1d0f6144e7e92748b33f8633eeb2f52483a1 (diff)
parent56b349951a70f3ab95e334e41e37f017e91cf481 (diff)
downloadQt-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.cpp7
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());
}