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.6 6.5
Change-Id: I069c61c14890577683894f165fd2585ba05c45ff
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Liang Qi <liang.qi@qt.io>
This commit is contained in:
Axel Spoerl 2023-09-28 14:02:57 +02:00
parent d8e1100548
commit 2b63d0ccf3

View File

@ -725,6 +725,7 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
#endif
if (view->currentIndex().isValid() && view->currentIndex().flags().testFlag(Qt::ItemIsEnabled)) {
combo->hidePopup();
keyEvent->accept();
emit itemSelected(view->currentIndex());
}
return true;
@ -734,6 +735,8 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
Q_FALLTHROUGH();
case Qt::Key_F4:
combo->hidePopup();
keyEvent->accept();
emit itemSelected(view->currentIndex());
return true;
default:
#if QT_CONFIG(shortcut)