I was trying to use the QwtSeriesData (Qwt6.0.2) and found some confusion with boundingRect().
I have a data like below
class MyData : public QwtSeriesData<QPointF>
{
public:
virtual size_t size() const
{
return 200;
}
virtual QPointF sample
( size_t i
) const {
QPointF point
(i
*10,i
%2 ?
300 : 500);
return point;
}
virtual QRectF boundingRect
() const {
QRectF r
= qwtBoundingRect
(*this);
//<--this produce left image //QRectF r(0,0,2000,1000); <-- this produced right image
return r;
}
};
class MyData : public QwtSeriesData<QPointF>
{
public:
virtual size_t size() const
{
return 200;
}
virtual QPointF sample( size_t i ) const
{
QPointF point(i*10,i%2 ? 300 : 500);
return point;
}
virtual QRectF boundingRect() const
{
QRectF r = qwtBoundingRect(*this); //<--this produce left image
//QRectF r(0,0,2000,1000); <-- this produced right image
return r;
}
};
To copy to clipboard, switch view to plain text mode
Screen Shot 2012-01-11 at 10.37.11 PM.pngScreen Shot 2012-01-11 at 10.37.42 PM.png
It seems like the boundingRect is giving some scale factor to the real data. Is this a bug? by the way I set the QwtPlot to be autoscaling.
baray98
Bookmarks