Results 1 to 3 of 3

Thread: QwtData::boundingRect() - different approach

  1. #1
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Lightbulb QwtData::boundingRect() - different approach

    Uwe,

    I've just noticed that QwtData::boundingRect() creates the rectangle every time from scratch.

    I've also noticed that except constructors and assigment operator, all other methods are constant.
    So, wouldn't it be possible to make the bounding rectangle generated only when the data changes and later just return that cache?

    For large data sets it would improve performance considerably.

    Is there a reason why it's done this way?

    Ps. All above is based on Qwt 5.2.0 which I'm using at the moment. I haven't had time to see if it has changed in 6.x, if it did - I'm sorry for bother you

    Cheers!

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

    Default Re: QwtData::boundingRect() - different approach

    Quote Originally Posted by Spitfire View Post
    All above is based on Qwt 5.2.0 which I'm using at the moment. I haven't had time to see if it has changed in 6.x, if it did - I'm sorry for bother you
    In Qwt 6.x the bounding rectangle is cached.

    Uwe

  3. #3
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtData::boundingRect() - different approach

    That's good to hear.

    Thanks and sorry for wasting your time!

Similar Threads

  1. Help with QwtData please~
    By KingsleyHau in forum Qwt
    Replies: 2
    Last Post: 1st November 2010, 19:11
  2. concurrency issues with QwtData
    By sun in forum Qwt
    Replies: 1
    Last Post: 28th January 2010, 09:08
  3. Why must I pad boundingRect() by 7 pixels
    By xenome in forum Qt Programming
    Replies: 3
    Last Post: 10th September 2009, 14:07
  4. Level of Details QwtData Technique?
    By baray98 in forum Qwt
    Replies: 1
    Last Post: 4th September 2009, 07:51
  5. boundingRect()?
    By aaron in forum Qt Programming
    Replies: 6
    Last Post: 21st April 2009, 09:43

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.