Hallo All,

I would like to refresh my plot every 3 secs. In otherwords, the cycle of plot display, clear screen, and plot appears with newly read data will happen every 3secs. The problem is unless I use mouse click the plot or clear screen remains still. In otherwords, I need to click/hover mouse to see any change on screen. The setPlot() is called at an interval of 3sec or more (as expected), and the timing of calling the populate() is also ok. But the outputs (qDebug()) are printed only when there is a mouse movement. However, I expect the refreshing to happen by itself.

Any help would be greatly appreciated.

In page.cpp

Qt Code:
  1. void RealPlotWidget::plotData(QStringList fileList, const char* title, QStringList cBoxList, bool stackedButton )
  2. {
  3. Plot *plot = new Plot(fileList, title);
  4. ........
  5. ........
  6. QTimer *timer = new QTimer(this);
  7. connect (timer, SIGNAL(timeout()), plot, SLOT(setPlot())); //setPlot() is called every 3secs
  8. timer->start(3000);
  9. }
To copy to clipboard, switch view to plain text mode 

In dataplot.cpp
Qt Code:
  1. void Plot::populate()
  2. {
  3. qDebug()<<"populate:"<<QTime::currentTime();
  4. curvePlot = false;
  5. .........reads data + attaches to curve...
  6. .....
  7. replot();
  8. curvePlot = true;
  9. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void Plot::setPlot()
  2. {
  3. qDebug()<<"setPlot:"<<QTime::currentTime();
  4. if (this->curvePlot == true)
  5. this->detachItems(); //removes all plot items incl curves, markers etc.
  6.  
  7. QTimer::singleShot(1000, this, SLOT(populate())); //populate() is called after 1sec
  8. }
To copy to clipboard, switch view to plain text mode