+ if (isComputedDefault()) {
+ if (myFeature->compute(myAttributeID)) {
+ restoreValue();
+ }
+ }
+ else {
+ storeValue();
+ }
+}
+
+QWidget* ModuleBase_ModelWidget::getControlAcceptingFocus(const bool isFirst)
+{
+ QWidget* aControl = 0;
+
+ QList<QWidget*> aControls = getControls();
+ int aSize = aControls.size();
+
+ if (isFirst) {
+ for (int i = 0; i < aSize && !aControl; i++) {
+ if (aControls[i]->focusPolicy() != Qt::NoFocus)
+ aControl = aControls[i];
+ }
+ }
+ else {
+ for (int i = aSize - 1; i >= 0 && !aControl; i--) {
+ if (aControls[i]->focusPolicy() != Qt::NoFocus)
+ aControl = aControls[i];
+ }
+ }
+ return aControl;
+}
+
+void ModuleBase_ModelWidget::setDefaultValue(const std::string& theValue)
+{
+ myDefaultValue = theValue;
+}
+
+bool ModuleBase_ModelWidget::storeValue()
+{
+ setValueState(Stored);
+
+ emit beforeValuesChanged();
+ bool isDone = storeValueCustom();
+ emit afterValuesChanged();
+
+ return isDone;
+}
+
+ModuleBase_ModelWidget::ValueState ModuleBase_ModelWidget::setValueState(const ModuleBase_ModelWidget::ValueState& theState)
+{
+ ValueState aState = myState;
+ if (myState != theState && !myIsValueStateBlocked) {
+ myState = theState;
+ emit valueStateChanged(aState);
+ }
+ return aState;
+}
+
+bool ModuleBase_ModelWidget::blockValueState(const bool theBlocked)
+{
+ bool isBlocked = myIsValueStateBlocked;
+ myIsValueStateBlocked = theBlocked;
+ return isBlocked;
+}
+
+bool ModuleBase_ModelWidget::restoreValue()
+{
+ emit beforeValuesRestored();
+ bool isDone = restoreValueCustom();
+ emit afterValuesRestored();
+
+ return isDone;
+}
+
+void ModuleBase_ModelWidget::updateObject(ObjectPtr theObj)
+{
+ blockUpdateViewer(true);
+