Results 1 to 1 of 1

Thread: QGraphicView draw map shapes performance low?

  1. #1
    Join Date
    Jun 2013
    Qt products

    Default QGraphicView draw map shapes performance low?


    recently i just read out the doc about QGraphicsView framwork.

    and i just had a map app.

    this app draw only the line of Frontier and Province , the whole country painte on the graphicsview well. with scroll and scale.

    but problem occours when i add the QSimpleText of many city's name in the view.

    scrolling and scale became slow.

    i thought there must be some wrong with me ,because its just lines,point, text. no any pixelmap backgroup.

    compare to the example of 40000 item from QT's doc, i had quesions below:

    1. i just use one QGraphicPathItem to represent the Frontier of the whole nation.
    that means there is a complex Pathitem ,which boundingRect is almost filling the whole viewport,
    is that a problem?
    if i scroll a bit ,what will happen? the whole Frontier will be redraw?
    should i move this complex line to backgroud layer?
    or should i break the complex frontier to small pieces?
    i just dont known the the qraphicsView drawing Mechanism.

    2. my code is very simple, after add one pathItem of Frontier,
    i add many polygonItems of every Provinces,
    then add simpletextitems of every city's name.

    is this archtect occour problem from the aspect of performance?
    split them into GraphicView's layer will improve performance?

    3. i am planing to add movable object such as flying plane, i got a question about what part will be redraw when an small object moving,
    is the plane's rect only be drawn Or the whole Frontier line??

    becuase i thought the plane's boundingRect is Collisioning with the Frontier line's boundingRect beneath, then the view will
    assume the two item both need be redrawn.

    4. i see some post said to close the BSP tree indexing. my view item are almost static line, if i close the BSP tress, will i imrove performance? although they are static, but i need scroll and scale, i think BSP will help the painter find which part need to be redraw fast, am i right?
    Last edited by wjingyao; 20th June 2013 at 15:18.

Similar Threads

  1. Insert image to QGraphicView
    By jmarshellk in forum Newbie
    Replies: 2
    Last Post: 22nd March 2013, 06:21
  2. QGraphicView Optimizing cpu
    By fkili in forum Newbie
    Replies: 4
    Last Post: 27th September 2012, 14:02
  3. How to use QGraphicView?
    By karthic in forum Newbie
    Replies: 12
    Last Post: 27th April 2012, 08:06
  4. QPainter performance for zooming and draw...
    By Programm3r in forum Qt Programming
    Replies: 1
    Last Post: 15th April 2010, 10:29
  5. my QGraphicView problem
    By irmakci in forum Qt Programming
    Replies: 3
    Last Post: 19th July 2008, 18:40


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.