Results 1 to 3 of 3

Thread: A perfect solution for complex painting

  1. #1
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default A perfect solution for complex painting

    Hi guys,

    I have to draw a map (vector format) and be able to resize it/scroll/detect colision between some objects. There is a background that do not changes and a lot of objects(items) a huge number of them(maybe about a milion of them) on the map.
    I have chosen the QGraphicsView/Scene but I am not sure it I have chosen the best possible option.
    While zooming int/out/ and using methods like: QGraphicsView::fitInView(QRectF), QGraphicsView::scale(..) there are delays or even the app halts.
    Also when I move the cursor on the view/scene the CPU usage increases fast.

    I hope that the painting using the view/scene can be optimized, but yet do not know how to achieve the best result.


    THank you for any ideas,

    Maverick
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  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: A perfect solution for complex painting

    1 million items?
    I am sure QGraphicsView can handle that too, but you need a pretty good computer.
    You cannot be serious when you ask it to behave for 1 million items like it behaves for 40000 or whatever.
    There are complex operations going on on the back of a QGraphicsScene, especially if you need collision detection.

    Regards

  3. #3
    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: A perfect solution for complex painting

    You can optimize at various places when using gv. But unless and until you profile your applications there is nothing specific to do. If you post the profile result, we may be able to help you. Ofcourse posting code too will help us to help you
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

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.