Results 1 to 3 of 3

Thread: QwtSeriesData and boundingRect()

  1. #1
    Join Date
    Aug 2007
    Posts
    262
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default QwtSeriesData and boundingRect()

    I was trying to use the QwtSeriesData (Qwt6.0.2) and found some confusion with boundingRect().
    I have a data like below
    Qt Code:
    1. class MyData : public QwtSeriesData<QPointF>
    2. {
    3. public:
    4. virtual size_t size() const
    5. {
    6. return 200;
    7. }
    8. virtual QPointF sample( size_t i ) const
    9. {
    10. QPointF point(i*10,i%2 ? 300 : 500);
    11. return point;
    12. }
    13. virtual QRectF boundingRect() const
    14. {
    15. QRectF r = qwtBoundingRect(*this); //<--this produce left image
    16. //QRectF r(0,0,2000,1000); <-- this produced right image
    17. return r;
    18. }
    19. };
    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

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,151
    Thanked 826 Times in 775 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtSeriesData and boundingRect()

    I doubt, that the left image is from the code you have posted.

    Uwe

  3. #3
    Join Date
    Aug 2007
    Posts
    262
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtSeriesData and boundingRect()

    aha i found my woes...I have set QwtCurve::setYAxis(QwtPlot::yRight)...but it was not enabled.

    Thanks uwe for your time

Similar Threads

  1. Replies: 1
    Last Post: 2nd May 2011, 19:52
  2. Replies: 1
    Last Post: 18th June 2010, 12:21
  3. Convert QwtRasterData to QwtSeriesData
    By bigjoeystud in forum Qwt
    Replies: 3
    Last Post: 25th August 2009, 16:06
  4. boundingRect()?
    By aaron in forum Qt Programming
    Replies: 6
    Last Post: 21st April 2009, 10:43
  5. setRect vs boundingRect
    By zgulser in forum Qt Programming
    Replies: 5
    Last Post: 5th February 2009, 01:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.