mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Reintroduce "#4308 System : Add virtual function childFieldChangedByUi"
This reverts commit 91022a7535
.
This commit is contained in:
parent
91022a7535
commit
4c46573fc9
@ -58,11 +58,27 @@ void PdmUiFieldHandle::notifyFieldChanged(const QVariant& oldFieldValue, const Q
|
||||
PdmFieldHandle* fieldHandle = this->fieldHandle();
|
||||
CAF_ASSERT(fieldHandle && fieldHandle->ownerObject());
|
||||
|
||||
PdmUiObjectHandle* uiObjHandle = uiObj(fieldHandle->ownerObject());
|
||||
if (uiObjHandle)
|
||||
PdmObjectHandle* ownerObjectHandle = fieldHandle->ownerObject();
|
||||
|
||||
{
|
||||
uiObjHandle->fieldChangedByUi(fieldHandle, oldFieldValue, newFieldValue);
|
||||
uiObjHandle->updateConnectedEditors();
|
||||
PdmUiObjectHandle* uiObjHandle = uiObj(ownerObjectHandle);
|
||||
if (uiObjHandle)
|
||||
{
|
||||
uiObjHandle->fieldChangedByUi(fieldHandle, oldFieldValue, newFieldValue);
|
||||
uiObjHandle->updateConnectedEditors();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (ownerObjectHandle->parentField() && ownerObjectHandle->parentField()->ownerObject())
|
||||
{
|
||||
PdmUiObjectHandle* uiObjHandle = uiObj(ownerObjectHandle->parentField()->ownerObject());
|
||||
if (uiObjHandle)
|
||||
{
|
||||
uiObjHandle->childFieldChangedByUi(ownerObjectHandle->parentField());
|
||||
|
||||
// If updateConnectedEditors() is required, this has to be called in childFieldChangedByUi()
|
||||
}
|
||||
}
|
||||
|
||||
// Update field editors
|
||||
|
@ -58,6 +58,9 @@ public: // Virtual
|
||||
/// Method to reimplement to catch when the field has changed due to setUiValue()
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) {}
|
||||
|
||||
/// Method to reimplement to catch when a field in a contained object has changed due to setUiValue()
|
||||
virtual void childFieldChangedByUi(const caf::PdmFieldHandle* changedChildField) {}
|
||||
|
||||
/// Method to re-implement to supply option values for a specific field
|
||||
virtual QList<caf::PdmOptionItemInfo>
|
||||
calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) { return QList<PdmOptionItemInfo>(); }
|
||||
|
Loading…
Reference in New Issue
Block a user