Editor: fix marking proposal entries as explicitly selected

The flag was set whenever the n or p key was pressed allthough
we only switch the item if also control is pressed.

Change-Id: Ib1b6ab14d1ddf7dee954651382b9b0fc454ddca1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2021-09-02 08:53:18 +02:00
parent 28447355ba
commit 78372726c1

View File

@@ -618,8 +618,8 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
case Qt::Key_N:
case Qt::Key_P:
// select next/previous completion
d->m_explicitlySelected = true;
if (ke->modifiers() == Qt::KeyboardModifiers(HostOsInfo::controlModifier())) {
d->m_explicitlySelected = true;
int change = (ke->key() == Qt::Key_N) ? 1 : -1;
int nrows = d->m_model->size();
int row = d->m_completionListView->currentIndex().row();