Enable drag and drop of all plots in tree view

This commit is contained in:
Gaute Lindkvist 2019-10-31 15:31:25 +01:00
parent e8c745d704
commit 39cefcd0bb

View File

@ -30,6 +30,7 @@
#include "RimGridPlotWindow.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimMimeData.h"
#include "RimPlotInterface.h"
#include "RimSummaryCase.h"
#include "RimSummaryCaseCollection.h"
#include "RimSummaryCaseMainCollection.h"
@ -162,7 +163,7 @@ Qt::ItemFlags RiuDragDrop::flags( const QModelIndex& index ) const
}
if ( dynamic_cast<RimEclipseCase*>( uiItem ) || dynamic_cast<RimWellLogCurve*>( uiItem ) ||
dynamic_cast<RimWellLogFileChannel*>( uiItem ) || dynamic_cast<RimWellLogTrack*>( uiItem ) ||
dynamic_cast<RimWellLogFileChannel*>( uiItem ) || dynamic_cast<RimPlotInterface*>( uiItem ) ||
dynamic_cast<RimSummaryCase*>( uiItem ) )
{
// TODO: Remember to handle reservoir holding the main grid
@ -185,6 +186,20 @@ Qt::ItemFlags RiuDragDrop::flags( const QModelIndex& index ) const
itemflags |= Qt::ItemIsDropEnabled;
}
}
else if ( dynamic_cast<RimGridPlotWindow*>( uiItem ) )
{
if ( RiuTypedPdmObjects<RimPlotInterface>::containsTypedObjects( m_dragItems ) )
{
itemflags |= Qt::ItemIsDropEnabled;
}
}
else if ( dynamic_cast<RimPlotInterface*>( uiItem ) )
{
if ( RiuTypedPdmObjects<RimPlotInterface>::containsTypedObjects( m_dragItems ) )
{
itemflags |= Qt::ItemIsDropEnabled;
}
}
else if ( dynamic_cast<RimWellLogTrack*>( uiItem ) )
{
if ( RiuTypedPdmObjects<RimWellLogCurve>::containsTypedObjects( m_dragItems ) )