Results 1 to 5 of 5

Thread: Regarding QGraphicsView

  1. #1
    Join Date
    Dec 2006
    Posts
    17
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Regarding QGraphicsView

    Hello Guys..

    Could any one help me in knowing how QGraphicsView is better than QCanvas (Qt3.3.6).
    I have read the documenation which says...
    QGraphicsView uses BSP's to manage the scene..But i would like to know how it is better than the
    Chunks concept used in Qt3 in terms of space and time wise..

    Thanx

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Regarding QGraphicsView

    The graphics view is better in many other ways - it has been adapted to all the experiences gained during the years with the canvas.

    As for BSP trees vs chunks. I'm not sure about the chunks, but BSP trees are O(logn) complex which can be considered good.

  3. #3
    Join Date
    Dec 2006
    Posts
    17
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Regarding QGraphicsView

    I know that searching items on the canvas takes O( log n) ...
    But what about the space complexity ....?
    Thanx..

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Regarding QGraphicsView

    Quote Originally Posted by kiranraj View Post
    Could any one help me in knowing how QGraphicsView is better than QCanvas (Qt3.3.6).
    As Johan mentioned, it has many advantages. It's more scalable (QCanvas was designed to hold thousands of items, QGraphicsScene can easily handle even a milion items without a major slowdown), easier to handle thanks to the use of local coordinate systems for each item, has more capabilities - for example each item can handle events passed to it and many more. Most of it is mentioned in the docs.

    But i would like to know how it is better than the
    Chunks concept used in Qt3 in terms of space and time wise..
    In most cases it is better. For other cases (when you have many moving items that would have to be constantly moved between leaves of the tree) you can turn off BSP indexing.


    Quote Originally Posted by kiranraj View Post
    I know that searching items on the canvas takes O( log n) ...
    But what about the space complexity ....?
    QGraphicsItem uses not more than several bytes of RAM as most data has been moved to more specialised classes (for example animation support was moved to QGraphicsItemAnimation), that's why it's more scalable than QCanvas.

    If you're in doubt whether you should use QCanvas or switch to Qt4 and use QGraphicsView framework then in 99.9% of cases you should do the latter.

  5. #5
    Join Date
    Dec 2006
    Posts
    17
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Regarding QGraphicsView

    Thanx for the reply .....

Similar Threads

  1. How to use QGraphicsView and Scene right ...
    By Mike in forum Qt Programming
    Replies: 6
    Last Post: 22nd January 2007, 08:51
  2. QGraphicsView and QGraphicsScene speeds
    By jnk5y in forum Qt Programming
    Replies: 2
    Last Post: 20th October 2006, 07:13
  3. QGraphicsView and contextMenuEvent
    By laurabee in forum Qt Programming
    Replies: 1
    Last Post: 12th October 2006, 22:22
  4. My first program with QGraphicsView
    By Morea in forum Qt Programming
    Replies: 4
    Last Post: 8th September 2006, 19:46
  5. Examples of QGraphicsView
    By grosem in forum Newbie
    Replies: 16
    Last Post: 22nd August 2006, 21:48

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.