# HG changeset patch # User Hasan Yavuz Ă–ZDERYA # Date 2017-01-02 15:14:04 # Node ID d1ec2d001aae7987795fe028446d7b8331d45030 # Parent edd8b66ead8e0668bbad630d698fb2324b4e0a3d update symbol colors as well diff --git a/src/plot.h b/src/plot.h --- a/src/plot.h +++ b/src/plot.h @@ -37,28 +37,14 @@ class Plot : public QwtPlot { Q_OBJECT + friend class PlotManager; + public: Plot(QWidget* parent = 0); ~Plot(); static QColor makeColor(unsigned int channelIndex); -private: - bool isAutoScaled; - double yMin, yMax; - int symbolSize; - Zoomer zoomer; - ScaleZoomer sZoomer; - QwtPlotGrid grid; - PlotSnapshotOverlay* snapshotOverlay; - QwtPlotLegendItem legend; - QwtPlotTextLabel demoIndicator; - - /// update the display of symbols depending on `symbolSize` - void updateSymbols(); - void resetAxes(); - void resizeEvent(QResizeEvent * event); - public slots: void showGrid(bool show = true); void showMinorGrid(bool show = true); @@ -77,6 +63,24 @@ public slots: void onNumOfSamplesChanged(unsigned value); +protected: + /// update the display of symbols depending on `symbolSize` + void updateSymbols(); + +private: + bool isAutoScaled; + double yMin, yMax; + int symbolSize; + Zoomer zoomer; + ScaleZoomer sZoomer; + QwtPlotGrid grid; + PlotSnapshotOverlay* snapshotOverlay; + QwtPlotLegendItem legend; + QwtPlotTextLabel demoIndicator; + + void resetAxes(); + void resizeEvent(QResizeEvent * event); + private slots: void unzoomed(); void onXScaleChanged(); diff --git a/src/plotmanager.cpp b/src/plotmanager.cpp --- a/src/plotmanager.cpp +++ b/src/plotmanager.cpp @@ -18,6 +18,7 @@ */ #include +#include "qwt_symbol.h" #include "plot.h" #include "plotmanager.h" @@ -133,6 +134,7 @@ void PlotManager::onChannelInfoChanged(c // replot only updated widgets if (isMulti) { + plotWidgets[ci]->updateSymbols(); // required for color change plotWidgets[ci]->replot(); } } @@ -140,6 +142,7 @@ void PlotManager::onChannelInfoChanged(c // replot single widget if (!isMulti) { + plotWidgets[0]->updateSymbols(); replot(); } }