Changeset - 3f92e133ff7b
[Not reviewed]
default
0 2 0
Hasan Yavuz Ă–ZDERYA - 10 years ago 2016-03-20 12:19:59
hy@ozderya.net
removed underscore prefix from private member which do not have public counterparts
2 files changed with 32 insertions and 32 deletions:
0 comments (0 inline, 0 general)
src/plot.cpp
Show inline comments
 
@@ -25,54 +25,54 @@
 
#include "utils.h"
 

	
 
Plot::Plot(QWidget* parent) :
 
    QwtPlot(parent),
 
    zoomer(this->canvas(), false),
 
    sZoomer(this, &zoomer),
 
    _showGridAction("Grid", this),
 
    _showMinorGridAction("Minor Grid", this),
 
    _unzoomAction("Unzoom", this),
 
    _darkBackgroundAction("Dark Background", this)
 
    showGridAction("Grid", this),
 
    showMinorGridAction("Minor Grid", this),
 
    unzoomAction("Unzoom", this),
 
    darkBackgroundAction("Dark Background", this)
 
{
 
    isAutoScaled = true;
 

	
 
    QObject::connect(&zoomer, &Zoomer::unzoomed, this, &Plot::unzoomed);
 

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

	
 
    showGrid(false);
 
    darkBackground(false);
 

	
 
    _showGridAction.setToolTip("Show Grid");
 
    _showMinorGridAction.setToolTip("Show Minor Grid");
 
    _unzoomAction.setToolTip("Unzoom the Plot");
 
    _darkBackgroundAction.setToolTip("Enable Dark Plot Background");
 
    showGridAction.setToolTip("Show Grid");
 
    showMinorGridAction.setToolTip("Show Minor Grid");
 
    unzoomAction.setToolTip("Unzoom the Plot");
 
    darkBackgroundAction.setToolTip("Enable Dark Plot Background");
 

	
 
    _showGridAction.setShortcut(QKeySequence("G"));
 
    _showMinorGridAction.setShortcut(QKeySequence("M"));
 
    showGridAction.setShortcut(QKeySequence("G"));
 
    showMinorGridAction.setShortcut(QKeySequence("M"));
 

	
 
    _showGridAction.setCheckable(true);
 
    _showMinorGridAction.setCheckable(true);
 
    _darkBackgroundAction.setCheckable(true);
 
    showGridAction.setCheckable(true);
 
    showMinorGridAction.setCheckable(true);
 
    darkBackgroundAction.setCheckable(true);
 

	
 
    _showGridAction.setChecked(false);
 
    _showMinorGridAction.setChecked(false);
 
    _darkBackgroundAction.setChecked(false);
 
    showGridAction.setChecked(false);
 
    showMinorGridAction.setChecked(false);
 
    darkBackgroundAction.setChecked(false);
 

	
 
    _showMinorGridAction.setEnabled(false);
 
    showMinorGridAction.setEnabled(false);
 

	
 
    connect(&_showGridAction, SELECT<bool>::OVERLOAD_OF(&QAction::triggered),
 
    connect(&showGridAction, SELECT<bool>::OVERLOAD_OF(&QAction::triggered),
 
            this, &Plot::showGrid);
 
    connect(&_showGridAction, SELECT<bool>::OVERLOAD_OF(&QAction::triggered),
 
            &_showMinorGridAction, &QAction::setEnabled);
 
    connect(&_showMinorGridAction, SELECT<bool>::OVERLOAD_OF(&QAction::triggered),
 
    connect(&showGridAction, SELECT<bool>::OVERLOAD_OF(&QAction::triggered),
 
            &showMinorGridAction, &QAction::setEnabled);
 
    connect(&showMinorGridAction, SELECT<bool>::OVERLOAD_OF(&QAction::triggered),
 
            this, &Plot::showMinorGrid);
 
    connect(&_unzoomAction, &QAction::triggered, this, &Plot::unzoom);
 
    connect(&_darkBackgroundAction, SELECT<bool>::OVERLOAD_OF(&QAction::triggered),
 
    connect(&unzoomAction, &QAction::triggered, this, &Plot::unzoom);
 
    connect(&darkBackgroundAction, SELECT<bool>::OVERLOAD_OF(&QAction::triggered),
 
            this, &Plot::darkBackground);
 

	
 
    snapshotOverlay = NULL;
 
}
 

	
 
Plot::~Plot()
 
@@ -94,16 +94,16 @@ void Plot::setAxis(bool autoScaled, doub
 
    resetAxes();
 
}
 

	
 
QList<QAction*> Plot::menuActions()
 
{
 
    QList<QAction*> actions;
 
    actions << &_showGridAction;
 
    actions << &_showMinorGridAction;
 
    actions << &_unzoomAction;
 
    actions << &_darkBackgroundAction;
 
    actions << &showGridAction;
 
    actions << &showMinorGridAction;
 
    actions << &unzoomAction;
 
    actions << &darkBackgroundAction;
 
    return actions;
 
}
 

	
 
void Plot::resetAxes()
 
{
 
    if (isAutoScaled)
 
@@ -199,13 +199,13 @@ QColor Plot::makeColor(unsigned int chan
 

	
 
void Plot::flashSnapshotOverlay()
 
{
 
    if (snapshotOverlay != NULL) delete snapshotOverlay;
 

	
 
    QColor color;
 
    if (_darkBackgroundAction.isChecked())
 
    if (darkBackgroundAction.isChecked())
 
    {
 
        color = QColor(Qt::white);
 
    }
 
    else
 
    {
 
        color = QColor(Qt::black);
src/plot.h
Show inline comments
 
@@ -51,16 +51,16 @@ private:
 
    Zoomer zoomer;
 
    ScaleZoomer sZoomer;
 
    QwtPlotGrid grid;
 
    PlotSnapshotOverlay* snapshotOverlay;
 
    QwtPlotLegendItem legend;
 

	
 
    QAction _showGridAction;
 
    QAction _showMinorGridAction;
 
    QAction _unzoomAction;
 
    QAction _darkBackgroundAction;
 
    QAction showGridAction;
 
    QAction showMinorGridAction;
 
    QAction unzoomAction;
 
    QAction darkBackgroundAction;
 

	
 
    void resetAxes();
 

	
 
public slots:
 
    void showGrid(bool show = true);
 
    void showMinorGrid(bool show = true);
0 comments (0 inline, 0 general)