aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickcombobox.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-03-13 08:43:32 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-03-13 08:43:32 +0100
commit57aa9580f07307c5e277e52362943e7efd1f9ac9 (patch)
treeb638b0637283fe00a1f9a173a8d2a03adab9e0d2 /src/quicktemplates2/qquickcombobox.cpp
parent5b18141e1165e24d2f3909548772916bea5faf10 (diff)
parent5c2b1bee5258981800c623dc3f054b15d7875484 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'src/quicktemplates2/qquickcombobox.cpp')
-rw-r--r--src/quicktemplates2/qquickcombobox.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp
index 6aef6391..28d3506f 100644
--- a/src/quicktemplates2/qquickcombobox.cpp
+++ b/src/quicktemplates2/qquickcombobox.cpp
@@ -581,9 +581,14 @@ void QQuickComboBoxPrivate::setHighlightedIndex(int index, Highlighting highligh
void QQuickComboBoxPrivate::keySearch(const QString &text)
{
- int index = match(currentIndex + 1, text, Qt::MatchStartsWith | Qt::MatchWrap);
- if (index != -1)
- setCurrentIndex(index, Activate);
+ const int startIndex = isPopupVisible() ? highlightedIndex : currentIndex;
+ const int index = match(startIndex + 1, text, Qt::MatchStartsWith | Qt::MatchWrap);
+ if (index != -1) {
+ if (isPopupVisible())
+ setHighlightedIndex(index, Highlight);
+ else
+ setCurrentIndex(index, Activate);
+ }
}
int QQuickComboBoxPrivate::match(int start, const QString &text, Qt::MatchFlags flags) const