mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Summary Plots: Support dragging wells, groups and regions into plots (#8550)
Support dropping wells, wellgroups and regions into summary plots.
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "RimMultiPlot.h"
|
||||
#include "RimPlot.h"
|
||||
#include "RimSummaryAddress.h"
|
||||
#include "RimSummaryAddressCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
@@ -251,11 +252,23 @@ Qt::ItemFlags RiuDragDrop::flags( const QModelIndex& index ) const
|
||||
if ( dynamic_cast<RimEclipseCase*>( uiItem ) || dynamic_cast<RimWellLogCurve*>( uiItem ) ||
|
||||
dynamic_cast<RimWellLogFileChannel*>( uiItem ) || dynamic_cast<RimPlot*>( uiItem ) ||
|
||||
dynamic_cast<RimSummaryCase*>( uiItem ) || dynamic_cast<RimSummaryCurve*>( uiItem ) ||
|
||||
dynamic_cast<RimSurface*>( uiItem ) || dynamic_cast<RimSummaryAddress*>( uiItem ) )
|
||||
dynamic_cast<RimSurface*>( uiItem ) )
|
||||
{
|
||||
// TODO: Remember to handle reservoir holding the main grid
|
||||
itemflags |= Qt::ItemIsDragEnabled;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto sumAdrColl = dynamic_cast<RimSummaryAddressCollection*>( uiItem );
|
||||
if ( sumAdrColl && sumAdrColl->canBeDragged() )
|
||||
{
|
||||
itemflags |= Qt::ItemIsDragEnabled;
|
||||
}
|
||||
auto sumAdr = dynamic_cast<RimSummaryAddress*>( uiItem );
|
||||
if ( sumAdr && sumAdr->canBeDragged() )
|
||||
{
|
||||
itemflags |= Qt::ItemIsDragEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_dragItems.empty() ) return itemflags;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user