(#396) Showing default legend on top of the plot

This commit is contained in:
Pål Hagen 2015-08-31 15:23:20 +02:00
parent adba5ba6fc
commit 65f0c5fb42
2 changed files with 7 additions and 1 deletions

View File

@ -20,6 +20,7 @@
#include "RiuWellLogTracePlot.h"
#include "qwt_plot_grid.h"
#include "qwt_legend.h"
#include "qwt_scale_engine.h"
#include "qwt_plot_magnifier.h"
#include "qwt_plot_panner.h"
@ -33,6 +34,9 @@ RiuWellLogTracePlot::RiuWellLogTracePlot(QWidget* parent)
m_grid = new QwtPlotGrid();
m_grid->attach(this);
m_legend = new QwtLegend(this);
insertLegend(m_legend, QwtPlot::TopLegend);
QwtPlotMagnifier* magnifierDepth = new QwtPlotMagnifier(canvas());
magnifierDepth->setWheelModifiers(Qt::ControlModifier);
magnifierDepth->setAxisEnabled(QwtPlot::yLeft, true);

View File

@ -22,6 +22,7 @@
#include "qwt_plot.h"
class QwtPlotGrid;
class QwtLegend;
//==================================================================================================
//
@ -40,6 +41,7 @@ private:
void setDefaults();
private:
QwtPlotGrid* m_grid;
QwtPlotGrid* m_grid;
QwtLegend* m_legend;
};