aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickcombobox.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2022-04-07 15:22:16 +0300
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-04-07 15:22:16 +0300
commit69c1a1e86b9774fbee6958021055c899151e1955 (patch)
treecf8619fa03e1442b06ee13983d3c3c5d9f307669 /src/quicktemplates2/qquickcombobox.cpp
parent453e302ea51a9f628ccb1382e812b09f259f890b (diff)
parentc379659f5f51ae14331e5bdd365ef229c9a4c9c9 (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.4' into tqtc/lts-5.15-opensourcev5.15.4-lts-lgpl
Diffstat (limited to 'src/quicktemplates2/qquickcombobox.cpp')
-rw-r--r--src/quicktemplates2/qquickcombobox.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp
index ea8d3d1d..b715659f 100644
--- a/src/quicktemplates2/qquickcombobox.cpp
+++ b/src/quicktemplates2/qquickcombobox.cpp
@@ -1740,7 +1740,11 @@ void QQuickComboBox::focusInEvent(QFocusEvent *event)
{
Q_D(QQuickComboBox);
QQuickControl::focusInEvent(event);
- if (d->contentItem && isEditable())
+ // Setting focus on TextField should not be done when drop down indicator was clicked
+ // That is why, if focus is not set with key reason, it should not be passed to textEdit by default.
+ // Focus on Edit Text should be set only intentionally by user.
+ if ((event->reason() == Qt::TabFocusReason || event->reason() == Qt::BacktabFocusReason ||
+ event->reason() == Qt::ShortcutFocusReason) && d->contentItem && isEditable())
d->contentItem->forceActiveFocus(event->reason());
}