From 71092e6e9c3165597ef2b104e351524a1314d968 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 4 Jul 2018 20:46:30 +0300 Subject: [PATCH] Provide completion on editing --- src/ModuleBase/ModuleBase_ParamSpinBox.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp index 349eec6b6..d0f527331 100644 --- a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp +++ b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp @@ -215,10 +215,8 @@ void ModuleBase_ParamSpinBox::showCompletion() int aStart, aEnd; QString aPrefix; aPrefix = getPrefix(aStart, aEnd); - if (aPrefix.length() > 0) { - myCompleter->setCompletionPrefix(aPrefix); - myCompleter->complete(); - } + myCompleter->setCompletionPrefix(aPrefix); + myCompleter->complete(); } void ModuleBase_ParamSpinBox::keyReleaseEvent(QKeyEvent* e) @@ -237,7 +235,11 @@ void ModuleBase_ParamSpinBox::keyReleaseEvent(QKeyEvent* e) } emit textChanged(lineEdit()->text()); break; - default: + case Qt::Key_Space: + if (e->modifiers() & Qt::ControlModifier) { + showCompletion(); + } + break; default: aText = e->text(); if (aText.length() == 1) { QChar aChar = aText.at(0); -- 2.39.2