# HG changeset patch # User Hasan Yavuz Ă–ZDERYA # Date 2017-10-03 07:46:53 # Node ID 92e73c460a79c61a8e7f706feaf29b895738c51d # Parent 2b91fa46c0df804fb39f813a6d9d6f6d9e3939b3 update barplot on start diff --git a/src/barplot.cpp b/src/barplot.cpp --- a/src/barplot.cpp +++ b/src/barplot.cpp @@ -25,9 +25,12 @@ BarPlot::BarPlot(ChannelManager* channel _channelMan = channelMan; barChart.attach(this); - connect(_channelMan, &ChannelManager::dataAdded, [this]() - { - barChart.resample(); - replot(); - }); + connect(_channelMan, &ChannelManager::dataAdded, this, &BarPlot::update); + connect(_channelMan, &ChannelManager::numOfChannelsChanged, this, &BarPlot::update); } + +void BarPlot::update() +{ + barChart.resample(); + replot(); +} diff --git a/src/barplot.h b/src/barplot.h --- a/src/barplot.h +++ b/src/barplot.h @@ -37,6 +37,9 @@ private: BarChart barChart; QVector chartData() const; + +private slots: + void update(); }; #endif // BARPLOT_H