mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-20 11:48:35 -06:00
Fwk: Created a separate update function for uiIconState
This commit is contained in:
parent
6418928bd2
commit
659c90e3e9
@ -113,6 +113,31 @@ void PdmObjectGroup::initAfterReadTraversal(PdmObject* object)
|
||||
}
|
||||
|
||||
object->initAfterRead();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmObjectGroup::updateUiIconStateRecursively(PdmObject* object)
|
||||
{
|
||||
if (object == NULL) return;
|
||||
|
||||
std::vector<PdmFieldHandle*> fields;
|
||||
object->fields(fields);
|
||||
|
||||
std::vector<PdmObject*> children;
|
||||
size_t fIdx;
|
||||
for (fIdx = 0; fIdx < fields.size(); ++fIdx)
|
||||
{
|
||||
if (fields[fIdx]) fields[fIdx]->childObjects(&children);
|
||||
}
|
||||
|
||||
size_t cIdx;
|
||||
for (cIdx = 0; cIdx < children.size(); ++cIdx)
|
||||
{
|
||||
PdmObjectGroup::updateUiIconStateRecursively(children[cIdx]);
|
||||
}
|
||||
|
||||
object->updateUiIconFromToggleField();
|
||||
}
|
||||
|
||||
@ -167,6 +192,7 @@ void PdmDocument::readFile(QIODevice* xmlFile)
|
||||
// after everything is read from file
|
||||
|
||||
PdmDocument::initAfterReadTraversal(this);
|
||||
PdmDocument::updateUiIconStateRecursively(this);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -63,6 +63,7 @@ public:
|
||||
void addObject(PdmObject * obj);
|
||||
|
||||
static void initAfterReadTraversal(PdmObject * root);
|
||||
static void updateUiIconStateRecursively(PdmObject * root);
|
||||
|
||||
template <typename T>
|
||||
void objectsByType(std::vector<PdmPointer<T> >* typedObjects ) const
|
||||
|
Loading…
Reference in New Issue
Block a user