P@u1
5th July 2011, 11:48
Hi everyone,
I'm trying to display plots with QwtPlot in this way:
http://www.youtube.com/watch?v=-K9Aj49hHzA
Note how the curve is "eaten up" and not just moved.
My first approach looks like this:
void QwtTest::timerEvent(QTimerEvent * event)
{
for(int i = 0; i < 5; ++i)
{
yData_[currXPos_] = sin(2*pi*sinPos_/(0.169*dataSize_));
++sinPos_;
currXPos_ = (currXPos_ + 1) % dataSize_;
}
ui.qwtPlot->replot();
//everything until here is working, this makes the curve restart at the left hand side when the right hand side is reached
//now i want to overpaint parts of the plot to get the free space between the 2 parts of the curve
QPainter painter(ui.qwtPlot);
painter.setPen(Qt::blue);
painter.fillRect(ui.qwtPlot->rect(), QColor(0,0,0));
//this part does not do anything...
}
Do you have any suggestions?
Thanks in advance!
I'm trying to display plots with QwtPlot in this way:
http://www.youtube.com/watch?v=-K9Aj49hHzA
Note how the curve is "eaten up" and not just moved.
My first approach looks like this:
void QwtTest::timerEvent(QTimerEvent * event)
{
for(int i = 0; i < 5; ++i)
{
yData_[currXPos_] = sin(2*pi*sinPos_/(0.169*dataSize_));
++sinPos_;
currXPos_ = (currXPos_ + 1) % dataSize_;
}
ui.qwtPlot->replot();
//everything until here is working, this makes the curve restart at the left hand side when the right hand side is reached
//now i want to overpaint parts of the plot to get the free space between the 2 parts of the curve
QPainter painter(ui.qwtPlot);
painter.setPen(Qt::blue);
painter.fillRect(ui.qwtPlot->rect(), QColor(0,0,0));
//this part does not do anything...
}
Do you have any suggestions?
Thanks in advance!