From ad805334736bc18e46c6a8bb73be6913efd7e3f2 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Fri, 26 Aug 2022 18:00:55 +0200 Subject: [PATCH] QComboBox: remove dead keyboard-navigation code The code called setEditFocus, which no longer exists anywhere in Qt. Change-Id: Icd02b8d8b204819188e090e7462309e5c5a5b3d6 Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qcombobox.cpp | 33 +------------------------------ 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 4b5508575a1..b3a2531c18d 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -226,15 +226,6 @@ void QComboBoxPrivate::_q_completerActivated(const QModelIndex &index) } } #endif - -# ifdef QT_KEYPAD_NAVIGATION - if ( QApplicationPrivate::keypadNavigationEnabled() - && q->isEditable() - && q->completer() - && q->completer()->completionMode() == QCompleter::UnfilteredPopupCompletion ) { - q->setEditFocus(false); - } -# endif // QT_KEYPAD_NAVIGATION } #endif // QT_CONFIG(completer) @@ -2568,17 +2559,6 @@ void QComboBox::showPopup() return; #endif // Q_OS_MAC -#ifdef QT_KEYPAD_NAVIGATION -#if QT_CONFIG(completer) - if (QApplicationPrivate::keypadNavigationEnabled() && d->completer) { - // editable combo box is line edit plus completer - setEditFocus(true); - d->completer->complete(); // show popup - return; - } -#endif -#endif - // set current item and select it QItemSelectionModel::SelectionFlags selectionMode = QItemSelectionModel::ClearAndSelect; if (view()->selectionBehavior() == QAbstractItemView::SelectRows) @@ -2783,10 +2763,6 @@ void QComboBox::showPopup() #endif container->update(); -#ifdef QT_KEYPAD_NAVIGATION - if (QApplicationPrivate::keypadNavigationEnabled()) - view()->setEditFocus(true); -#endif if (startTimer) { container->popupTimer.start(); container->maybeIgnoreMouseButtonRelease = true; @@ -2855,11 +2831,6 @@ void QComboBoxPrivate::doHidePopup() if (container && container->isVisible()) container->hide(); -#ifdef QT_KEYPAD_NAVIGATION - if (QApplicationPrivate::keypadNavigationEnabled() && isEditable() && hasFocus()) - setEditFocus(true); -#endif - _q_resetButton(); } @@ -3066,9 +3037,7 @@ bool QComboBox::event(QEvent *event) break; #ifdef QT_KEYPAD_NAVIGATION case QEvent::EnterEditFocus: - if (!d->lineEdit) - setEditFocus(false); // We never want edit focus if we are not editable - else + if (d->lineEdit) d->lineEdit->event(event); //so cursor starts break; case QEvent::LeaveEditFocus: