From: nds Date: Thu, 8 Oct 2015 09:49:50 +0000 (+0300) Subject: #1041 Sometimes when setting several distance constraints, the first input field... X-Git-Tag: V_1.4.0_demo2~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d85a451997a34f98485daf742556dec047da4633;p=modules%2Fshaper.git #1041 Sometimes when setting several distance constraints, the first input field is inactive XGUI_PropertyPanel::activateNextWidget: the function is not finished yet, only setFocus is called. During this setFocus, the WidgetEditor leads to restart of the distance operation. When the loop returned back to the activateNextWidget, aNextWidget=0(sometimes or trash) and the empty widget is activated(after the distance operation has been already started with existed active first widget). --- diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index 89b9461f5..ab7695723 100644 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -166,23 +166,18 @@ void XGUI_PropertyPanel::activateNextWidget(ModuleBase_ModelWidget* theWidget) activateWidget(NULL); return; } - ModuleBase_ModelWidget* aNextWidget = 0; QList::const_iterator anIt = myWidgets.begin(), aLast = myWidgets.end(); bool isFoundWidget = false; activateWindow(); - for (; anIt != aLast && !aNextWidget; anIt++) { + for (; anIt != aLast; anIt++) { if (isFoundWidget || !theWidget) { if ((*anIt)->focusTo()) { - aNextWidget = *anIt; + return; } } isFoundWidget = (*anIt) == theWidget; } - // Normaly focusTo is enough to activate widget - // here is a special case on mouse click in the viewer - if(aNextWidget == NULL) { - activateWidget(aNextWidget); - } + activateWidget(NULL); } void XGUI_PropertyPanel::activateNextWidget()