QList<ModuleBase_ModelWidget*> aWidgets = aFactory.getModelWidgets();
foreach (ModuleBase_ModelWidget* aWidget, aWidgets) {
- aWidget->setFeature(theOperation->feature());
+ bool isStoreValue = !theOperation->isEditOperation() &&
+ aWidget->isValueDefault() && !aWidget->isComputedDefault();
+ aWidget->setFeature(theOperation->feature(), isStoreValue);
aWidget->enableFocusProcessing();
- QObject::connect(aWidget, SIGNAL(valuesChanged()), this, SLOT(onWidgetValuesChanged()));
- // Init default values
- if (!theOperation->isEditOperation() && aWidget->isValueDefault() && !aWidget->isComputedDefault()) {
- aWidget->storeValue();
- }
}
myPropertyPanel->setModelWidgets(aWidgets);
}
}
-//**************************************************************
-void XGUI_Workshop::onWidgetValuesChanged()
-{
- ModuleBase_Operation* anOperation = myOperationMgr->currentOperation();
- FeaturePtr aFeature = anOperation->feature();
-
- ModuleBase_ModelWidget* aSenderWidget = dynamic_cast<ModuleBase_ModelWidget*>(sender());
-
- const QList<ModuleBase_ModelWidget*>& aWidgets = myPropertyPanel->modelWidgets();
- QList<ModuleBase_ModelWidget*>::const_iterator anIt = aWidgets.begin(), aLast = aWidgets.end();
- for (; anIt != aLast; anIt++) {
- ModuleBase_ModelWidget* aCustom = *anIt;
- if (aCustom && (aCustom == aSenderWidget)) {
- aCustom->storeValue();
- }
- }
-}
-
//**************************************************************
void XGUI_Workshop::activatePart(ResultPartPtr theFeature)
{