Results 1 to 8 of 8

Thread: How to avoid calling boundingRect() & shape()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2007
    Location
    Pune, India
    Posts
    60
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to avoid calling boundingRect() & shape()

    By default item index method is BspTreeIndex, but as I want to move rectangles and lines adjoined it, it becomes very slow .
    Can you suggest any other method so that I can use to rendering.
    Also loading time is also too slow. How we can add items in Scene fastly & render it ?

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to avoid calling boundingRect() & shape()

    Quote Originally Posted by nileshsince1980 View Post
    By default item index method is BspTreeIndex, but as I want to move rectangles and lines adjoined it, it becomes very slow .
    Can you suggest any other method so that I can use to rendering.
    Also loading time is also too slow. How we can add items in Scene fastly & render it ?
    Have you increased bspTreeDepth?

  3. #3
    Join Date
    Sep 2007
    Location
    Pune, India
    Posts
    60
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to avoid calling boundingRect() & shape()

    how to set setBspTreeDepth property for scene items ???
    Also I have tried setViewport(new OpenGLWidget) but it slowa down rendering,
    Is there is another way to make fast rendering ??

  4. #4
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: How to avoid calling boundingRect() & shape()

    http://labs.trolltech.com/page/Proje...ys/DevDays2007
    The gv presentation might give you some tips to improve rendering speed.

    Have you cached the values to be returned in boundingRect() and shape() ? Probably you can inline them..

    Also have you profiled your app and tried to find out where exactly it is being slow ?

    P.S: Did you try out all the suggestions mentioned in the previous threads in this forum ?
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

  5. #5
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to avoid calling boundingRect() & shape()

    I have had cases where NoIndex was significantly faster than BspTreeIndex. If not, play around with bspTreeDepth().

    Gopala's suggestion to cache bounding rects and shapes is also a good one. Most of the examples show calculating rects and shapes on the fly, but this is not good. Put a QRectF and a QPainterPath member in your item, and return them when requested. Also keep your shapes simple. Sometimes a loose approximation of the shape is sufficient.

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
  •  
Qt is a trademark of The Qt Company.