mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#9183 Do not use undo/redo for GeoMech result definition
This commit is contained in:
parent
806e7672e4
commit
98df56280e
@ -473,6 +473,20 @@ void RimGeoMechResultDefinition::calculateNormalizationAirGapDefault()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGeoMechResultDefinition::useUndoRedoForFieldChanged()
|
||||
{
|
||||
// Do not use undo/redo, because a state variable is initialized in fieldChanged(), and the undo/redo framework
|
||||
// trigger a call to defineUiOrdering() before fieldChanged causing invalid state in this object.
|
||||
// Having a state variable in fieldChanged/defineUiOrdering is a fragile pattern and should be avoided
|
||||
|
||||
// See CmdFieldChangeExec::redo()
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -98,6 +98,7 @@ private:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
void calculateNormalizationAirGapDefault();
|
||||
bool useUndoRedoForFieldChanged() override;
|
||||
|
||||
void initAfterRead() override;
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
|
Loading…
Reference in New Issue
Block a user