From d3c58237305a47ee633d761511ccdb3e2f7aca93 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 1 Feb 2024 12:55:56 +0100 Subject: [PATCH] #11161 Change default tree visibility state for childField and childArrayField --- .../ProjectDataModel/Summary/RimSummaryPlot.cpp | 1 + .../cafPdmUiCore/cafInternalPdmUiFieldCapability.h | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 9cc76be2f1..b2ba50984c 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -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 ); diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafInternalPdmUiFieldCapability.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafInternalPdmUiFieldCapability.h index 121612c990..451880046f 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafInternalPdmUiFieldCapability.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafInternalPdmUiFieldCapability.h @@ -43,6 +43,10 @@ class PdmFieldUiCap> : public PdmUiFieldHandle 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 @@ class PdmFieldUiCap> : public PdmUiFieldHandle 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