#3277 Implement stepping for Common Data Source and rename Plot Source Stepping for summary plots.

* The name for the UI groups is now "Data Source" for both types of data source stepping.
This commit is contained in:
Gaute Lindkvist
2018-09-05 11:04:42 +02:00
parent ac8a11c813
commit d81b85c54c
12 changed files with 284 additions and 95 deletions

View File

@@ -399,8 +399,13 @@ void RiuSummaryQwtPlot::setCommonPlotBehaviour(QwtPlot* plot)
plot->setAxisTitle(QwtPlot::yLeft, axisTitle);
plot->setAxisTitle(QwtPlot::yRight, axisTitle);
// Enable mousetracking and event filter
// Set a focus policy to allow it taking key press events.
// This is not strictly necessary since this widget inherit QwtPlot
// which already has a focus policy.
// However, for completeness we still do it here.
plot->setFocusPolicy(Qt::WheelFocus);
// Enable mousetracking and event filter
plot->canvas()->setMouseTracking(true);
plot->canvas()->installEventFilter(plot);
plot->plotLayout()->setAlignCanvasToScales(true);

View File

@@ -73,6 +73,7 @@ RiuWellLogPlot::RiuWellLogPlot(RimWellLogPlot* plotDefinition, QWidget* parent)
this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
setFocusPolicy(Qt::StrongFocus);
connect(m_scrollBar, SIGNAL(valueChanged(int)), this, SLOT(slotSetMinDepth(int)));
}
@@ -233,6 +234,14 @@ QSize RiuWellLogPlot::sizeHint() const
return QSize(1, 1);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::keyPressEvent(QKeyEvent* keyEvent)
{
m_plotDefinition->handleKeyPressEvent(keyEvent);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -70,6 +70,9 @@ protected:
virtual void contextMenuEvent(QContextMenuEvent *) override;
virtual QSize sizeHint() const override;
virtual void keyPressEvent(QKeyEvent* keyEvent) override;
private:
void updateScrollBar(double minDepth, double maxDepth);
std::map<int, int> calculateTrackWidthsToMatchFrame(int frameWidth) const;