From ea170d1573e3437e55c1b8160ab5e4dd8b15dc0f Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 15 Apr 2015 13:59:48 +0300 Subject: [PATCH] focusInWidget() is necessary for partset module. --- src/ModuleBase/ModuleBase_WidgetEditor.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/ModuleBase/ModuleBase_WidgetEditor.cpp b/src/ModuleBase/ModuleBase_WidgetEditor.cpp index c096d0b46..aa612eb28 100644 --- a/src/ModuleBase/ModuleBase_WidgetEditor.cpp +++ b/src/ModuleBase/ModuleBase_WidgetEditor.cpp @@ -23,7 +23,7 @@ #include #include -#include +//#include #include #include #include @@ -64,16 +64,27 @@ double editedValue(double theValue, bool& isDone) bool ModuleBase_WidgetEditor::focusTo() { + // nds: it seems, that the timer is not necessary anymore + // We can not launch here modal process for value editing because // it can be called on other focusOutWidget event and will block it - QTimer::singleShot(1, this, SLOT(showPopupEditor())); + //QTimer::singleShot(1, this, SLOT(showPopupEditor())); + + showPopupEditor(); + return true; } void ModuleBase_WidgetEditor::showPopupEditor() { + // we need to emit the focus in event manually in order to save the widget as an active + // in the property panel before the mouse leave event happens in the viewer. The module + // ask an active widget and change the feature visualization if the widget is not the current one. + emit focusInWidget(this); + + // nds: it seems, that the envents processing is not necessary anymore // White while all events will be processed - QApplication::processEvents(); + //QApplication::processEvents(); double aValue = mySpinBox->value(); bool isDone; aValue = editedValue(aValue, isDone); -- 2.39.2