diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-03-13 08:43:32 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-03-13 08:43:32 +0100 |
commit | 57aa9580f07307c5e277e52362943e7efd1f9ac9 (patch) | |
tree | b638b0637283fe00a1f9a173a8d2a03adab9e0d2 /src/quicktemplates2/qquickcombobox.cpp | |
parent | 5b18141e1165e24d2f3909548772916bea5faf10 (diff) | |
parent | 5c2b1bee5258981800c623dc3f054b15d7875484 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I32562a4aa6ca3090b28f624d675024f6b717bedb
Diffstat (limited to 'src/quicktemplates2/qquickcombobox.cpp')
-rw-r--r-- | src/quicktemplates2/qquickcombobox.cpp | 11 |
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 |