From 8dde879a1737ac9fb3c1178762af03c31b4c75b9 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 20 Oct 2015 12:32:59 +0300 Subject: [PATCH] There is no key release in the eventFilter() of the operation manager, so the widget should emit the keyReleased() signal. --- src/ModuleBase/ModuleBase_WidgetExprEditor.cpp | 5 +++++ src/ModuleBase/ModuleBase_WidgetExprEditor.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp b/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp index 2d0e841a4..a7e7878e6 100644 --- a/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp +++ b/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp @@ -137,6 +137,7 @@ void ExpressionEditor::keyPressEvent(QKeyEvent* theEvent) switch (theEvent->key()) { case Qt::Key_Enter: case Qt::Key_Return: + emit keyReleased(theEvent); // do not react to the Enter key, the property panel processes it return; break; @@ -252,6 +253,10 @@ ModuleBase_WidgetExprEditor::ModuleBase_WidgetExprEditor( QWidget* theParent, //connect(myEditor, SIGNAL(editingFinished()), this, SLOT(onTextChanged())); connect(myEditor, SIGNAL(valueStored()), this, SLOT(onTextChanged())); connect(myEditor, SIGNAL(focusNextPrev()), this, SIGNAL(focusNextPrev())); + + connect(myEditor, SIGNAL(keyReleased(QKeyEvent*)), this, SIGNAL(keyReleased(QKeyEvent*))); + /// The signal about key release on the control, that corresponds to the attribute + /// \param theEvent key release event } ModuleBase_WidgetExprEditor::~ModuleBase_WidgetExprEditor() diff --git a/src/ModuleBase/ModuleBase_WidgetExprEditor.h b/src/ModuleBase/ModuleBase_WidgetExprEditor.h index 56d91029f..eb2ff9aa1 100644 --- a/src/ModuleBase/ModuleBase_WidgetExprEditor.h +++ b/src/ModuleBase/ModuleBase_WidgetExprEditor.h @@ -70,6 +70,10 @@ signals: void valueStored(); void focusNextPrev(); + /// The signal about key release on the control, that corresponds to the attribute + /// \param theEvent key release event + void keyReleased(QKeyEvent* theEvent); + protected: /// Perform completion by prefix /// \param theCompletionPrefix a prefix for looking for completion -- 2.39.2