From 39cefcd0bb517043be2b415260691a1bab52b60c Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Thu, 31 Oct 2019 15:31:25 +0100 Subject: [PATCH] Enable drag and drop of all plots in tree view --- ApplicationCode/UserInterface/RiuDragDrop.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/UserInterface/RiuDragDrop.cpp b/ApplicationCode/UserInterface/RiuDragDrop.cpp index 752a92e17e..faa45f7211 100644 --- a/ApplicationCode/UserInterface/RiuDragDrop.cpp +++ b/ApplicationCode/UserInterface/RiuDragDrop.cpp @@ -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( uiItem ) || dynamic_cast( uiItem ) || - dynamic_cast( uiItem ) || dynamic_cast( uiItem ) || + dynamic_cast( uiItem ) || dynamic_cast( uiItem ) || dynamic_cast( 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( uiItem ) ) + { + if ( RiuTypedPdmObjects::containsTypedObjects( m_dragItems ) ) + { + itemflags |= Qt::ItemIsDropEnabled; + } + } + else if ( dynamic_cast( uiItem ) ) + { + if ( RiuTypedPdmObjects::containsTypedObjects( m_dragItems ) ) + { + itemflags |= Qt::ItemIsDropEnabled; + } + } else if ( dynamic_cast( uiItem ) ) { if ( RiuTypedPdmObjects::containsTypedObjects( m_dragItems ) )