From d85a451997a34f98485daf742556dec047da4633 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 8 Oct 2015 12:49:50 +0300 Subject: [PATCH] #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). --- src/XGUI/XGUI_PropertyPanel.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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() -- 2.39.2