myIsEditing(false),
myState(Stored),
myIsValueStateBlocked(false),
+ myFlushUpdateBlocked(false),
myWidgetValidator(0)
{
myIsInternal = theData->getBooleanAttribute(ATTR_INTERNAL, false);
}
}
-void ModuleBase_ModelWidget::setFeature(const FeaturePtr& theFeature, const bool theToStoreValue)
+void ModuleBase_ModelWidget::setFeature(const FeaturePtr& theFeature, const bool theToStoreValue,
+ const bool isUpdateFlushed)
{
+ /// it is possible to give this flag as parameter in storeValue/storeCustomValue
+ /// after debug, it may be corrected
+ myFlushUpdateBlocked = !isUpdateFlushed;
myFeature = theFeature;
if (theToStoreValue)
storeValue();
+ myFlushUpdateBlocked = false;
}
bool ModuleBase_ModelWidget::focusTo()
void ModuleBase_ModelWidget::updateObject(ObjectPtr theObject)
{
- ModuleBase_Tools::flushUpdated(theObject);
- emit objectUpdated();
+ if (!myFlushUpdateBlocked) {
+ ModuleBase_Tools::flushUpdated(theObject);
+ emit objectUpdated();
+ }
}
void ModuleBase_ModelWidget::moveObject(ObjectPtr theObj)
/// Set feature which is processing by active operation
/// \param theFeature a feature object
/// \param theToStoreValue a value about necessity to store the widget value to the feature
- void setFeature(const FeaturePtr& theFeature, const bool theToStoreValue = false);
+ /// \param isUpdateFlushed a flag if update should be flushed on store value
+ void setFeature(const FeaturePtr& theFeature, const bool theToStoreValue = false,
+ const bool isUpdateFlushed = true);
/// Editing mode depends on mode of current operation. This value is defined by it.
virtual void setEditingMode(bool isEditing) { myIsEditing = isEditing; }
bool myUseReset;
/// blocked flag of modification of the value state
bool myIsValueStateBlocked;
+ /// do not flush updated signal
+ bool myFlushUpdateBlocked;
};
#endif
return;
}
}
+ // for performance purpose, flush should be done after all controls are filled
+ bool isUpdateFlushed = false;
foreach (ModuleBase_ModelWidget* aWidget, aWidgets) {
bool isStoreValue = !aFOperation->isEditOperation() &&
!aWidget->getDefaultValue().empty() &&
!aWidget->isComputedDefault();
- aWidget->setFeature(aFeature, isStoreValue);
+ aWidget->setFeature(aFeature, isStoreValue, isUpdateFlushed);
aWidget->enableFocusProcessing();
}
+ ModuleBase_Tools::flushUpdated(aFeature);
// update visible state of Preview button
#ifdef HAVE_SALOME