summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@digia.com>2013-09-11 10:50:39 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-04 13:19:57 +0100
commit3e549f5daa55464512ee2763558f3a7ffd45c545 (patch)
tree9713933b6ae01159706a08fb10eac759441673e2 /src
parent5da094c1aa21d0440a31bf09d51016b8af7de046 (diff)
QComboBox: fix keyboard selection with multiple character strings.
Take longer search strings into account instead of just using the first character of the search string. Touches up https://qt.gitorious.org/qt/qt/merge_requests/1418 for resubmission. Task-number: QTBUG-3032 [ChangeLog][QtWidgets][QSpinBox] Fixed keyboard selection with multiple-character strings. Change-Id: I2f68c8b97b1a1884659dcb19f52b1efeace9b88b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 7edad74f54..771753b7da 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -2939,14 +2939,13 @@ void QAbstractItemView::keyboardSearch(const QString &search)
}
// search from start with wraparound
- const QString searchString = sameKey ? QString(d->keyboardInput.at(0)) : d->keyboardInput;
QModelIndex current = start;
QModelIndexList match;
QModelIndex firstMatch;
QModelIndex startMatch;
QModelIndexList previous;
do {
- match = d->model->match(current, Qt::DisplayRole, searchString);
+ match = d->model->match(current, Qt::DisplayRole, d->keyboardInput);
if (match == previous)
break;
firstMatch = match.value(0);