mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2170 Summary Cross Plot : Add keyboard modifiers to source stepping
This commit is contained in:
@@ -35,6 +35,8 @@
|
||||
|
||||
#include "cafPdmUiTreeViewEditor.h"
|
||||
|
||||
#include <QKeyEvent>
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimSummaryCurveCollection, "RimSummaryCurveCollection");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -319,6 +321,72 @@ QString RimSummaryCurveCollection::compileAutoPlotTitle() const
|
||||
return title;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveCollection::handleKeyPressEvent(QKeyEvent* keyEvent)
|
||||
{
|
||||
if (!keyEvent) return;
|
||||
|
||||
RimSummaryPlotSourceStepping* sourceStepping = nullptr;
|
||||
{
|
||||
RimSummaryCrossPlot* summaryCrossPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType(summaryCrossPlot);
|
||||
|
||||
if (summaryCrossPlot)
|
||||
{
|
||||
sourceStepping = m_unionSourceStepping();
|
||||
}
|
||||
else
|
||||
{
|
||||
sourceStepping = m_ySourceStepping();
|
||||
}
|
||||
}
|
||||
|
||||
if (keyEvent->key() == Qt::Key_PageUp)
|
||||
{
|
||||
if (keyEvent->modifiers() & Qt::ShiftModifier)
|
||||
{
|
||||
sourceStepping->applyPrevCase();
|
||||
|
||||
keyEvent->accept();
|
||||
}
|
||||
else if (keyEvent->modifiers() & Qt::ControlModifier)
|
||||
{
|
||||
sourceStepping->applyPrevOtherIdentifier();
|
||||
|
||||
keyEvent->accept();
|
||||
}
|
||||
else
|
||||
{
|
||||
sourceStepping->applyPrevQuantity();
|
||||
|
||||
keyEvent->accept();
|
||||
}
|
||||
}
|
||||
else if (keyEvent->key() == Qt::Key_PageDown)
|
||||
{
|
||||
if (keyEvent->modifiers() & Qt::ShiftModifier)
|
||||
{
|
||||
sourceStepping->applyNextCase();
|
||||
|
||||
keyEvent->accept();
|
||||
}
|
||||
else if (keyEvent->modifiers() & Qt::ControlModifier)
|
||||
{
|
||||
sourceStepping->applyNextOtherIdentifier();
|
||||
|
||||
keyEvent->accept();
|
||||
}
|
||||
else
|
||||
{
|
||||
sourceStepping->applyNextQuantity();
|
||||
|
||||
keyEvent->accept();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user