Skip to content
QtWS25 Last Chance
  • Resetting Plots in QCustomPlot

    Solved General and Desktop qcustomplot qelapsedtimer static
    6
    0 Votes
    6 Posts
    2k Views
    S
    Okay, I could fix the issue. The problem was my statement for resetting the plot. I used the following: for( int g=0; g<3; g++ ) { ui->plot_acceleration->graph(g)->data().clear(); } ui->plot_acceleration->replot(); Then I tried the following like it is mentioned here: pq_plot->graph(g)->data().data().clear(); But then the error occurs: error: member reference type 'QCPDataContainer<QCPGraphData> *' is a pointer; did you mean to use '->'? Then I used the autocorrection of Qt creator ('->' instead of ' . ') for( int g=0; g<3; g++ ) { ui->plot_acceleration->graph(g)->data().data()->clear(); } ui->plot_acceleration->replot(); And it is working now. Still don't know what exactly happens with the plot, when I use the first statement... When I use the first statement the plots are also gone after clicking on reset...
  • 0 Votes
    7 Posts
    3k Views
    K
    I know it's been a few years, but I was getting this because I had a defunct network printer in Windows. Removing the offending printer from Windows Printers settings fixed the problem for me.