mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7672 AppFwk : Reroute update of UI node in TreeView
This commit is contained in:
parent
082d6500ad
commit
e04c761752
@ -274,8 +274,22 @@ void PdmUiTreeViewEditor::updateMySubTree( PdmUiItem* uiItem )
|
||||
{
|
||||
if ( m_treeViewModel )
|
||||
{
|
||||
m_treeViewModel->updateSubTree( uiItem );
|
||||
QModelIndex index = m_treeViewModel->findModelIndex( uiItem );
|
||||
PdmUiItem* itemToUpdate = uiItem;
|
||||
|
||||
PdmUiObjectHandle* uiObjectHandle = dynamic_cast<PdmUiObjectHandle*>( uiItem );
|
||||
if ( uiObjectHandle )
|
||||
{
|
||||
PdmUiTreeViewEditorAttribute editorAttributes;
|
||||
QString uiConfigName;
|
||||
uiObjectHandle->objectEditorAttribute( uiConfigName, &editorAttributes );
|
||||
if ( editorAttributes.objectForUpdateOfUiTree )
|
||||
{
|
||||
itemToUpdate = editorAttributes.objectForUpdateOfUiTree->uiCapability();
|
||||
}
|
||||
}
|
||||
|
||||
m_treeViewModel->updateSubTree( itemToUpdate );
|
||||
QModelIndex index = m_treeViewModel->findModelIndex( itemToUpdate );
|
||||
updateItemDelegateForSubTree( index );
|
||||
}
|
||||
}
|
||||
|
@ -169,13 +169,19 @@ private:
|
||||
class PdmUiTreeViewEditorAttribute : public PdmUiEditorAttribute
|
||||
{
|
||||
public:
|
||||
PdmUiTreeViewEditorAttribute() { currentObject = nullptr; }
|
||||
PdmUiTreeViewEditorAttribute()
|
||||
: currentObject( nullptr )
|
||||
, objectForUpdateOfUiTree( nullptr )
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
QStringList columnHeaders;
|
||||
|
||||
/// This object is set as current item in the tree view in configureAndUpdateUi()
|
||||
caf::PdmObjectHandle* currentObject;
|
||||
|
||||
caf::PdmObjectHandle* objectForUpdateOfUiTree;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user