Skip to content

Commit

Permalink
Solve issue CieNTi#7: press clear button delete data but not labels
Browse files Browse the repository at this point in the history
  • Loading branch information
glt248 committed Nov 22, 2019
1 parent e320b22 commit 6c186d6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,8 +817,16 @@ void MainWindow::on_actionDisconnect_triggered()
*/
void MainWindow::on_actionClear_triggered()
{
ui->plot->clearPlottables();
ui->listWidget_Channels->clear();

// from https://www.qcustomplot.com/index.php/support/forum/1304
// delete dataset but not the graph
for( int g=0; g<ui->plot->graphCount(); g++ )
{
ui->plot->graph(g)->data().data()->clear();
}
ui->plot->replot();
// ui->plot->clearPlottables();
// ui->listWidget_Channels->clear();
channels = 0;
dataPointNumber = 0;
emit setupPlot();
Expand Down

0 comments on commit 6c186d6

Please sign in to comment.