(#438) Showing "MD" or "TVD" on top of Y-axis according to depth type

This commit is contained in:
Pål Hagen
2015-09-11 12:35:59 +02:00
parent fa8f6108c7
commit 7901c3c4bd
3 changed files with 28 additions and 0 deletions

View File

@@ -26,6 +26,8 @@
#include "qwt_legend.h"
#include "qwt_scale_engine.h"
#include "qwt_plot_layout.h"
#include "qwt_scale_draw.h"
#include "qwt_text.h"
#include <QWheelEvent>
#include <QFont>
@@ -109,6 +111,13 @@ void RiuWellLogTracePlot::setDefaults()
QFont yAxisFont = axisFont(QwtPlot::yLeft);
yAxisFont.setPixelSize(9);
setAxisFont(QwtPlot::yLeft, yAxisFont);
QwtText axisTitleY = axisTitle(QwtPlot::yLeft);
QFont yAxisTitleFont = axisTitleY.font();
yAxisTitleFont.setPixelSize(12);
axisTitleY.setFont(yAxisTitleFont);
axisTitleY.setRenderFlags(Qt::AlignRight);
setAxisTitle(QwtPlot::yLeft, axisTitleY);
}
//--------------------------------------------------------------------------------------------------
@@ -121,6 +130,16 @@ void RiuWellLogTracePlot::setDepthRange(double minDepth, double maxDepth)
//replot();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogTracePlot::setDepthTitle(const QString& title)
{
QwtText axisTitleY = axisTitle(QwtPlot::yLeft);
axisTitleY.setText(title);
setAxisTitle(QwtPlot::yLeft, axisTitleY);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -41,6 +41,7 @@ public:
virtual ~RiuWellLogTracePlot();
void setDepthRange(double minDepth, double maxDepth);
void setDepthTitle(const QString& title);
protected:
virtual bool eventFilter(QObject* watched, QEvent* event);