Fixed issue related to missing legend config

Must hide legend config collection. Revisit when a more robust tree building strategy is in place.
p4#: 22092
This commit is contained in:
Magne Sjaastad 2013-08-02 13:04:25 +02:00
parent 3bef117e7d
commit 50777b3e3f
2 changed files with 13 additions and 4 deletions

View File

@ -66,11 +66,14 @@ RimResultSlot::~RimResultSlot()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimResultSlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) void RimResultSlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{ {
if (changedField == &m_resultVariable) RimResultDefinition::fieldChangedByUi(changedField, oldValue, newValue);
// Update of legend config must happen after RimResultDefinition::fieldChangedByUi(), as this function modifies this->resultVariable()
if (changedField == &m_resultVariableUiField)
{ {
if (oldValue != newValue) if (oldValue != newValue)
{ {
changeLegendConfig(this->resultVariable()); changeLegendConfig(this->resultVariable());
} }
if (newValue != RimDefines::undefinedResultName()) if (newValue != RimDefines::undefinedResultName())
@ -79,8 +82,6 @@ void RimResultSlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, co
} }
} }
RimResultDefinition::fieldChangedByUi(changedField, oldValue, newValue);
if (m_reservoirView) m_reservoirView->createDisplayModelAndRedraw(); if (m_reservoirView) m_reservoirView->createDisplayModelAndRedraw();
} }

View File

@ -552,6 +552,14 @@ PdmUiTreeItem* UiTreeItemBuilderPdm::buildViewItems(PdmUiTreeItem* parentTreeIte
{ {
caf::PdmFieldHandle* field = *it; caf::PdmFieldHandle* field = *it;
// Fix for hidden legend definitions. There is only one visible legend definition, the others reside in a hidden container
// Todo: This is a Hack. Must be rewritten when a more general ui tree building method is in place.
// See comment at top of this method.
if (field->isUiHidden())
{
continue;
}
std::vector<caf::PdmObject*> children; std::vector<caf::PdmObject*> children;
field->childObjects(&children); field->childObjects(&children);
size_t i; size_t i;