Added new project tree dock widget

This commit is contained in:
Magne Sjaastad 2015-08-04 15:57:58 +02:00
parent c09143e706
commit a88b3cac83
2 changed files with 44 additions and 9 deletions

View File

@ -63,6 +63,7 @@
#include "cafPdmSettings.h" #include "cafPdmSettings.h"
#include "cafPdmUiPropertyView.h" #include "cafPdmUiPropertyView.h"
#include "cafPdmUiPropertyViewDialog.h" #include "cafPdmUiPropertyViewDialog.h"
#include "cafPdmUiTreeView.h"
#include "cvfTimer.h" #include "cvfTimer.h"
#include "RimGeoMechModels.h" #include "RimGeoMechModels.h"
@ -545,8 +546,25 @@ void RiuMainWindow::createToolBars()
void RiuMainWindow::createDockPanels() void RiuMainWindow::createDockPanels()
{ {
{ {
QDockWidget* dockWidget = new QDockWidget("Project Tree", this); QDockWidget* dockWidget = new QDockWidget("NEW Project Tree", this);
dockWidget->setObjectName("dockWidget");
dockWidget->setAllowedAreas(Qt::AllDockWidgetAreas);
m_projectTreeView = new caf::PdmUiTreeView(this);
dockWidget->setWidget(m_projectTreeView);
addDockWidget(Qt::RightDockWidgetArea, dockWidget);
connect(m_projectTreeView->treeView()->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
this, SLOT(selectedObjectsChanged(const QItemSelection&, const QItemSelection &)));
// MODTODO
//m_windowsMenu->addAction(dockWidget->toggleViewAction());
}
{
QDockWidget* dockWidget = new QDockWidget("OBSOLETE Project Tree", this);
dockWidget->setObjectName("dockWidget"); dockWidget->setObjectName("dockWidget");
dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
@ -1247,8 +1265,10 @@ void RiuMainWindow::setPdmRoot(caf::PdmObject* pdmRoot)
if (OBSOLETE_treeItemRoot && m_OBSOLETE_treeView->selectionModel()) if (OBSOLETE_treeItemRoot && m_OBSOLETE_treeView->selectionModel())
{ {
connect(m_OBSOLETE_treeView->selectionModel(), SIGNAL(currentChanged ( const QModelIndex & , const QModelIndex & )), SLOT(slotCurrentChanged( const QModelIndex & , const QModelIndex & ))); connect(m_OBSOLETE_treeView->selectionModel(), SIGNAL(currentChanged ( const QModelIndex & , const QModelIndex & )), SLOT(OBSOLETE_slotCurrentChanged( const QModelIndex & , const QModelIndex & )));
} }
m_projectTreeView->setPdmItem(pdmRoot);
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -1510,7 +1530,7 @@ void RiuMainWindow::slotBuildWindowActions()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuMainWindow::slotCurrentChanged(const QModelIndex & current, const QModelIndex & previous) void RiuMainWindow::OBSOLETE_slotCurrentChanged(const QModelIndex & current, const QModelIndex & previous)
{ {
RimView* activeReservoirView = RiaApplication::instance()->activeReservoirView(); RimView* activeReservoirView = RiaApplication::instance()->activeReservoirView();
QModelIndex activeViewModelIndex = m_OBSOLETE_treeModelPdm->getModelIndexFromPdmObject(activeReservoirView); QModelIndex activeViewModelIndex = m_OBSOLETE_treeModelPdm->getModelIndexFromPdmObject(activeReservoirView);
@ -2169,3 +2189,12 @@ void RiuMainWindow::forceProjectTreeRepaint()
m_OBSOLETE_treeView->scroll(0,1); m_OBSOLETE_treeView->scroll(0,1);
m_OBSOLETE_treeView->scroll(0,-1); m_OBSOLETE_treeView->scroll(0,-1);
} }
void RiuMainWindow::selectedObjectsChanged(const QItemSelection& selected, const QItemSelection & deselected)
{
// MODTODO
// Wire up update of property editor
}

View File

@ -47,12 +47,13 @@ class RimCase;
namespace caf namespace caf
{ {
class AnimationToolBar;
class FrameAnimationControl;
class PdmObject;
class PdmUiPropertyView;
class PdmUiTreeView;
class UiPropertyCreatorPdm; class UiPropertyCreatorPdm;
class UiTreeModelPdm; class UiTreeModelPdm;
class PdmObject;
class FrameAnimationControl;
class AnimationToolBar;
class PdmUiPropertyView;
} }
namespace ssihub namespace ssihub
@ -275,7 +276,10 @@ private slots:
void slotOpenUsersGuideInBrowserAction(); void slotOpenUsersGuideInBrowserAction();
void slotSubWindowActivated(QMdiSubWindow* subWindow); void slotSubWindowActivated(QMdiSubWindow* subWindow);
void slotCurrentChanged(const QModelIndex & current, const QModelIndex & previous); void OBSOLETE_slotCurrentChanged(const QModelIndex & current, const QModelIndex & previous);
void selectedObjectsChanged(const QItemSelection& selected, const QItemSelection & deselected);
// Animation slots // Animation slots
void slotSetCurrentFrame(int frameIndex); void slotSetCurrentFrame(int frameIndex);
@ -288,6 +292,8 @@ private:
RimUiTreeView* m_OBSOLETE_treeView; RimUiTreeView* m_OBSOLETE_treeView;
RimUiTreeModelPdm* m_OBSOLETE_treeModelPdm; RimUiTreeModelPdm* m_OBSOLETE_treeModelPdm;
caf::PdmUiTreeView* m_projectTreeView;
caf::PdmObject* m_pdmRoot; caf::PdmObject* m_pdmRoot;
caf::PdmUiPropertyView* m_pdmUiPropertyView; caf::PdmUiPropertyView* m_pdmUiPropertyView;