Hello everyone - thx for reading!
I am working on a plot for an ad-converter. Because I'm new to C++, Qt and Qwt, I am currently studying the refreshtest example to get a clue of how to implement the plot. I think I get most of the code, but the following is not clear to me:
When and by what are these functions called:
QPointF CircularBuffer
::sample(size_t i
) const {
const int size = d_values.size();
int index = d_startIndex + i;
if ( index >= size )
index -= size;
const double x = i * d_step - d_offset - d_interval;
const double y = d_values.data()[index];
}
QRectF CircularBuffer
::boundingRect() const {
return QRectF(-1.0,
-d_interval,
2.0, d_interval
);
}
QPointF CircularBuffer::sample(size_t i) const
{
const int size = d_values.size();
int index = d_startIndex + i;
if ( index >= size )
index -= size;
const double x = i * d_step - d_offset - d_interval;
const double y = d_values.data()[index];
return QPointF(x, y);
}
QRectF CircularBuffer::boundingRect() const
{
return QRectF(-1.0, -d_interval, 2.0, d_interval);
}
To copy to clipboard, switch view to plain text mode
Since this is the Qwt forum, I desisted from posting the whole code of the example. I hope thats fine.
Looking forward for your help!
Emi
Bookmarks