From 5c1b08a05b97bb448b3aadd3e2fdffb975174006 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 10 May 2021 14:01:32 +0200 Subject: [PATCH] #7656 AppFwk : Make it possible to create a custom uiTreeOrdering --- .../cafPdmUiCore/cafPdmUiTreeOrdering.cpp | 6 ++++-- .../cafProjectDataModel/cafPdmUiCore/cafPdmUiTreeOrdering.h | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiTreeOrdering.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiTreeOrdering.cpp index 32a15c9c0f..865bc371df 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiTreeOrdering.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiTreeOrdering.cpp @@ -76,11 +76,13 @@ void PdmUiTreeOrdering::add( PdmFieldHandle* field, QString uiConfigName ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void PdmUiTreeOrdering::add( PdmObjectHandle* object ) +PdmUiTreeOrdering* PdmUiTreeOrdering::add( PdmObjectHandle* object ) { CAF_ASSERT( object ); - new PdmUiTreeOrdering( this, object ); + auto node = new PdmUiTreeOrdering( this, object ); + + return node; } //-------------------------------------------------------------------------------------------------- diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiTreeOrdering.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiTreeOrdering.h index dcda8161c6..a2eb66d944 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiTreeOrdering.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiTreeOrdering.h @@ -69,8 +69,9 @@ public: PdmUiTreeOrdering& operator=( const PdmUiTreeOrdering& ) = delete; void add( PdmFieldHandle* field, QString uiConfigName = "" ); - void add( PdmObjectHandle* object ); + PdmUiTreeOrdering* add( PdmObjectHandle* object ); PdmUiTreeOrdering* add( const QString& title, const QString& iconResourceName ); + void appendChild( PdmUiTreeOrdering* child ); /// If the rest of the fields containing children is supposed to be omitted, set skipRemainingFields to true. void skipRemainingChildren( bool doSkip = true ) { m_forgetRemainingFields = doSkip; } @@ -105,7 +106,6 @@ private: bool ignoreSubTree() const { return m_isToIgnoreSubTree; } bool containsField( const PdmFieldHandle* field ); bool containsObject( const PdmObjectHandle* object ); - void appendChild( PdmUiTreeOrdering* child ); friend class PdmUiTreeViewQModel; PdmUiEditorHandle* editor();