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:
parent
d8e1100548
commit
2b63d0ccf3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user