Project Tree updates (#8490)

Split project tree into multiple dockable tree views for plots, keeping one for 3d views.
This commit is contained in:
jonjenssen
2022-01-28 13:19:52 +01:00
committed by GitHub
parent ffc77516e8
commit 66fd79175c
26 changed files with 436 additions and 304 deletions

View File

@@ -38,6 +38,7 @@
#include "cafPdmObject.h"
#include "cafPdmUiDefaultObjectEditor.h"
#include "cafPdmUiDragDropInterface.h"
#include "cafPdmUiTreeViewEditor.h"
#include <QHBoxLayout>
@@ -228,4 +229,12 @@ void PdmUiTreeView::enableAppendOfClassNameToUiItemText( bool enable )
m_treeViewEditor->enableAppendOfClassNameToUiItemText( enable );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void PdmUiTreeView::treeVisibilityChanged( bool visible )
{
if ( visible ) slotOnSelectionChanged();
}
} // End of namespace caf

View File

@@ -38,6 +38,8 @@
#include <QString>
#include <QWidget>
#include "cafPdmUiDragDropInterface.h"
class QVBoxLayout;
class QTreeView;
class QItemSelection;
@@ -48,7 +50,6 @@ namespace caf
{
class PdmUiItem;
class PdmUiTreeViewEditor;
class PdmUiDragDropInterface;
class PdmObjectHandle;
//==================================================================================================
@@ -90,6 +91,9 @@ signals:
// Convenience signal for use with PdmUiPropertyView
void selectedObjectChanged( caf::PdmObjectHandle* object ); // Signal/Slot system needs caf:: prefix in some cases
public slots:
void treeVisibilityChanged( bool visible );
private slots:
void slotOnSelectionChanged();

View File

@@ -479,6 +479,7 @@ bool PdmUiTreeViewEditor::eventFilter( QObject* obj, QEvent* event )
if ( event->type() == QEvent::FocusIn )
{
this->updateSelectionManager();
emit selectionChanged();
}
// standard event processing
@@ -504,7 +505,7 @@ void PdmUiTreeViewEditor::updateSelectionManager()
void PdmUiTreeViewEditor::updateItemDelegateForSubTree( const QModelIndex& modelIndex /*= QModelIndex()*/ )
{
auto allIndices = m_treeViewModel->allIndicesRecursive();
for ( QModelIndex index : allIndices )
for ( QModelIndex& index : allIndices )
{
m_delegate->clearTags( index );