Changeset - 11e2033df414
[Not reviewed]
default
0 3 0
Hasan Yavuz Ă–ZDERYA - 10 years ago 2016-03-20 12:15:46
hy@ozderya.net
added a simple legend
3 files changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/mainwindow.cpp
Show inline comments
 
@@ -157,7 +157,7 @@ MainWindow::MainWindow(QWidget *parent) 
 
    for (unsigned int i = 0; i < numOfChannels; i++)
 
    {
 
        channelBuffers.append(new FrameBuffer(numOfSamples));
 
        curves.append(new QwtPlotCurve());
 
        curves.append(new QwtPlotCurve(QString("Channel %1").arg(i+1)));
 
        curves[i]->setSamples(channelBuffers[i]);
 
        curves[i]->setPen(Plot::makeColor(i));
 
        curves[i]->attach(ui->plot);
 
@@ -344,7 +344,7 @@ void MainWindow::onNumOfChannelsChanged(
 
        for (unsigned int i = 0; i < numOfChannels - oldNum; i++)
 
        {
 
            channelBuffers.append(new FrameBuffer(numOfSamples));
 
            curves.append(new QwtPlotCurve());
 
            curves.append(new QwtPlotCurve(QString("Channel %1").arg(oldNum+i+1)));
 
            curves.last()->setSamples(channelBuffers.last());
 
            curves.last()->setPen(Plot::makeColor(curves.length()-1));
 
            curves.last()->attach(ui->plot);
src/plot.cpp
Show inline comments
 
@@ -39,6 +39,7 @@ Plot::Plot(QWidget* parent) :
 

	
 
    zoomer.setZoomBase();
 
    grid.attach(this);
 
    legend.attach(this);
 

	
 
    showGrid(false);
 
    darkBackground(false);
src/plot.h
Show inline comments
 
@@ -26,6 +26,7 @@
 
#include <qwt_plot.h>
 
#include <qwt_plot_grid.h>
 
#include <qwt_plot_shapeitem.h>
 
#include <qwt_plot_legenditem.h>
 

	
 
#include "zoomer.h"
 
#include "scalezoomer.h"
 
@@ -51,6 +52,7 @@ private:
 
    ScaleZoomer sZoomer;
 
    QwtPlotGrid grid;
 
    PlotSnapshotOverlay* snapshotOverlay;
 
    QwtPlotLegendItem legend;
 

	
 
    QAction _showGridAction;
 
    QAction _showMinorGridAction;
0 comments (0 inline, 0 general)