#11161 Change default tree visibility state for childField and childArrayField

This commit is contained in:
Magne Sjaastad 2024-02-03 15:47:42 +01:00
parent 4c77090d8b
commit 01a082f9fc
3 changed files with 11 additions and 0 deletions

View File

@ -156,6 +156,7 @@ RimSummaryPlot::RimSummaryPlot()
m_asciiDataCurves.uiCapability()->setUiTreeHidden( true );
CAF_PDM_InitFieldNoDefault( &m_axisPropertiesArray, "AxisProperties", "Axes", ":/Axes16x16.png" );
m_axisPropertiesArray.uiCapability()->setUiTreeHidden( false );
auto leftAxis = addNewAxisProperties( RiuPlotAxis::defaultLeft(), "Left" );
leftAxis->setAlwaysRequired( true );

View File

@ -43,6 +43,10 @@ public:
PdmFieldUiCap( FieldType* field, bool giveOwnership )
: PdmUiFieldHandle( field, giveOwnership )
{
// In almost all use cases, we want to hide the visual appearance of the child field.
// The object contained in the child field will be visible in the project tree as a child of the
// parent object.
setUiTreeHidden( true );
}
// Gui generalized interface
@ -66,6 +70,11 @@ public:
PdmFieldUiCap( FieldType* field, bool giveOwnership )
: PdmUiFieldHandle( field, giveOwnership )
{
// In almost all use cases, we want to hide the visual appearance of the child array field.
// They are usually members of a collection object, and this object is usually visible in the project tree
// The objects contained in the child array field will be visible in the project tree as children of the
// collection object
setUiTreeHidden( true );
}
// Gui generalized interface

View File

@ -34,6 +34,7 @@ public:
CAF_PDM_InitObject( "DemoPdmObject", "", "Tooltip DemoPdmObject", "WhatsThis DemoPdmObject" );
CAF_PDM_InitFieldNoDefault( &m_simpleObjPtrField, "SimpleObjPtrField", "SimpleObjPtrField", "", "Tooltip", "WhatsThis" );
m_simpleObjPtrField.uiCapability()->setUiTreeHidden( false );
}
~DemoPdmObject() { m_simpleObjPtrField.deleteChildren(); }