#4825 Summary Plot Stepping : Key events are not routed correctly

This commit is contained in:
Magne Sjaastad
2019-10-04 13:20:15 +02:00
parent a6733ae776
commit 2998ad3bed
11 changed files with 196 additions and 128 deletions

View File

@@ -556,31 +556,7 @@ void RiuPlotMainWindow::updateSummaryPlotToolBar( bool forceUpdateUi )
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>( m_activePlotViewWindow.p() );
if ( summaryPlot )
{
std::vector<caf::PdmFieldHandle*> toolBarFields;
RimEnsembleCurveSetCollection* ensembleCurveSetColl = nullptr;
caf::PdmObjectHandle* selectedObj = dynamic_cast<caf::PdmObjectHandle*>(
caf::SelectionManager::instance()->selectedItem() );
if ( selectedObj )
{
selectedObj->firstAncestorOrThisOfType( ensembleCurveSetColl );
}
if ( ensembleCurveSetColl )
{
toolBarFields = ensembleCurveSetColl->fieldsToShowInToolbar();
}
else
{
toolBarFields = summaryPlot->summaryCurveCollection()->fieldsToShowInToolbar();
if ( toolBarFields.empty() )
{
// Show ensemble stepping if no fields are available from summary stepping
toolBarFields = summaryPlot->ensembleCurveSetCollection()->fieldsToShowInToolbar();
}
}
std::vector<caf::PdmFieldHandle*> toolBarFields = summaryPlot->fieldsToShowInToolbar();
if ( !m_summaryPlotToolBarEditor->isEditorDataValid( toolBarFields ) )
{

View File

@@ -169,10 +169,9 @@ void RiuSummaryQwtPlot::keyPressEvent( QKeyEvent* keyEvent )
{
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>( ownerPlotDefinition() );
if ( summaryPlot && summaryPlot->summaryCurveCollection() )
if ( summaryPlot )
{
RimSummaryCurveCollection* curveColl = summaryPlot->summaryCurveCollection();
curveColl->handleKeyPressEvent( keyEvent );
summaryPlot->handleKeyPressEvent( keyEvent );
}
}