From 91022a7535cb4948e65a3051959578b6aff838d2 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 10 Apr 2019 10:57:18 +0200 Subject: [PATCH] Revert "#4308 System : Add virtual function childFieldChangedByUi" This reverts commit fbf9308e2bcead715b0db7a9db7687b89e03b3dd. --- .../cafPdmUiCore/cafPdmUiFieldHandle.cpp | 24 ++++--------------- .../cafPdmUiCore/cafPdmUiObjectHandle.h | 3 --- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiFieldHandle.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiFieldHandle.cpp index ba6f09c866..0cb0e16e0b 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiFieldHandle.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiFieldHandle.cpp @@ -58,27 +58,11 @@ void PdmUiFieldHandle::notifyFieldChanged(const QVariant& oldFieldValue, const Q PdmFieldHandle* fieldHandle = this->fieldHandle(); CAF_ASSERT(fieldHandle && fieldHandle->ownerObject()); - PdmObjectHandle* ownerObjectHandle = fieldHandle->ownerObject(); - + PdmUiObjectHandle* uiObjHandle = uiObj(fieldHandle->ownerObject()); + if (uiObjHandle) { - 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() - } + uiObjHandle->fieldChangedByUi(fieldHandle, oldFieldValue, newFieldValue); + uiObjHandle->updateConnectedEditors(); } // Update field editors diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiObjectHandle.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiObjectHandle.h index c7cc5165fd..7818894f66 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiObjectHandle.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiObjectHandle.h @@ -58,9 +58,6 @@ 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 calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) { return QList(); }