QComboBoxPrivateContainer: add missing keyEvent->accept()
Call QEvent::accept() when a key event has been acted on. This prevents redundant event delivery and consumption. Task-number: QTBUG-117644 Pick-to: 6.5 Change-Id: I069c61c14890577683894f165fd2585ba05c45ff Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 2b63d0ccf3f99b3a21d02fc4804df0be385e9526) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
e0038c43b3
commit
aa152c3e4d
@ -725,6 +725,7 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
|
|||||||
#endif
|
#endif
|
||||||
if (view->currentIndex().isValid() && view->currentIndex().flags().testFlag(Qt::ItemIsEnabled)) {
|
if (view->currentIndex().isValid() && view->currentIndex().flags().testFlag(Qt::ItemIsEnabled)) {
|
||||||
combo->hidePopup();
|
combo->hidePopup();
|
||||||
|
keyEvent->accept();
|
||||||
emit itemSelected(view->currentIndex());
|
emit itemSelected(view->currentIndex());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -734,6 +735,8 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
|
|||||||
Q_FALLTHROUGH();
|
Q_FALLTHROUGH();
|
||||||
case Qt::Key_F4:
|
case Qt::Key_F4:
|
||||||
combo->hidePopup();
|
combo->hidePopup();
|
||||||
|
keyEvent->accept();
|
||||||
|
emit itemSelected(view->currentIndex());
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
#if QT_CONFIG(shortcut)
|
#if QT_CONFIG(shortcut)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user