mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Project Tree updates (#8490)
Split project tree into multiple dockable tree views for plots, keeping one for 3d views.
This commit is contained in:
parent
ffc77516e8
commit
66fd79175c
@ -314,3 +314,11 @@ bool RiaDefines::isInjector( WellProductionType wellProductionType )
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::stringListSeparator()
|
||||
{
|
||||
return "|";
|
||||
}
|
||||
|
@ -185,4 +185,6 @@ enum class WellProductionType : short
|
||||
|
||||
bool isInjector( WellProductionType wellProductionType );
|
||||
|
||||
QString stringListSeparator();
|
||||
|
||||
}; // namespace RiaDefines
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "RiaArgumentParser.h"
|
||||
#include "RiaBaseDefs.h"
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaFilePathTools.h"
|
||||
#include "RiaFontCache.h"
|
||||
#include "RiaImportEclipseCaseTools.h"
|
||||
@ -294,39 +295,46 @@ bool RiaGuiApplication::saveProjectAs( const QString& fileName )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGuiApplication::storeTreeViewState()
|
||||
{
|
||||
if ( m_mainWindow )
|
||||
{
|
||||
if ( mainPlotWindow() && mainPlotWindow()->projectTreeView() )
|
||||
QStringList treeStates;
|
||||
QStringList treeIndexes;
|
||||
|
||||
for ( auto& tv : mainWindow()->projectTreeViews() )
|
||||
{
|
||||
caf::PdmUiTreeView* projectTreeView = mainPlotWindow()->projectTreeView();
|
||||
|
||||
QString treeViewState;
|
||||
caf::QTreeViewStateSerializer::storeTreeViewStateToString( projectTreeView->treeView(), treeViewState );
|
||||
caf::QTreeViewStateSerializer::storeTreeViewStateToString( tv->treeView(), treeViewState );
|
||||
treeStates.append( treeViewState );
|
||||
|
||||
QModelIndex mi = projectTreeView->treeView()->currentIndex();
|
||||
|
||||
QString encodedModelIndexString;
|
||||
QModelIndex mi = tv->treeView()->currentIndex();
|
||||
QString encodedModelIndexString;
|
||||
caf::QTreeViewStateSerializer::encodeStringFromModelIndex( mi, encodedModelIndexString );
|
||||
|
||||
project()->plotWindowTreeViewState = treeViewState;
|
||||
project()->plotWindowCurrentModelIndexPath = encodedModelIndexString;
|
||||
treeIndexes.append( encodedModelIndexString );
|
||||
}
|
||||
|
||||
project()->mainWindowTreeViewStates = treeStates.join( RiaDefines::stringListSeparator() );
|
||||
project()->mainWindowCurrentModelIndexPaths = treeIndexes.join( RiaDefines::stringListSeparator() );
|
||||
}
|
||||
|
||||
if ( m_mainPlotWindow )
|
||||
{
|
||||
caf::PdmUiTreeView* projectTreeView = m_mainWindow->projectTreeView();
|
||||
if ( projectTreeView )
|
||||
QStringList treeStates;
|
||||
QStringList treeIndexes;
|
||||
|
||||
for ( auto& tv : mainPlotWindow()->projectTreeViews() )
|
||||
{
|
||||
QString treeViewState;
|
||||
caf::QTreeViewStateSerializer::storeTreeViewStateToString( projectTreeView->treeView(), treeViewState );
|
||||
caf::QTreeViewStateSerializer::storeTreeViewStateToString( tv->treeView(), treeViewState );
|
||||
treeStates.append( treeViewState );
|
||||
|
||||
QModelIndex mi = projectTreeView->treeView()->currentIndex();
|
||||
|
||||
QString encodedModelIndexString;
|
||||
QModelIndex mi = tv->treeView()->currentIndex();
|
||||
QString encodedModelIndexString;
|
||||
caf::QTreeViewStateSerializer::encodeStringFromModelIndex( mi, encodedModelIndexString );
|
||||
|
||||
project()->mainWindowTreeViewState = treeViewState;
|
||||
project()->mainWindowCurrentModelIndexPath = encodedModelIndexString;
|
||||
treeIndexes.append( encodedModelIndexString );
|
||||
}
|
||||
|
||||
project()->plotWindowTreeViewStates = treeStates.join( RiaDefines::stringListSeparator() );
|
||||
project()->plotWindowCurrentModelIndexPaths = treeIndexes.join( RiaDefines::stringListSeparator() );
|
||||
}
|
||||
}
|
||||
|
||||
@ -1380,13 +1388,19 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences*
|
||||
caf::EffectGenerator::setRenderingMode( caf::EffectGenerator::FIXED_FUNCTION );
|
||||
}
|
||||
|
||||
if ( m_mainWindow && m_mainWindow->projectTreeView() )
|
||||
if ( m_mainWindow )
|
||||
{
|
||||
m_mainWindow->projectTreeView()->enableAppendOfClassNameToUiItemText(
|
||||
RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||
for ( auto& tv : mainWindow()->projectTreeViews() )
|
||||
{
|
||||
tv->enableAppendOfClassNameToUiItemText( RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||
}
|
||||
if ( mainPlotWindow() )
|
||||
mainPlotWindow()->projectTreeView()->enableAppendOfClassNameToUiItemText(
|
||||
RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||
{
|
||||
for ( auto& tv : mainPlotWindow()->projectTreeViews() )
|
||||
{
|
||||
tv->enableAppendOfClassNameToUiItemText( RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto fontObject : defaultFontObjects )
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QModelIndex>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicMoveItemsToTopFeature, "RicMoveItemsToTopFeature" );
|
||||
|
||||
@ -113,17 +114,17 @@ void RicMoveItemsToTopFeature::onActionTriggered( bool isChecked )
|
||||
constSelectedItems.push_back( s );
|
||||
}
|
||||
|
||||
caf::PdmUiTreeView* uiTreeView = RiaGuiApplication::activeMainWindow()->projectTreeView();
|
||||
|
||||
if ( !constSelectedItems.empty() )
|
||||
{
|
||||
caf::PdmUiTreeView* uiTreeView =
|
||||
RiaGuiApplication::activeMainWindow()->getTreeViewWithItem( constSelectedItems[0] );
|
||||
QModelIndex itemIndex = uiTreeView->findModelIndex( constSelectedItems[0] );
|
||||
QModelIndex parentIndex = itemIndex.parent();
|
||||
uiTreeView->updateSubTree( parentIndex );
|
||||
}
|
||||
|
||||
// Restore selection highlight after reordering
|
||||
uiTreeView->selectItems( constSelectedItems );
|
||||
// Restore selection highlight after reordering
|
||||
uiTreeView->selectItems( constSelectedItems );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -158,31 +158,24 @@ void RicToggleItemsFeatureImpl::setObjectToggleStateForSelection( SelectionToggl
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmUiTreeView* RicToggleItemsFeatureImpl::findTreeView( const caf::PdmUiItem* uiItem )
|
||||
{
|
||||
{
|
||||
RiaFeatureCommandContext* context = RiaFeatureCommandContext::instance();
|
||||
RiaFeatureCommandContext* context = RiaFeatureCommandContext::instance();
|
||||
|
||||
caf::PdmUiTreeView* customActiveTreeView = dynamic_cast<caf::PdmUiTreeView*>( context->object() );
|
||||
if ( customActiveTreeView )
|
||||
{
|
||||
return customActiveTreeView;
|
||||
}
|
||||
caf::PdmUiTreeView* customActiveTreeView = dynamic_cast<caf::PdmUiTreeView*>( context->object() );
|
||||
if ( customActiveTreeView )
|
||||
{
|
||||
return customActiveTreeView;
|
||||
}
|
||||
|
||||
{
|
||||
QModelIndex modIndex = RiuMainWindow::instance()->projectTreeView()->findModelIndex( uiItem );
|
||||
if ( modIndex.isValid() )
|
||||
{
|
||||
return RiuMainWindow::instance()->projectTreeView();
|
||||
}
|
||||
}
|
||||
caf::PdmUiTreeView* activeTree = RiuMainWindow::instance()->getTreeViewWithItem( uiItem );
|
||||
if ( activeTree ) return activeTree;
|
||||
|
||||
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
|
||||
if ( mainPlotWindow )
|
||||
{
|
||||
QModelIndex modIndex = mainPlotWindow->projectTreeView()->findModelIndex( uiItem );
|
||||
if ( modIndex.isValid() )
|
||||
activeTree = mainPlotWindow->getTreeViewWithItem( uiItem );
|
||||
if ( activeTree )
|
||||
{
|
||||
return mainPlotWindow->projectTreeView();
|
||||
return activeTree;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,19 +167,18 @@ RimProject::RimProject( void )
|
||||
calculationCollection = new RimSummaryCalculationCollection;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &commandObjects, "CommandObjects", "Command Objects" );
|
||||
// wellPathImport.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &multiSnapshotDefinitions, "MultiSnapshotDefinitions", "Multi Snapshot Definitions" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &mainWindowTreeViewState, "TreeViewState", "" );
|
||||
mainWindowTreeViewState.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &mainWindowCurrentModelIndexPath, "TreeViewCurrentModelIndexPath", "" );
|
||||
mainWindowCurrentModelIndexPath.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &mainWindowTreeViewStates, "TreeViewStates", "" );
|
||||
mainWindowTreeViewStates.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &mainWindowCurrentModelIndexPaths, "TreeViewCurrentModelIndexPaths", "" );
|
||||
mainWindowCurrentModelIndexPaths.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &plotWindowTreeViewState, "PlotWindowTreeViewState", "" );
|
||||
plotWindowTreeViewState.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &plotWindowCurrentModelIndexPath, "PlotWindowTreeViewCurrentModelIndexPath", "" );
|
||||
plotWindowCurrentModelIndexPath.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &plotWindowTreeViewStates, "PlotWindowTreeViewStates", "" );
|
||||
plotWindowTreeViewStates.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &plotWindowCurrentModelIndexPaths, "PlotWindowTreeViewCurrentModelIndexPaths", "" );
|
||||
plotWindowCurrentModelIndexPaths.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitField( &m_show3DWindow, "show3DWindow", true, "Show 3D Window" );
|
||||
m_show3DWindow.uiCapability()->setUiHidden( true );
|
||||
@ -271,10 +270,10 @@ void RimProject::close()
|
||||
|
||||
fileName = "";
|
||||
|
||||
mainWindowCurrentModelIndexPath = "";
|
||||
mainWindowTreeViewState = "";
|
||||
plotWindowCurrentModelIndexPath = "";
|
||||
plotWindowTreeViewState = "";
|
||||
mainWindowCurrentModelIndexPaths = "";
|
||||
mainWindowTreeViewStates = "";
|
||||
plotWindowCurrentModelIndexPaths = "";
|
||||
plotWindowTreeViewStates = "";
|
||||
|
||||
m_nextValidCaseId = 0;
|
||||
m_nextValidCaseGroupId = 0;
|
||||
@ -308,7 +307,6 @@ void RimProject::initAfterRead()
|
||||
if ( analysisModels )
|
||||
{
|
||||
analysisModels->caseGroups.push_back( sourceCaseGroup );
|
||||
// printf("Moved m_project->caseGroupsObsolete[%i] to first oil fields analysis models\n", cgIdx);
|
||||
movedOneRimIdenticalGridCaseGroup = true; // moved at least one so assume the others will be moved too...
|
||||
}
|
||||
}
|
||||
@ -326,7 +324,6 @@ void RimProject::initAfterRead()
|
||||
RimEclipseCase* sourceCase = casesObsolete[cIdx];
|
||||
casesObsolete.set( cIdx, nullptr );
|
||||
analysisModels->cases.push_back( sourceCase );
|
||||
// printf("Moved m_project->casesObsolete[%i] to first oil fields analysis models\n", cIdx);
|
||||
movedOneRimCase = true; // moved at least one so assume the others will be moved too...
|
||||
}
|
||||
}
|
||||
@ -336,13 +333,6 @@ void RimProject::initAfterRead()
|
||||
casesObsolete.clear();
|
||||
}
|
||||
|
||||
if ( casesObsolete().size() > 0 || caseGroupsObsolete.size() > 0 )
|
||||
{
|
||||
// printf("RimProject::initAfterRead: Was not able to move all cases (%i left) or caseGroups (%i left) from
|
||||
// Project to analysisModels",
|
||||
// casesObsolete().size(), caseGroupsObsolete.size());
|
||||
}
|
||||
|
||||
// Set project pointer to each well path
|
||||
for ( size_t oilFieldIdx = 0; oilFieldIdx < oilFields().size(); oilFieldIdx++ )
|
||||
{
|
||||
@ -1387,101 +1377,79 @@ void RimProject::reloadCompletionTypeResultsForEclipseCase( RimEclipseCase* ecli
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
|
||||
{
|
||||
if ( uiConfigName == "PlotWindow" )
|
||||
if ( uiConfigName == "PlotWindow.Plots" )
|
||||
{
|
||||
{
|
||||
auto itemCollection = uiTreeOrdering.add( "Data Sources", ":/Folder.png" );
|
||||
|
||||
RimOilField* oilField = activeOilField();
|
||||
if ( oilField )
|
||||
{
|
||||
if ( oilField->summaryCaseMainCollection() )
|
||||
{
|
||||
itemCollection->add( oilField->summaryCaseMainCollection() );
|
||||
}
|
||||
if ( oilField->observedDataCollection() )
|
||||
{
|
||||
itemCollection->add( oilField->observedDataCollection() );
|
||||
}
|
||||
if ( oilField->ensembleWellLogsCollection() )
|
||||
{
|
||||
itemCollection->add( oilField->ensembleWellLogsCollection() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( mainPlotCollection )
|
||||
{
|
||||
auto itemCollection = uiTreeOrdering.add( "Plots", ":/Folder.png" );
|
||||
if ( mainPlotCollection->summaryPlotCollection() )
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->summaryPlotCollection() );
|
||||
uiTreeOrdering.add( mainPlotCollection->summaryPlotCollection() );
|
||||
}
|
||||
|
||||
if ( mainPlotCollection->analysisPlotCollection() )
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->analysisPlotCollection() );
|
||||
uiTreeOrdering.add( mainPlotCollection->analysisPlotCollection() );
|
||||
}
|
||||
|
||||
if ( mainPlotCollection->correlationPlotCollection() )
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->correlationPlotCollection() );
|
||||
uiTreeOrdering.add( mainPlotCollection->correlationPlotCollection() );
|
||||
}
|
||||
|
||||
if ( mainPlotCollection->summaryCrossPlotCollection() )
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->summaryCrossPlotCollection() );
|
||||
uiTreeOrdering.add( mainPlotCollection->summaryCrossPlotCollection() );
|
||||
}
|
||||
|
||||
if ( mainPlotCollection->wellLogPlotCollection() )
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->wellLogPlotCollection() );
|
||||
uiTreeOrdering.add( mainPlotCollection->wellLogPlotCollection() );
|
||||
}
|
||||
|
||||
if ( mainPlotCollection->rftPlotCollection() )
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->rftPlotCollection() );
|
||||
uiTreeOrdering.add( mainPlotCollection->rftPlotCollection() );
|
||||
}
|
||||
|
||||
if ( mainPlotCollection->pltPlotCollection() )
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->pltPlotCollection() );
|
||||
uiTreeOrdering.add( mainPlotCollection->pltPlotCollection() );
|
||||
}
|
||||
|
||||
if ( mainPlotCollection->flowPlotCollection() )
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->flowPlotCollection() );
|
||||
uiTreeOrdering.add( mainPlotCollection->flowPlotCollection() );
|
||||
}
|
||||
|
||||
if ( mainPlotCollection->gridCrossPlotCollection() )
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->gridCrossPlotCollection() );
|
||||
uiTreeOrdering.add( mainPlotCollection->gridCrossPlotCollection() );
|
||||
}
|
||||
|
||||
if ( mainPlotCollection->saturationPressurePlotCollection() )
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->saturationPressurePlotCollection() );
|
||||
uiTreeOrdering.add( mainPlotCollection->saturationPressurePlotCollection() );
|
||||
}
|
||||
|
||||
if ( mainPlotCollection->multiPlotCollection() )
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->multiPlotCollection() );
|
||||
uiTreeOrdering.add( mainPlotCollection->multiPlotCollection() );
|
||||
}
|
||||
|
||||
if ( mainPlotCollection->stimPlanModelPlotCollection() )
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->stimPlanModelPlotCollection() );
|
||||
uiTreeOrdering.add( mainPlotCollection->stimPlanModelPlotCollection() );
|
||||
}
|
||||
|
||||
if ( mainPlotCollection->vfpPlotCollection() )
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->vfpPlotCollection() );
|
||||
uiTreeOrdering.add( mainPlotCollection->vfpPlotCollection() );
|
||||
}
|
||||
#ifdef USE_QTCHARTS
|
||||
if ( mainPlotCollection->gridStatisticsPlotCollection() ||
|
||||
mainPlotCollection->ensembleFractureStatisticsPlotCollection() )
|
||||
{
|
||||
auto statisticsItemCollection = itemCollection->add( "Statistics Plots", ":/Folder.png" );
|
||||
auto statisticsItemCollection = uiTreeOrdering.add( "Statistics Plots", ":/Folder.png" );
|
||||
if ( mainPlotCollection->gridStatisticsPlotCollection() )
|
||||
statisticsItemCollection->add( mainPlotCollection->gridStatisticsPlotCollection() );
|
||||
|
||||
@ -1490,7 +1458,28 @@ void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, Q
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
else if ( uiConfigName == "PlotWindow.DataSources" )
|
||||
{
|
||||
RimOilField* oilField = activeOilField();
|
||||
if ( oilField )
|
||||
{
|
||||
if ( oilField->summaryCaseMainCollection() )
|
||||
{
|
||||
uiTreeOrdering.add( oilField->summaryCaseMainCollection() );
|
||||
}
|
||||
if ( oilField->observedDataCollection() )
|
||||
{
|
||||
uiTreeOrdering.add( oilField->observedDataCollection() );
|
||||
}
|
||||
if ( oilField->ensembleWellLogsCollection() )
|
||||
{
|
||||
uiTreeOrdering.add( oilField->ensembleWellLogsCollection() );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( uiConfigName == "PlotWindow.Scripts" )
|
||||
{
|
||||
uiTreeOrdering.add( scriptCollection() );
|
||||
}
|
||||
else
|
||||
|
@ -103,11 +103,11 @@ public:
|
||||
|
||||
caf::PdmChildArrayField<RimAdvancedSnapshotExportDefinition*> multiSnapshotDefinitions;
|
||||
|
||||
caf::PdmField<QString> mainWindowTreeViewState;
|
||||
caf::PdmField<QString> mainWindowCurrentModelIndexPath;
|
||||
caf::PdmField<QString> mainWindowTreeViewStates;
|
||||
caf::PdmField<QString> mainWindowCurrentModelIndexPaths;
|
||||
|
||||
caf::PdmField<QString> plotWindowTreeViewState;
|
||||
caf::PdmField<QString> plotWindowCurrentModelIndexPath;
|
||||
caf::PdmField<QString> plotWindowTreeViewStates;
|
||||
caf::PdmField<QString> plotWindowCurrentModelIndexPaths;
|
||||
|
||||
bool writeProjectFile();
|
||||
|
||||
|
@ -111,9 +111,25 @@ QString RiuDockWidgetTools::summaryPlotManagerName()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuDockWidgetTools::plotMainWindowProjectTreeName()
|
||||
QString RiuDockWidgetTools::plotMainWindowDataSourceTreeName()
|
||||
{
|
||||
return "plotMainWindow_dockProjectTree";
|
||||
return "plotMainWindow_dockDataSourceTree";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuDockWidgetTools::plotMainWindowPlotsTreeName()
|
||||
{
|
||||
return "plotMainWindow_dockPlotsTree";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuDockWidgetTools::plotMainWindowScriptsTreeName()
|
||||
{
|
||||
return "plotMainWindow_dockScriptsTree";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -48,7 +48,10 @@ public:
|
||||
static QString undoStackName();
|
||||
static QString summaryPlotManagerName();
|
||||
|
||||
static QString plotMainWindowProjectTreeName();
|
||||
static QString plotMainWindowDataSourceTreeName();
|
||||
static QString plotMainWindowPlotsTreeName();
|
||||
static QString plotMainWindowScriptsTreeName();
|
||||
|
||||
static QString plotMainWindowPropertyEditorName();
|
||||
static QString plotMainWindowMessagesName();
|
||||
static QString plotMainWindowUndoStackName();
|
||||
|
@ -172,9 +172,10 @@ private:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuDragDrop::RiuDragDrop()
|
||||
RiuDragDrop::RiuDragDrop( caf::PdmUiTreeView* treeView )
|
||||
: m_projectTreeView( treeView )
|
||||
, m_proposedDropAction( Qt::MoveAction )
|
||||
{
|
||||
m_proposedDropAction = Qt::MoveAction;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -237,8 +238,7 @@ Qt::ItemFlags RiuDragDrop::flags( const QModelIndex& index ) const
|
||||
|
||||
if ( index.isValid() && RiaGuiApplication::activeMainWindow() )
|
||||
{
|
||||
caf::PdmUiTreeView* uiTreeView = RiaGuiApplication::activeMainWindow()->projectTreeView();
|
||||
caf::PdmUiItem* uiItem = uiTreeView->uiItemFromModelIndex( index );
|
||||
caf::PdmUiItem* uiItem = m_projectTreeView->uiItemFromModelIndex( index );
|
||||
|
||||
caf::PdmObject* pdmObj = dynamic_cast<caf::PdmObject*>( uiItem );
|
||||
if ( pdmObj )
|
||||
@ -361,7 +361,8 @@ Qt::ItemFlags RiuDragDrop::flags( const QModelIndex& index ) const
|
||||
bool RiuDragDrop::dropMimeData( const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& dropTargetIndex )
|
||||
{
|
||||
CVF_ASSERT( RiaGuiApplication::activeMainWindow() );
|
||||
caf::PdmUiTreeView* uiTreeView = RiaGuiApplication::activeMainWindow()->projectTreeView();
|
||||
|
||||
caf::PdmUiTreeView* uiTreeView = m_projectTreeView;
|
||||
caf::PdmUiItem* dropTargetUiItem = uiTreeView->uiItemFromModelIndex( dropTargetIndex );
|
||||
caf::PdmObjectHandle* dropTarget = dynamic_cast<caf::PdmObjectHandle*>( dropTargetUiItem );
|
||||
|
||||
|
@ -47,7 +47,7 @@ class RimWellLogCurve;
|
||||
class RiuDragDrop : public caf::PdmUiDragDropInterface
|
||||
{
|
||||
public:
|
||||
RiuDragDrop();
|
||||
RiuDragDrop( caf::PdmUiTreeView* treeView );
|
||||
~RiuDragDrop() override;
|
||||
|
||||
static std::vector<caf::PdmObjectHandle*> draggedObjectsFromTreeView( caf::PdmUiTreeView* dragSource,
|
||||
@ -107,5 +107,7 @@ private:
|
||||
|
||||
private:
|
||||
mutable std::vector<caf::PdmPointer<caf::PdmObjectHandle>> m_dragItems;
|
||||
Qt::DropAction m_proposedDropAction;
|
||||
|
||||
Qt::DropAction m_proposedDropAction;
|
||||
caf::PdmUiTreeView* m_projectTreeView;
|
||||
};
|
||||
|
@ -48,7 +48,6 @@
|
||||
#include "RimViewWindow.h"
|
||||
|
||||
#include "RiuDockWidgetTools.h"
|
||||
#include "RiuDragDrop.h"
|
||||
#include "RiuMdiSubWindow.h"
|
||||
#include "RiuMessagePanel.h"
|
||||
#include "RiuMohrsCirclePlot.h"
|
||||
@ -70,7 +69,6 @@
|
||||
#include "cafPdmUiPropertyView.h"
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafPdmUiTreeView.h"
|
||||
#include "cafQTreeViewStateSerializer.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
@ -132,8 +130,6 @@ RiuMainWindow::RiuMainWindow()
|
||||
createToolBars();
|
||||
createDockPanels();
|
||||
|
||||
m_dragDropInterface = std::unique_ptr<caf::PdmUiDragDropInterface>( new RiuDragDrop() );
|
||||
|
||||
if ( m_undoView )
|
||||
{
|
||||
m_undoView->setStack( caf::CmdExecCommandManager::instance()->undoStack() );
|
||||
@ -710,36 +706,40 @@ void RiuMainWindow::createToolBars()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::createDockPanels()
|
||||
{
|
||||
const int nTreeViews = 1;
|
||||
|
||||
createTreeViews( nTreeViews );
|
||||
|
||||
{
|
||||
QDockWidget* dockWidget = new QDockWidget( "Project Tree", this );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::projectTreeName() );
|
||||
dockWidget->setAllowedAreas( Qt::AllDockWidgetAreas );
|
||||
|
||||
m_projectTreeView = new caf::PdmUiTreeView( this );
|
||||
m_projectTreeView->enableSelectionManagerUpdating( true );
|
||||
caf::PdmUiTreeView* projectTree = projectTreeView( 0 );
|
||||
projectTree->enableSelectionManagerUpdating( true );
|
||||
|
||||
m_projectTreeView->enableAppendOfClassNameToUiItemText( RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||
projectTree->enableAppendOfClassNameToUiItemText( RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||
|
||||
dockWidget->setWidget( m_projectTreeView );
|
||||
dockWidget->setWidget( projectTree );
|
||||
|
||||
m_projectTreeView->treeView()->setHeaderHidden( true );
|
||||
m_projectTreeView->treeView()->setSelectionMode( QAbstractItemView::ExtendedSelection );
|
||||
projectTree->treeView()->setHeaderHidden( true );
|
||||
projectTree->treeView()->setSelectionMode( QAbstractItemView::ExtendedSelection );
|
||||
|
||||
// Drag and drop configuration
|
||||
m_projectTreeView->treeView()->setDragEnabled( true );
|
||||
m_projectTreeView->treeView()->viewport()->setAcceptDrops( true );
|
||||
m_projectTreeView->treeView()->setDropIndicatorShown( true );
|
||||
m_projectTreeView->treeView()->setDragDropMode( QAbstractItemView::DragDrop );
|
||||
projectTree->treeView()->setDragEnabled( true );
|
||||
projectTree->treeView()->viewport()->setAcceptDrops( true );
|
||||
projectTree->treeView()->setDropIndicatorShown( true );
|
||||
projectTree->treeView()->setDragDropMode( QAbstractItemView::DragDrop );
|
||||
|
||||
// Install event filter used to handle key press events
|
||||
RiuTreeViewEventFilter* treeViewEventFilter = new RiuTreeViewEventFilter( this );
|
||||
m_projectTreeView->treeView()->installEventFilter( treeViewEventFilter );
|
||||
RiuTreeViewEventFilter* treeViewEventFilter = new RiuTreeViewEventFilter( this, projectTree );
|
||||
projectTree->treeView()->installEventFilter( treeViewEventFilter );
|
||||
|
||||
addDockWidget( Qt::LeftDockWidgetArea, dockWidget );
|
||||
|
||||
connect( m_projectTreeView, SIGNAL( selectionChanged() ), this, SLOT( selectedObjectsChanged() ) );
|
||||
m_projectTreeView->treeView()->setContextMenuPolicy( Qt::CustomContextMenu );
|
||||
connect( m_projectTreeView->treeView(),
|
||||
connect( projectTree, SIGNAL( selectionChanged() ), this, SLOT( selectedObjectsChanged() ) );
|
||||
projectTree->treeView()->setContextMenuPolicy( Qt::CustomContextMenu );
|
||||
connect( projectTree->treeView(),
|
||||
SIGNAL( customContextMenuRequested( const QPoint& ) ),
|
||||
SLOT( customMenuRequested( const QPoint& ) ) );
|
||||
}
|
||||
@ -1173,9 +1173,10 @@ void RiuMainWindow::setPdmRoot( caf::PdmObject* pdmRoot )
|
||||
{
|
||||
m_pdmRoot = pdmRoot;
|
||||
|
||||
m_projectTreeView->setPdmItem( pdmRoot );
|
||||
// For debug only : m_projectTreeView->treeView()->expandAll();
|
||||
m_projectTreeView->setDragDropInterface( m_dragDropInterface.get() );
|
||||
for ( auto tv : projectTreeViews() )
|
||||
{
|
||||
tv->setPdmItem( pdmRoot );
|
||||
}
|
||||
|
||||
for ( auto& additionalProjectView : m_additionalProjectViews )
|
||||
{
|
||||
@ -1301,15 +1302,15 @@ void RiuMainWindow::selectViewInProjectTreePreservingSubItemSelection( const Rim
|
||||
|
||||
if ( is3dViewCurrentlySelected && ( previousActiveReservoirView != activatedView ) )
|
||||
{
|
||||
QModelIndex newViewModelIndex = m_projectTreeView->findModelIndex( activatedView );
|
||||
QModelIndex newViewModelIndex = projectTreeView( 0 )->findModelIndex( activatedView );
|
||||
QModelIndex newSelectionIndex = newViewModelIndex;
|
||||
|
||||
if ( previousActiveReservoirView && is3dViewCurrentlySelected )
|
||||
{
|
||||
// Try to select the same entry in the new View, as was selected in the previous
|
||||
|
||||
QModelIndex previousViewModelIndex = m_projectTreeView->findModelIndex( previousActiveReservoirView );
|
||||
QModelIndex currentSelectionIndex = m_projectTreeView->treeView()->selectionModel()->currentIndex();
|
||||
QModelIndex previousViewModelIndex = projectTreeView( 0 )->findModelIndex( previousActiveReservoirView );
|
||||
QModelIndex currentSelectionIndex = projectTreeView( 0 )->treeView()->selectionModel()->currentIndex();
|
||||
|
||||
if ( currentSelectionIndex != newViewModelIndex && currentSelectionIndex.isValid() )
|
||||
{
|
||||
@ -1333,7 +1334,7 @@ void RiuMainWindow::selectViewInProjectTreePreservingSubItemSelection( const Rim
|
||||
if ( newSelectionIndex.isValid() )
|
||||
{
|
||||
newSelectionIndex =
|
||||
m_projectTreeView->treeView()->model()->index( tmp.row(), tmp.column(), newSelectionIndex );
|
||||
projectTreeView( 0 )->treeView()->model()->index( tmp.row(), tmp.column(), newSelectionIndex );
|
||||
}
|
||||
}
|
||||
|
||||
@ -1345,10 +1346,10 @@ void RiuMainWindow::selectViewInProjectTreePreservingSubItemSelection( const Rim
|
||||
}
|
||||
}
|
||||
|
||||
m_projectTreeView->treeView()->setCurrentIndex( newSelectionIndex );
|
||||
projectTreeView( 0 )->treeView()->setCurrentIndex( newSelectionIndex );
|
||||
if ( newSelectionIndex != newViewModelIndex )
|
||||
{
|
||||
m_projectTreeView->treeView()->setExpanded( newViewModelIndex, true );
|
||||
projectTreeView( 0 )->treeView()->setExpanded( newViewModelIndex, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1441,7 +1442,7 @@ void RiuMainWindow::slotBuildWindowActions()
|
||||
void RiuMainWindow::selectedObjectsChanged()
|
||||
{
|
||||
std::vector<caf::PdmUiItem*> uiItems;
|
||||
m_projectTreeView->selectedUiItems( uiItems );
|
||||
projectTreeView( 0 )->selectedUiItems( uiItems );
|
||||
|
||||
caf::PdmObjectHandle* firstSelectedObject = nullptr;
|
||||
if ( !uiItems.empty() )
|
||||
@ -1499,7 +1500,7 @@ void RiuMainWindow::selectedObjectsChanged()
|
||||
// The only way to get to this code is by selection change initiated from the project tree view
|
||||
// As we are activating an MDI-window, the focus is given to this MDI-window
|
||||
// Set focus back to the tree view to be able to continue keyboard tree view navigation
|
||||
m_projectTreeView->treeView()->setFocus();
|
||||
projectTreeView( 0 )->treeView()->setFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1687,24 +1688,8 @@ void RiuMainWindow::slotToggleLightingAction( bool enable )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::restoreTreeViewState()
|
||||
{
|
||||
if ( m_projectTreeView )
|
||||
{
|
||||
QString stateString = RimProject::current()->mainWindowTreeViewState;
|
||||
if ( !stateString.isEmpty() )
|
||||
{
|
||||
m_projectTreeView->treeView()->collapseAll();
|
||||
caf::QTreeViewStateSerializer::applyTreeViewStateFromString( m_projectTreeView->treeView(), stateString );
|
||||
}
|
||||
|
||||
QString currentIndexString = RimProject::current()->mainWindowCurrentModelIndexPath;
|
||||
if ( !currentIndexString.isEmpty() )
|
||||
{
|
||||
QModelIndex mi =
|
||||
caf::QTreeViewStateSerializer::getModelIndexFromString( m_projectTreeView->treeView()->model(),
|
||||
currentIndexString );
|
||||
m_projectTreeView->treeView()->setCurrentIndex( mi );
|
||||
}
|
||||
}
|
||||
restoreTreeViewStates( RimProject::current()->mainWindowTreeViewStates(),
|
||||
RimProject::current()->mainWindowCurrentModelIndexPaths() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1879,7 +1864,7 @@ void RiuMainWindow::slotCreateCommandObject()
|
||||
if ( !app->project() ) return;
|
||||
|
||||
std::vector<caf::PdmUiItem*> selectedUiItems;
|
||||
m_projectTreeView->selectedUiItems( selectedUiItems );
|
||||
projectTreeView( 0 )->selectedUiItems( selectedUiItems );
|
||||
|
||||
caf::PdmObjectGroup selectedObjects;
|
||||
for ( auto* selectedUiItem : selectedUiItems )
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "RiuMdiArea.h"
|
||||
|
||||
#include "cafPdmObjectHandle.h"
|
||||
#include "cafPdmUiDragDropInterface.h"
|
||||
|
||||
#include <QEvent>
|
||||
#include <QLabel>
|
||||
@ -247,8 +246,6 @@ public:
|
||||
void setPdmRoot( caf::PdmObject* pdmRoot );
|
||||
|
||||
private:
|
||||
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;
|
||||
|
||||
caf::PdmObject* m_pdmRoot;
|
||||
caf::PdmUiPropertyView* m_pdmUiPropertyView;
|
||||
|
||||
|
@ -19,25 +19,28 @@
|
||||
#include "RiuMainWindowBase.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaVersionInfo.h"
|
||||
|
||||
#include "RiuDockWidgetTools.h"
|
||||
#include "RiuDragDrop.h"
|
||||
#include "RiuMdiSubWindow.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimViewWindow.h"
|
||||
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmUiTreeView.h"
|
||||
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafQTreeViewStateSerializer.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QDockWidget>
|
||||
#include <QMdiArea>
|
||||
#include <QMdiSubWindow>
|
||||
#include <QSettings>
|
||||
#include <QTreeView>
|
||||
#include <QUndoStack>
|
||||
#include <QUndoView>
|
||||
|
||||
@ -45,8 +48,7 @@
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuMainWindowBase::RiuMainWindowBase()
|
||||
: m_projectTreeView( nullptr )
|
||||
, m_allowActiveViewChangeFromSelection( true )
|
||||
: m_allowActiveViewChangeFromSelection( true )
|
||||
, m_showFirstVisibleWindowMaximized( true )
|
||||
, m_blockSubWindowActivation( false )
|
||||
, m_blockSubWindowProjectTreeSelection( false )
|
||||
@ -238,7 +240,10 @@ QString RiuMainWindowBase::registryFolderName()
|
||||
void RiuMainWindowBase::selectAsCurrentItem( const caf::PdmObject* object, bool allowActiveViewChange )
|
||||
{
|
||||
m_allowActiveViewChangeFromSelection = allowActiveViewChange;
|
||||
m_projectTreeView->selectAsCurrentItem( object );
|
||||
|
||||
auto tv = getTreeViewWithItem( object );
|
||||
if ( tv ) tv->selectAsCurrentItem( object );
|
||||
|
||||
m_allowActiveViewChangeFromSelection = true;
|
||||
}
|
||||
|
||||
@ -247,11 +252,15 @@ void RiuMainWindowBase::selectAsCurrentItem( const caf::PdmObject* object, bool
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindowBase::toggleItemInSelection( const caf::PdmObject* object, bool allowActiveViewChange )
|
||||
{
|
||||
auto tv = getTreeViewWithItem( object );
|
||||
if ( !tv ) return;
|
||||
|
||||
m_allowActiveViewChangeFromSelection = allowActiveViewChange;
|
||||
std::vector<caf::PdmUiItem*> currentSelection;
|
||||
m_projectTreeView->selectedUiItems( currentSelection );
|
||||
tv->selectedUiItems( currentSelection );
|
||||
std::vector<const caf::PdmUiItem*> updatedSelection;
|
||||
bool alreadySelected = false;
|
||||
|
||||
bool alreadySelected = false;
|
||||
for ( caf::PdmUiItem* uiItem : currentSelection )
|
||||
{
|
||||
if ( object == uiItem )
|
||||
@ -267,7 +276,7 @@ void RiuMainWindowBase::toggleItemInSelection( const caf::PdmObject* object, boo
|
||||
{
|
||||
updatedSelection.push_back( object );
|
||||
}
|
||||
m_projectTreeView->selectItems( updatedSelection );
|
||||
tv->selectItems( updatedSelection );
|
||||
m_allowActiveViewChangeFromSelection = true;
|
||||
}
|
||||
|
||||
@ -364,7 +373,8 @@ void RiuMainWindowBase::removeViewerFromMdiArea( QMdiArea* mdiArea, QWidget* vie
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindowBase::setExpanded( const caf::PdmUiItem* uiItem, bool expanded )
|
||||
{
|
||||
m_projectTreeView->setExpanded( uiItem, expanded );
|
||||
caf::PdmUiTreeView* tv = getTreeViewWithItem( uiItem );
|
||||
if ( tv ) tv->setExpanded( uiItem, expanded );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -470,3 +480,88 @@ void RiuMainWindowBase::slotRefreshUndoRedoActions()
|
||||
m_redoAction->setDisabled( !m_undoView->stack()->canRedo() );
|
||||
m_undoAction->setDisabled( !m_undoView->stack()->canUndo() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindowBase::createTreeViews( int numberOfTrees )
|
||||
{
|
||||
CVF_ASSERT( m_projectTreeViews.empty() );
|
||||
|
||||
for ( int i = 0; i < numberOfTrees; i++ )
|
||||
{
|
||||
auto tv = new caf::PdmUiTreeView();
|
||||
caf::PdmUiDragDropInterface* dragDropInterface = new RiuDragDrop( tv );
|
||||
tv->setDragDropInterface( dragDropInterface );
|
||||
m_projectTreeViews.push_back( tv );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmUiTreeView* RiuMainWindowBase::projectTreeView( int treeId )
|
||||
{
|
||||
CVF_ASSERT( treeId >= 0 );
|
||||
CVF_ASSERT( treeId < (int)m_projectTreeViews.size() );
|
||||
|
||||
return m_projectTreeViews[treeId];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmUiTreeView* RiuMainWindowBase::getTreeViewWithItem( const caf::PdmUiItem* uiItem )
|
||||
{
|
||||
for ( auto tv : m_projectTreeViews )
|
||||
{
|
||||
QModelIndex qmi = tv->findModelIndex( uiItem );
|
||||
if ( qmi.isValid() )
|
||||
{
|
||||
return tv;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<caf::PdmUiTreeView*> RiuMainWindowBase::projectTreeViews()
|
||||
{
|
||||
return m_projectTreeViews;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindowBase::restoreTreeViewStates( QString treeStateString, QString treeIndexeString )
|
||||
{
|
||||
QStringList treeStates = treeStateString.split( RiaDefines::stringListSeparator() );
|
||||
QStringList treeIndexes = treeIndexeString.split( RiaDefines::stringListSeparator() );
|
||||
|
||||
const int nTreeViews = (int)projectTreeViews().size();
|
||||
|
||||
if ( treeStates.size() < nTreeViews ) return;
|
||||
if ( treeIndexes.size() < nTreeViews ) return;
|
||||
|
||||
for ( int treeId = 0; treeId < nTreeViews; treeId++ )
|
||||
{
|
||||
auto tv = projectTreeView( treeId );
|
||||
|
||||
QString stateString = treeStates[treeId];
|
||||
if ( !stateString.isEmpty() )
|
||||
{
|
||||
tv->treeView()->collapseAll();
|
||||
caf::QTreeViewStateSerializer::applyTreeViewStateFromString( tv->treeView(), stateString );
|
||||
}
|
||||
|
||||
QString currentIndexString = treeIndexes[treeId];
|
||||
if ( !currentIndexString.isEmpty() )
|
||||
{
|
||||
QModelIndex mi =
|
||||
caf::QTreeViewStateSerializer::getModelIndexFromString( tv->treeView()->model(), currentIndexString );
|
||||
tv->treeView()->setCurrentIndex( mi );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,11 @@
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
#include "cafPdmUiDragDropInterface.h"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class QMdiArea;
|
||||
struct RimMdiWindowGeometry;
|
||||
|
||||
@ -65,8 +70,11 @@ public:
|
||||
|
||||
void hideAllDockWidgets();
|
||||
|
||||
caf::PdmUiTreeView* projectTreeView() { return m_projectTreeView; }
|
||||
void setExpanded( const caf::PdmUiItem* uiItem, bool expanded = true );
|
||||
std::vector<caf::PdmUiTreeView*> projectTreeViews();
|
||||
caf::PdmUiTreeView* projectTreeView( int treeId );
|
||||
caf::PdmUiTreeView* getTreeViewWithItem( const caf::PdmUiItem* item );
|
||||
|
||||
void setExpanded( const caf::PdmUiItem* uiItem, bool expanded = true );
|
||||
|
||||
void selectAsCurrentItem( const caf::PdmObject* object, bool allowActiveViewChange = true );
|
||||
void toggleItemInSelection( const caf::PdmObject* object, bool allowActiveViewChange = true );
|
||||
@ -85,12 +93,15 @@ public:
|
||||
bool isBlockingViewSelectionOnSubWindowActivated() const;
|
||||
|
||||
protected:
|
||||
void createTreeViews( int numberOfTrees );
|
||||
void removeViewerFromMdiArea( QMdiArea* mdiArea, QWidget* viewer );
|
||||
void initializeSubWindow( QMdiArea* mdiArea,
|
||||
QMdiSubWindow* mdiSubWindow,
|
||||
const QPoint& subWindowPos,
|
||||
const QSize& subWindowSize );
|
||||
|
||||
void restoreTreeViewStates( QString treeStateString, QString treeIndexString );
|
||||
|
||||
protected slots:
|
||||
void slotDockWidgetToggleViewActionTriggered();
|
||||
void slotRefreshHelpActions();
|
||||
@ -100,8 +111,7 @@ protected slots:
|
||||
void slotRefreshUndoRedoActions();
|
||||
|
||||
protected:
|
||||
caf::PdmUiTreeView* m_projectTreeView;
|
||||
bool m_allowActiveViewChangeFromSelection; // To be used in selectedObjectsChanged() to control
|
||||
bool m_allowActiveViewChangeFromSelection; // To be used in selectedObjectsChanged() to control
|
||||
// whether to select the corresponding active view or not
|
||||
|
||||
QAction* m_undoAction;
|
||||
@ -112,6 +122,9 @@ private:
|
||||
QString registryFolderName();
|
||||
|
||||
private:
|
||||
std::vector<caf::PdmUiTreeView*> m_projectTreeViews;
|
||||
std::vector<std::unique_ptr<caf::PdmUiDragDropInterface>> m_dragDropInterfaces;
|
||||
|
||||
bool m_showFirstVisibleWindowMaximized;
|
||||
bool m_blockSubWindowActivation;
|
||||
bool m_blockSubWindowProjectTreeSelection;
|
||||
|
@ -37,6 +37,7 @@
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QMdiSubWindow>
|
||||
#include <QModelIndex>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -47,49 +48,38 @@ void RiuMainWindowTools::collapseSiblings( const caf::PdmUiItem* sourceUiItem )
|
||||
|
||||
if ( !RiaGuiApplication::isRunning() ) return;
|
||||
|
||||
caf::PdmUiTreeView* sourceTreeView = nullptr;
|
||||
|
||||
if ( RiuMainWindow::instance() )
|
||||
{
|
||||
caf::PdmUiTreeView* sourceTreeView = nullptr;
|
||||
caf::PdmUiTreeOrdering* sourceTreeOrderingItem = nullptr;
|
||||
|
||||
sourceTreeView = RiuMainWindow::instance()->getTreeViewWithItem( sourceUiItem );
|
||||
}
|
||||
if ( !sourceTreeView )
|
||||
{
|
||||
RiuPlotMainWindow* mpw = RiaGuiApplication::instance()->mainPlotWindow();
|
||||
if ( mpw )
|
||||
{
|
||||
QModelIndex modIndex;
|
||||
|
||||
if ( RiuMainWindow::instance() )
|
||||
{
|
||||
modIndex = RiuMainWindow::instance()->projectTreeView()->findModelIndex( sourceUiItem );
|
||||
}
|
||||
|
||||
if ( modIndex.isValid() )
|
||||
{
|
||||
sourceTreeView = RiuMainWindow::instance()->projectTreeView();
|
||||
}
|
||||
else
|
||||
{
|
||||
RiuPlotMainWindow* mpw = RiaGuiApplication::instance()->mainPlotWindow();
|
||||
if ( mpw )
|
||||
{
|
||||
modIndex = mpw->projectTreeView()->findModelIndex( sourceUiItem );
|
||||
if ( modIndex.isValid() )
|
||||
{
|
||||
sourceTreeView = mpw->projectTreeView();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !modIndex.isValid() ) return;
|
||||
|
||||
sourceTreeOrderingItem = static_cast<caf::PdmUiTreeOrdering*>( modIndex.internalPointer() );
|
||||
sourceTreeView = mpw->getTreeViewWithItem( sourceUiItem );
|
||||
}
|
||||
}
|
||||
|
||||
if ( sourceTreeView && sourceTreeOrderingItem && sourceTreeOrderingItem->parent() )
|
||||
if ( !sourceTreeView ) return;
|
||||
|
||||
caf::PdmUiTreeOrdering* sourceTreeOrderingItem = nullptr;
|
||||
QModelIndex modIndex = sourceTreeView->findModelIndex( sourceUiItem );
|
||||
|
||||
if ( !modIndex.isValid() ) return;
|
||||
|
||||
sourceTreeOrderingItem = static_cast<caf::PdmUiTreeOrdering*>( modIndex.internalPointer() );
|
||||
|
||||
if ( sourceTreeOrderingItem && sourceTreeOrderingItem->parent() )
|
||||
{
|
||||
for ( int i = 0; i < sourceTreeOrderingItem->parent()->childCount(); i++ )
|
||||
{
|
||||
for ( int i = 0; i < sourceTreeOrderingItem->parent()->childCount(); i++ )
|
||||
auto siblingTreeOrderingItem = sourceTreeOrderingItem->parent()->child( i );
|
||||
if ( siblingTreeOrderingItem != sourceTreeOrderingItem )
|
||||
{
|
||||
auto siblingTreeOrderingItem = sourceTreeOrderingItem->parent()->child( i );
|
||||
if ( siblingTreeOrderingItem != sourceTreeOrderingItem )
|
||||
{
|
||||
sourceTreeView->setExpanded( siblingTreeOrderingItem->activeItem(), false );
|
||||
}
|
||||
sourceTreeView->setExpanded( siblingTreeOrderingItem->activeItem(), false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,6 @@
|
||||
#include "SummaryPlotCommands/RicSummaryPlotEditorDialog.h"
|
||||
|
||||
#include "RiuDockWidgetTools.h"
|
||||
#include "RiuDragDrop.h"
|
||||
#include "RiuMdiSubWindow.h"
|
||||
#include "RiuMessagePanel.h"
|
||||
#include "RiuMultiPlotPage.h"
|
||||
@ -59,7 +58,6 @@
|
||||
#include "cafPdmUiPropertyView.h"
|
||||
#include "cafPdmUiToolBarEditor.h"
|
||||
#include "cafPdmUiTreeView.h"
|
||||
#include "cafQTreeViewStateSerializer.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
@ -90,8 +88,6 @@ RiuPlotMainWindow::RiuPlotMainWindow()
|
||||
// Store the layout so we can offer reset option
|
||||
m_initialDockAndToolbarLayout = saveState( 0 );
|
||||
|
||||
m_dragDropInterface = std::unique_ptr<caf::PdmUiDragDropInterface>( new RiuDragDrop() );
|
||||
|
||||
if ( m_undoView )
|
||||
{
|
||||
m_undoView->setStack( caf::CmdExecCommandManager::instance()->undoStack() );
|
||||
@ -455,40 +451,64 @@ void RiuPlotMainWindow::refreshToolbars()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotMainWindow::createDockPanels()
|
||||
{
|
||||
const int nTreeViews = 3;
|
||||
const std::vector<QString> treeViewTitles = { "Plots", "Data Sources", "Scripts" };
|
||||
const std::vector<QString> treeViewConfigs = { "PlotWindow.Plots", "PlotWindow.DataSources", "PlotWindow.Scripts" };
|
||||
const std::vector<QString> treeViewDockNames = { RiuDockWidgetTools::plotMainWindowPlotsTreeName(),
|
||||
RiuDockWidgetTools::plotMainWindowDataSourceTreeName(),
|
||||
RiuDockWidgetTools::plotMainWindowScriptsTreeName() };
|
||||
|
||||
createTreeViews( nTreeViews );
|
||||
|
||||
QDockWidget* dockOntopOfWidget = nullptr;
|
||||
|
||||
for ( int i = 0; i < nTreeViews; i++ )
|
||||
{
|
||||
QDockWidget* dockWidget = new QDockWidget( "Plot Project Tree", this );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::plotMainWindowProjectTreeName() );
|
||||
QDockWidget* dockWidget = new QDockWidget( treeViewTitles[i], this );
|
||||
dockWidget->setObjectName( treeViewDockNames[i] );
|
||||
dockWidget->setAllowedAreas( Qt::AllDockWidgetAreas );
|
||||
|
||||
m_projectTreeView = new caf::PdmUiTreeView( this );
|
||||
m_projectTreeView->enableSelectionManagerUpdating( true );
|
||||
caf::PdmUiTreeView* projectTree = projectTreeView( i );
|
||||
projectTree->enableSelectionManagerUpdating( true );
|
||||
|
||||
m_projectTreeView->enableAppendOfClassNameToUiItemText( RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||
projectTree->enableAppendOfClassNameToUiItemText( RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||
|
||||
dockWidget->setWidget( m_projectTreeView );
|
||||
dockWidget->setWidget( projectTree );
|
||||
|
||||
m_projectTreeView->treeView()->setHeaderHidden( true );
|
||||
m_projectTreeView->treeView()->setSelectionMode( QAbstractItemView::ExtendedSelection );
|
||||
projectTree->treeView()->setHeaderHidden( true );
|
||||
projectTree->treeView()->setSelectionMode( QAbstractItemView::ExtendedSelection );
|
||||
|
||||
// Drag and drop configuration
|
||||
m_projectTreeView->treeView()->setDragEnabled( true );
|
||||
m_projectTreeView->treeView()->viewport()->setAcceptDrops( true );
|
||||
m_projectTreeView->treeView()->setDropIndicatorShown( true );
|
||||
m_projectTreeView->treeView()->setDragDropMode( QAbstractItemView::DragDrop );
|
||||
projectTree->treeView()->setDragEnabled( true );
|
||||
projectTree->treeView()->viewport()->setAcceptDrops( true );
|
||||
projectTree->treeView()->setDropIndicatorShown( true );
|
||||
projectTree->treeView()->setDragDropMode( QAbstractItemView::DragDrop );
|
||||
|
||||
// Install event filter used to handle key press events
|
||||
RiuTreeViewEventFilter* treeViewEventFilter = new RiuTreeViewEventFilter( this );
|
||||
m_projectTreeView->treeView()->installEventFilter( treeViewEventFilter );
|
||||
RiuTreeViewEventFilter* treeViewEventFilter = new RiuTreeViewEventFilter( this, projectTree );
|
||||
projectTree->treeView()->installEventFilter( treeViewEventFilter );
|
||||
|
||||
addDockWidget( Qt::LeftDockWidgetArea, dockWidget );
|
||||
|
||||
connect( m_projectTreeView, SIGNAL( selectionChanged() ), this, SLOT( selectedObjectsChanged() ) );
|
||||
m_projectTreeView->treeView()->setContextMenuPolicy( Qt::CustomContextMenu );
|
||||
connect( m_projectTreeView->treeView(),
|
||||
if ( dockOntopOfWidget )
|
||||
{
|
||||
tabifyDockWidget( dockOntopOfWidget, dockWidget );
|
||||
}
|
||||
else
|
||||
{
|
||||
dockOntopOfWidget = dockWidget;
|
||||
}
|
||||
|
||||
connect( dockWidget, SIGNAL( visibilityChanged( bool ) ), projectTree, SLOT( treeVisibilityChanged( bool ) ) );
|
||||
|
||||
connect( projectTree, SIGNAL( selectionChanged() ), this, SLOT( selectedObjectsChanged() ) );
|
||||
|
||||
projectTree->treeView()->setContextMenuPolicy( Qt::CustomContextMenu );
|
||||
connect( projectTree->treeView(),
|
||||
SIGNAL( customContextMenuRequested( const QPoint& ) ),
|
||||
SLOT( customMenuRequested( const QPoint& ) ) );
|
||||
|
||||
m_projectTreeView->setUiConfigurationName( "PlotWindow" );
|
||||
projectTree->setUiConfigurationName( treeViewConfigs[i] );
|
||||
}
|
||||
|
||||
{
|
||||
@ -813,13 +833,14 @@ void RiuPlotMainWindow::initializeViewer( QMdiSubWindow* subWindow, QWidget* vie
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// This method needs to handle memory deallocation !!!
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotMainWindow::setPdmRoot( caf::PdmObject* pdmRoot )
|
||||
{
|
||||
m_projectTreeView->setPdmItem( pdmRoot );
|
||||
// For debug only : m_projectTreeView->treeView()->expandAll();
|
||||
m_projectTreeView->setDragDropInterface( m_dragDropInterface.get() );
|
||||
for ( auto tv : projectTreeViews() )
|
||||
{
|
||||
tv->setPdmItem( pdmRoot );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -836,28 +857,32 @@ void RiuPlotMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
|
||||
|
||||
if ( !isBlockingViewSelectionOnSubWindowActivated() )
|
||||
{
|
||||
std::vector<caf::PdmUiItem*> currentSelection;
|
||||
m_projectTreeView->selectedUiItems( currentSelection );
|
||||
bool childSelected = false;
|
||||
for ( caf::PdmUiItem* uiItem : currentSelection )
|
||||
caf::PdmUiTreeView* projectTree = getTreeViewWithItem( activatedView );
|
||||
if ( projectTree )
|
||||
{
|
||||
caf::PdmObject* pdmObject = dynamic_cast<caf::PdmObject*>( uiItem );
|
||||
if ( pdmObject )
|
||||
std::vector<caf::PdmUiItem*> currentSelection;
|
||||
projectTree->selectedUiItems( currentSelection );
|
||||
bool childSelected = false;
|
||||
for ( caf::PdmUiItem* uiItem : currentSelection )
|
||||
{
|
||||
std::vector<RimViewWindow*> ancestralViews;
|
||||
pdmObject->allAncestorsOrThisOfType( ancestralViews );
|
||||
for ( auto ancestralView : ancestralViews )
|
||||
caf::PdmObject* pdmObject = dynamic_cast<caf::PdmObject*>( uiItem );
|
||||
if ( pdmObject )
|
||||
{
|
||||
if ( ancestralView == activatedView )
|
||||
std::vector<RimViewWindow*> ancestralViews;
|
||||
pdmObject->allAncestorsOrThisOfType( ancestralViews );
|
||||
for ( auto ancestralView : ancestralViews )
|
||||
{
|
||||
childSelected = true;
|
||||
if ( ancestralView == activatedView )
|
||||
{
|
||||
childSelected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( !childSelected )
|
||||
{
|
||||
selectAsCurrentItem( activatedView );
|
||||
if ( !childSelected )
|
||||
{
|
||||
selectAsCurrentItem( activatedView );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -911,8 +936,11 @@ void RiuPlotMainWindow::slotBuildWindowActions()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotMainWindow::selectedObjectsChanged()
|
||||
{
|
||||
caf::PdmUiTreeView* projectTree = dynamic_cast<caf::PdmUiTreeView*>( sender() );
|
||||
if ( !projectTree ) return;
|
||||
|
||||
std::vector<caf::PdmUiItem*> uiItems;
|
||||
m_projectTreeView->selectedUiItems( uiItems );
|
||||
projectTree->selectedUiItems( uiItems );
|
||||
|
||||
caf::PdmObjectHandle* firstSelectedObject = nullptr;
|
||||
if ( !uiItems.empty() )
|
||||
@ -974,7 +1002,8 @@ void RiuPlotMainWindow::selectedObjectsChanged()
|
||||
// The only way to get to this code is by selection change initiated from the project tree view
|
||||
// As we are activating an MDI-window, the focus is given to this MDI-window
|
||||
// Set focus back to the tree view to be able to continue keyboard tree view navigation
|
||||
m_projectTreeView->treeView()->setFocus();
|
||||
projectTree->raise();
|
||||
projectTree->treeView()->setFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -984,24 +1013,8 @@ void RiuPlotMainWindow::selectedObjectsChanged()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotMainWindow::restoreTreeViewState()
|
||||
{
|
||||
if ( m_projectTreeView )
|
||||
{
|
||||
QString stateString = RimProject::current()->plotWindowTreeViewState;
|
||||
if ( !stateString.isEmpty() )
|
||||
{
|
||||
m_projectTreeView->treeView()->collapseAll();
|
||||
caf::QTreeViewStateSerializer::applyTreeViewStateFromString( m_projectTreeView->treeView(), stateString );
|
||||
}
|
||||
|
||||
QString currentIndexString = RimProject::current()->plotWindowCurrentModelIndexPath;
|
||||
if ( !currentIndexString.isEmpty() )
|
||||
{
|
||||
QModelIndex mi =
|
||||
caf::QTreeViewStateSerializer::getModelIndexFromString( m_projectTreeView->treeView()->model(),
|
||||
currentIndexString );
|
||||
m_projectTreeView->treeView()->setCurrentIndex( mi );
|
||||
}
|
||||
}
|
||||
restoreTreeViewStates( RimProject::current()->plotWindowTreeViewStates(),
|
||||
RimProject::current()->plotWindowCurrentModelIndexPaths() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "RiuMdiArea.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
#include "cafPdmUiDragDropInterface.h"
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
@ -133,10 +132,9 @@ private:
|
||||
|
||||
QMenu* m_windowMenu;
|
||||
|
||||
caf::PdmUiToolBarEditor* m_wellLogPlotToolBarEditor;
|
||||
caf::PdmUiToolBarEditor* m_multiPlotToolBarEditor;
|
||||
caf::PdmUiToolBarEditor* m_summaryPlotToolBarEditor;
|
||||
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;
|
||||
caf::PdmUiToolBarEditor* m_wellLogPlotToolBarEditor;
|
||||
caf::PdmUiToolBarEditor* m_multiPlotToolBarEditor;
|
||||
caf::PdmUiToolBarEditor* m_summaryPlotToolBarEditor;
|
||||
|
||||
caf::PdmUiPropertyView* m_pdmUiPropertyView;
|
||||
caf::PdmUiPropertyView* m_summaryPlotManagerView;
|
||||
|
@ -43,7 +43,7 @@ RiuProjectAndPropertyView::RiuProjectAndPropertyView( QWidget* parent, Qt::Windo
|
||||
m_projectTreeView->enableSelectionManagerUpdating( true );
|
||||
|
||||
// Install event filter used to handle key press events
|
||||
RiuTreeViewEventFilter* treeViewEventFilter = new RiuTreeViewEventFilter( this );
|
||||
RiuTreeViewEventFilter* treeViewEventFilter = new RiuTreeViewEventFilter( this, m_projectTreeView );
|
||||
m_projectTreeView->treeView()->installEventFilter( treeViewEventFilter );
|
||||
|
||||
// Drag and drop configuration
|
||||
|
@ -44,8 +44,9 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuTreeViewEventFilter::RiuTreeViewEventFilter( QObject* parent )
|
||||
RiuTreeViewEventFilter::RiuTreeViewEventFilter( QObject* parent, caf::PdmUiTreeView* treeView )
|
||||
: QObject( parent )
|
||||
, m_projectTreeView( treeView )
|
||||
{
|
||||
}
|
||||
|
||||
@ -141,14 +142,7 @@ bool RiuTreeViewEventFilter::eventFilter( QObject* obj, QEvent* event )
|
||||
|
||||
// Do not toggle state if currently editing a name in the tree view
|
||||
bool toggleStateForSelection = true;
|
||||
if ( RiuMainWindow::instance()->projectTreeView() &&
|
||||
RiuMainWindow::instance()->projectTreeView()->isTreeItemEditWidgetActive() )
|
||||
{
|
||||
toggleStateForSelection = false;
|
||||
}
|
||||
else if ( RiaGuiApplication::instance()->mainPlotWindow() &&
|
||||
RiaGuiApplication::instance()->mainPlotWindow()->projectTreeView() &&
|
||||
RiaGuiApplication::instance()->mainPlotWindow()->projectTreeView()->isTreeItemEditWidgetActive() )
|
||||
if ( m_projectTreeView && m_projectTreeView->isTreeItemEditWidgetActive() )
|
||||
{
|
||||
toggleStateForSelection = false;
|
||||
}
|
||||
|
@ -29,18 +29,22 @@ class QKeyEvent;
|
||||
namespace caf
|
||||
{
|
||||
class CmdFeature;
|
||||
}
|
||||
class PdmUiTreeView;
|
||||
} // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RiuTreeViewEventFilter : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit RiuTreeViewEventFilter( QObject* parent );
|
||||
explicit RiuTreeViewEventFilter( QObject* parent, caf::PdmUiTreeView* treeView );
|
||||
|
||||
static bool activateFeatureFromKeyEvent( QKeyEvent* keyEvent );
|
||||
static bool activateFirstEnabledFeature( const std::vector<caf::CmdFeature*>& features );
|
||||
|
||||
protected:
|
||||
bool eventFilter( QObject* obj, QEvent* event ) override;
|
||||
|
||||
private:
|
||||
caf::PdmUiTreeView* m_projectTreeView;
|
||||
};
|
||||
|
@ -769,7 +769,7 @@ void RiuViewerCommands::handlePickAction( int winPosX, int winPosY, Qt::Keyboard
|
||||
|
||||
{
|
||||
std::vector<caf::PdmUiItem*> uiItems;
|
||||
RiuMainWindow::instance()->projectTreeView()->selectedUiItems( uiItems );
|
||||
RiuMainWindow::instance()->projectTreeView( 0 )->selectedUiItems( uiItems );
|
||||
|
||||
if ( uiItems.size() == 1 )
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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 );
|
||||
|
||||
|
@ -11,7 +11,7 @@ set(RESINSIGHT_VERSION_TEXT "-dev")
|
||||
# Must be unique and increasing within one combination of major/minor/patch version
|
||||
# The uniqueness of this text is independent of RESINSIGHT_VERSION_TEXT
|
||||
# Format of text must be ".xx"
|
||||
set(RESINSIGHT_DEV_VERSION ".01")
|
||||
set(RESINSIGHT_DEV_VERSION ".02")
|
||||
|
||||
# https://github.com/CRAVA/crava/tree/master/libs/nrlib
|
||||
set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f")
|
||||
|
Loading…
Reference in New Issue
Block a user