From c1ff105a0ccffd7b1e96e6c5070ae857c1b7df4c Mon Sep 17 00:00:00 2001 From: Daniel Teske <daniel.teske@digia.com> Date: Thu, 9 Jan 2014 17:49:00 +0100 Subject: [PATCH] BaseTextEditWidget: Forward everything with ControlModifier to QPTE Task-number: QTCREATORBUG-11137 Change-Id: Icd1bd55cb8bb3087667b01e18b6774987971601b Reviewed-by: Eike Ziller <eike.ziller@digia.com> --- src/plugins/texteditor/basetexteditor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 5bd0792817d..b75ed7afe13 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -1805,7 +1805,8 @@ void BaseTextEditorWidget::keyPressEvent(QKeyEvent *e) return; } - if (ro || e->text().isEmpty() || !e->text().at(0).isPrint()) { + if (ro || e->text().isEmpty() || !e->text().at(0).isPrint() + || (e->modifiers() & (Qt::ControlModifier|Qt::AltModifier)) == Qt::ControlModifier) { if (!cursorMoveKeyEvent(e)) { QTextCursor cursor = textCursor(); bool cursorWithinSnippet = false; @@ -1823,7 +1824,7 @@ void BaseTextEditorWidget::keyPressEvent(QKeyEvent *e) d->m_snippetOverlay->updateEquivalentSelections(textCursor()); } } - } else if ((e->modifiers() & (Qt::ControlModifier|Qt::AltModifier)) != Qt::ControlModifier){ + } else { QTextCursor cursor = textCursor(); QString text = e->text(); const QString &autoText = d->m_autoCompleter->autoComplete(cursor, text); -- GitLab