]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Provide completion on editing
authorvsv <vsv@opencascade.com>
Wed, 4 Jul 2018 17:46:30 +0000 (20:46 +0300)
committervsv <vsv@opencascade.com>
Wed, 4 Jul 2018 17:46:30 +0000 (20:46 +0300)
src/ModuleBase/ModuleBase_ParamSpinBox.cpp

index 349eec6b69a0a08624334d1a9415c45d47d83c28..d0f527331337389f668e0ab172b0af475c65feef 100644 (file)
@@ -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);