void ModuleBase_ModelWidget::deactivate()
{
myIsValueStateBlocked = false;
- if (myState == ModifiedInPP)
+ if (myState == ModifiedInPP || myState == ModifiedInViewer)
storeValue();
myState = Stored;
}
aReason == Qt::TabFocusReason ||
aReason == Qt::BacktabFocusReason ||
aReason == Qt::OtherFocusReason; // to process widget->setFocus()
- if (aMouseOrKey && getControls().contains(aWidget) && getValueState() == ModifiedInPP)
- storeValue();
+ if (aMouseOrKey && getControls().contains(aWidget)) {
+ if (getValueState() == ModifiedInPP) {
+ storeValue();
+ }
+ }
}
// pass the event on to the parent class
return isDone;
bool isSketchSolverError = module()->sketchMgr()->sketchSolverError();
- if (!isSketchSolverError) {
+
+ // empty previous attribute means that the Apply/Ok button has focus and the enter
+ // should not lead to start edition mode of the previous operation
+ if (!isSketchSolverError && !thePreviousAttributeID.empty()) {
myRestartingMode = RM_EmptyFeatureUsed;
isDone = startInternalEdit(thePreviousAttributeID);
}
activateWidget(NULL);
}
-#define DEBUG_TAB_WIDGETS
+//#define DEBUG_TAB_WIDGETS
#define DEBUG_TAB
#ifdef DEBUG_TAB
// controls, last control, Apply, Cancel, first control, controls
bool isChangedFocus = false;
-#ifdef DEBUG_TAB_WIDGETS
QWidget* aFocusWidget = focusWidget();
+#ifdef DEBUG_TAB_WIDGETS
if (aFocusWidget) {
QString anInfo = QString("focus Widget: %1").arg(aFocusWidget->objectName());
qDebug(anInfo.toStdString().c_str());
}
}
if (aNewFocusWidget) {
+ if (myActiveWidget) {
+ myActiveWidget->getControls();
+ bool isFirstControl = !theIsNext;
+ QWidget* aLastFocusControl = myActiveWidget->getControlAcceptingFocus(isFirstControl);
+ if (aFocusWidget == aLastFocusControl) {
+ this->setActiveWidget(NULL);
+ }
+ }
+
//ModuleBase_Tools::setFocus(aNewFocusWidget, "XGUI_PropertyPanel::focusNextPrevChild()");
aNewFocusWidget->setFocus(theIsNext ? Qt::TabFocusReason : Qt::BacktabFocusReason);
isChangedFocus = true;